what-the-bank/sources/com/huawei/hms/common/internal/Objects.java

81 lines
2.3 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.huawei.hms.common.internal;
import com.airbnb.deeplinkdispatch.UrlTreeKt;
import com.huawei.hms.framework.common.ContainerUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/* loaded from: classes2.dex */
public final class Objects {
/* loaded from: classes2.dex */
public static final class ToStringHelper {
private final List<String> a;
private final Object b;
public final ToStringHelper add(String str, Object obj) {
String str2 = (String) Preconditions.checkNotNull(str);
String valueOf = String.valueOf(obj);
StringBuilder sb = new StringBuilder(str2.length() + valueOf.length() + 1);
sb.append(str2);
sb.append(ContainerUtils.KEY_VALUE_DELIMITER);
sb.append(valueOf);
this.a.add(sb.toString());
return this;
}
public final String toString() {
String simpleName = this.b.getClass().getSimpleName();
StringBuilder sb = new StringBuilder(100);
sb.append(simpleName);
sb.append(UrlTreeKt.componentParamPrefixChar);
int size = this.a.size();
for (int i = 0; i < size; i++) {
sb.append(this.a.get(i));
if (i < size - 1) {
sb.append(", ");
}
}
sb.append(UrlTreeKt.componentParamSuffixChar);
return sb.toString();
}
private ToStringHelper(Object obj) {
this.b = Preconditions.checkNotNull(obj);
this.a = new ArrayList();
}
}
private Objects() {
throw new AssertionError("Uninstantiable");
}
public static boolean equal(Object obj, Object obj2) {
if (obj == obj2) {
return true;
}
return obj != null && obj.equals(obj2);
}
public static int hashCode(Object... objArr) {
return Arrays.hashCode(objArr);
}
public static boolean isNull(Object... objArr) {
if (objArr == null) {
return true;
}
for (Object obj : objArr) {
if (obj == null) {
return true;
}
}
return false;
}
public static ToStringHelper toStringHelper(Object obj) {
return new ToStringHelper(obj);
}
}