2021-06-27 20:44:35 +00:00
|
|
|
package androidx.core.util;
|
|
|
|
|
|
|
|
import androidx.annotation.NonNull;
|
2021-12-21 23:37:30 +00:00
|
|
|
import b.d.b.a.a;
|
2022-03-02 20:59:20 +00:00
|
|
|
/* loaded from: classes.dex */
|
2021-06-27 20:44:35 +00:00
|
|
|
public class Pair<F, S> {
|
|
|
|
public final F first;
|
|
|
|
public final S second;
|
|
|
|
|
2021-11-08 18:25:28 +00:00
|
|
|
public Pair(F f, S s2) {
|
2021-06-27 20:44:35 +00:00
|
|
|
this.first = f;
|
2021-11-08 18:25:28 +00:00
|
|
|
this.second = s2;
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@NonNull
|
2021-12-21 23:37:30 +00:00
|
|
|
public static <A, B> Pair<A, B> create(A a, B b2) {
|
|
|
|
return new Pair<>(a, b2);
|
2021-06-27 20:44:35 +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-08 18:25:28 +00:00
|
|
|
S s2 = this.second;
|
|
|
|
if (s2 != null) {
|
|
|
|
i = s2.hashCode();
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
return hashCode ^ i;
|
|
|
|
}
|
|
|
|
|
|
|
|
@NonNull
|
|
|
|
public String toString() {
|
2022-03-30 16:43:10 +00:00
|
|
|
StringBuilder R = a.R("Pair{");
|
|
|
|
R.append(this.first);
|
|
|
|
R.append(" ");
|
|
|
|
R.append(this.second);
|
|
|
|
R.append("}");
|
|
|
|
return R.toString();
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
}
|