
org.holoeverywhere.util.Pair Maven / Gradle / Ivy
package org.holoeverywhere.util;
public class Pair {
public static Pair create(A a, B b) {
return new Pair(a, b);
}
public final F first;
public final S second;
public Pair(F first, S second) {
this.first = first;
this.second = second;
}
@Override
@SuppressWarnings("unchecked")
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (!(o instanceof Pair)) {
return false;
}
try {
Pair other = (Pair) o;
return first.equals(other.first) && second.equals(other.second);
} catch (ClassCastException e) {
return false;
}
}
@Override
public int hashCode() {
int result = 17;
result = 31 * result + first.hashCode();
result = 31 * result + second.hashCode();
return result;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy