what-the-bank/sources/com/google/common/collect/AbstractMapEntry.java

46 lines
1.4 KiB
Java

package com.google.common.collect;
import com.google.common.base.Objects;
import com.huawei.hms.framework.common.ContainerUtils;
import java.util.Map;
/* loaded from: classes2.dex */
abstract class AbstractMapEntry<K, V> implements Map.Entry<K, V> {
@Override // java.util.Map.Entry
public abstract K getKey();
@Override // java.util.Map.Entry
public abstract V getValue();
@Override // java.util.Map.Entry
public V setValue(V v) {
throw new UnsupportedOperationException();
}
@Override // java.util.Map.Entry
public boolean equals(Object obj) {
if (!(obj instanceof Map.Entry)) {
return false;
}
Map.Entry entry = (Map.Entry) obj;
return Objects.equal(getKey(), entry.getKey()) && Objects.equal(getValue(), entry.getValue());
}
@Override // java.util.Map.Entry
public int hashCode() {
K key = getKey();
V value = getValue();
return (key == null ? 0 : key.hashCode()) ^ (value != null ? value.hashCode() : 0);
}
public String toString() {
String valueOf = String.valueOf(getKey());
String valueOf2 = String.valueOf(getValue());
StringBuilder sb = new StringBuilder(String.valueOf(valueOf).length() + 1 + String.valueOf(valueOf2).length());
sb.append(valueOf);
sb.append(ContainerUtils.KEY_VALUE_DELIMITER);
sb.append(valueOf2);
return sb.toString();
}
}