48 lines
1.1 KiB
Java
48 lines
1.1 KiB
Java
package androidx.core.util;
|
|
|
|
import androidx.annotation.NonNull;
|
|
import c.d.b.a.a;
|
|
public class Pair<F, S> {
|
|
public final F first;
|
|
public final S second;
|
|
|
|
public Pair(F f, S s2) {
|
|
this.first = f;
|
|
this.second = s2;
|
|
}
|
|
|
|
@NonNull
|
|
public static <A, B> Pair<A, B> create(A a, B b) {
|
|
return new Pair<>(a, b);
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (!(obj instanceof Pair)) {
|
|
return false;
|
|
}
|
|
Pair pair = (Pair) obj;
|
|
return ObjectsCompat.equals(pair.first, this.first) && ObjectsCompat.equals(pair.second, this.second);
|
|
}
|
|
|
|
public int hashCode() {
|
|
F f = this.first;
|
|
int i = 0;
|
|
int hashCode = f == null ? 0 : f.hashCode();
|
|
S s2 = this.second;
|
|
if (s2 != null) {
|
|
i = s2.hashCode();
|
|
}
|
|
return hashCode ^ i;
|
|
}
|
|
|
|
@NonNull
|
|
public String toString() {
|
|
StringBuilder O = a.O("Pair{");
|
|
O.append((Object) this.first);
|
|
O.append(" ");
|
|
O.append((Object) this.second);
|
|
O.append("}");
|
|
return O.toString();
|
|
}
|
|
}
|