com.github.simy4.xpath.util.Pair Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xpath-to-xml-test Show documentation
Show all versions of xpath-to-xml-test Show documentation
Convenient utility to build XML models by evaluating XPath expressions
package com.github.simy4.xpath.util;
public final class Pair {
private final F first;
private final S second;
public static Pair of(A first, B second) {
return new Pair(first, second);
}
public Pair(F first, S second) {
this.first = first;
this.second = second;
}
public F getFirst() {
return first;
}
public S getSecond() {
return second;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Pair, ?> pair = (Pair, ?>) o;
if (first != null ? !first.equals(pair.first) : pair.first != null) {
return false;
}
return second != null ? second.equals(pair.second) : pair.second == null;
}
@Override
public int hashCode() {
int result = first != null ? first.hashCode() : 0;
result = 31 * result + (second != null ? second.hashCode() : 0);
return result;
}
@Override
public String toString() {
return first + " -> " + second;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy