91 lines
2.7 KiB
Java
91 lines
2.7 KiB
Java
|
package com.google.android.gms.common.internal;
|
||
|
|
||
|
import android.os.Bundle;
|
||
|
import com.airbnb.deeplinkdispatch.UrlTreeKt;
|
||
|
import com.huawei.hms.framework.common.ContainerUtils;
|
||
|
import java.util.ArrayList;
|
||
|
import java.util.Arrays;
|
||
|
import java.util.List;
|
||
|
import java.util.Set;
|
||
|
|
||
|
/* loaded from: classes.dex */
|
||
|
public final class Objects {
|
||
|
|
||
|
/* loaded from: classes.dex */
|
||
|
public static final class ToStringHelper {
|
||
|
private final List zza;
|
||
|
private final Object zzb;
|
||
|
|
||
|
/* synthetic */ ToStringHelper(Object obj, zzah zzahVar) {
|
||
|
Preconditions.checkNotNull(obj);
|
||
|
this.zzb = obj;
|
||
|
this.zza = new ArrayList();
|
||
|
}
|
||
|
|
||
|
public final ToStringHelper add(String str, Object obj) {
|
||
|
List list = this.zza;
|
||
|
Preconditions.checkNotNull(str);
|
||
|
String valueOf = String.valueOf(obj);
|
||
|
StringBuilder sb = new StringBuilder();
|
||
|
sb.append(str);
|
||
|
sb.append(ContainerUtils.KEY_VALUE_DELIMITER);
|
||
|
sb.append(valueOf);
|
||
|
list.add(sb.toString());
|
||
|
return this;
|
||
|
}
|
||
|
|
||
|
public final String toString() {
|
||
|
StringBuilder sb = new StringBuilder(100);
|
||
|
sb.append(this.zzb.getClass().getSimpleName());
|
||
|
sb.append(UrlTreeKt.componentParamPrefixChar);
|
||
|
int size = this.zza.size();
|
||
|
for (int i = 0; i < size; i++) {
|
||
|
sb.append((String) this.zza.get(i));
|
||
|
if (i < size - 1) {
|
||
|
sb.append(", ");
|
||
|
}
|
||
|
}
|
||
|
sb.append(UrlTreeKt.componentParamSuffixChar);
|
||
|
return sb.toString();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
private Objects() {
|
||
|
throw new AssertionError("Uninstantiable");
|
||
|
}
|
||
|
|
||
|
public static boolean checkBundlesEquality(Bundle bundle, Bundle bundle2) {
|
||
|
if (bundle == null || bundle2 == null) {
|
||
|
return bundle == bundle2;
|
||
|
}
|
||
|
if (bundle.size() != bundle2.size()) {
|
||
|
return false;
|
||
|
}
|
||
|
Set<String> keySet = bundle.keySet();
|
||
|
if (!keySet.containsAll(bundle2.keySet())) {
|
||
|
return false;
|
||
|
}
|
||
|
for (String str : keySet) {
|
||
|
if (!equal(bundle.get(str), bundle2.get(str))) {
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
public static boolean equal(Object obj, Object obj2) {
|
||
|
if (obj != obj2) {
|
||
|
return obj != null && obj.equals(obj2);
|
||
|
}
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
public static int hashCode(Object... objArr) {
|
||
|
return Arrays.hashCode(objArr);
|
||
|
}
|
||
|
|
||
|
public static ToStringHelper toStringHelper(Object obj) {
|
||
|
return new ToStringHelper(obj, null);
|
||
|
}
|
||
|
}
|