2021-07-24 02:37:17 +00:00
|
|
|
package androidx.core.util;
|
|
|
|
|
|
|
|
import androidx.annotation.NonNull;
|
2021-12-17 21:59:34 +00:00
|
|
|
import b.d.b.a.a;
|
2022-03-07 09:34:54 +00:00
|
|
|
/* loaded from: classes.dex */
|
2021-07-24 02:37:17 +00:00
|
|
|
public class Pair<F, S> {
|
|
|
|
public final F first;
|
|
|
|
public final S second;
|
|
|
|
|
2021-11-02 06:38:17 +00:00
|
|
|
public Pair(F f, S s2) {
|
2021-07-24 02:37:17 +00:00
|
|
|
this.first = f;
|
2021-11-02 06:38:17 +00:00
|
|
|
this.second = s2;
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@NonNull
|
2021-12-17 21:59:34 +00:00
|
|
|
public static <A, B> Pair<A, B> create(A a, B b2) {
|
|
|
|
return new Pair<>(a, b2);
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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();
|
2021-11-02 06:38:17 +00:00
|
|
|
S s2 = this.second;
|
|
|
|
if (s2 != null) {
|
|
|
|
i = s2.hashCode();
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
|
|
|
return hashCode ^ i;
|
|
|
|
}
|
|
|
|
|
|
|
|
@NonNull
|
|
|
|
public String toString() {
|
2022-03-14 07:58:47 +00:00
|
|
|
StringBuilder S = a.S("Pair{");
|
|
|
|
S.append(this.first);
|
|
|
|
S.append(" ");
|
|
|
|
S.append(this.second);
|
|
|
|
S.append("}");
|
|
|
|
return S.toString();
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
|
|
|
}
|