blob: 02600957e861e4108df0820a3bfce04f9bbaf1b1 [file] [log] [blame] [raw]
package us.myles.ViaVersion.api;
import java.util.Objects;
public class Triple<A, B, C> {
private final A first;
private final B second;
private final C third;
public Triple(A first, B second, C third) {
this.first = first;
this.second = second;
this.third = third;
}
public A getFirst() {
return first;
}
public B getSecond() {
return second;
}
public C getThird() {
return third;
}
@Override
public String toString() {
return "Triple{" + first + ", " + second + ", " + third + '}';
}
@Override
public boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Triple<?, ?, ?> triple = (Triple<?, ?, ?>) o;
if (!Objects.equals(first, triple.first)) return false;
if (!Objects.equals(second, triple.second)) return false;
return Objects.equals(third, triple.third);
}
@Override
public int hashCode() {
int result = first != null ? first.hashCode() : 0;
result = 31 * result + (second != null ? second.hashCode() : 0);
result = 31 * result + (third != null ? third.hashCode() : 0);
return result;
}
}