org.openlca.util.Pair Maven / Gradle / Ivy
The newest version!
package org.openlca.util;
import java.util.Objects;
public class Pair {
public F first;
public S second;
public Pair() {
}
public Pair(F first, S second) {
this.first = first;
this.second = second;
}
public static Pair of(F first, S second) {
return new Pair<>(first, second);
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
Pair, ?> pair = (Pair, ?>) o;
return Objects.equals(first, pair.first) &&
Objects.equals(second, pair.second);
}
@Override
public int hashCode() {
return Objects.hash(first, second);
}
@Override
public String toString() {
return "Pair{first=" + first + ", second=" + second + '}';
}
}