2021-08-09 22:50:52 +00:00
|
|
|
package c.i.a.c.h2.y;
|
|
|
|
|
|
|
|
import androidx.annotation.Nullable;
|
|
|
|
import c.i.b.a.c;
|
|
|
|
import java.nio.ByteBuffer;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Arrays;
|
|
|
|
import java.util.Collections;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Objects;
|
|
|
|
/* compiled from: DefaultContentMetadata */
|
|
|
|
public final class n implements l {
|
|
|
|
public static final n a = new n(Collections.emptyMap());
|
|
|
|
public int b;
|
|
|
|
|
|
|
|
/* renamed from: c reason: collision with root package name */
|
2021-08-31 07:21:49 +00:00
|
|
|
public final Map<String, byte[]> f909c;
|
2021-08-09 22:50:52 +00:00
|
|
|
|
|
|
|
public n() {
|
|
|
|
this(Collections.emptyMap());
|
|
|
|
}
|
|
|
|
|
|
|
|
public n(Map<String, byte[]> map) {
|
2021-08-31 07:21:49 +00:00
|
|
|
this.f909c = Collections.unmodifiableMap(map);
|
2021-08-09 22:50:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static boolean b(Map<String, byte[]> map, Map<String, byte[]> map2) {
|
|
|
|
if (map.size() != map2.size()) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
for (Map.Entry<String, byte[]> entry : map.entrySet()) {
|
|
|
|
if (!Arrays.equals(entry.getValue(), map2.get(entry.getKey()))) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public n a(m mVar) {
|
|
|
|
byte[] bArr;
|
2021-08-31 07:21:49 +00:00
|
|
|
HashMap hashMap = new HashMap(this.f909c);
|
2021-08-09 22:50:52 +00:00
|
|
|
Objects.requireNonNull(mVar);
|
|
|
|
List unmodifiableList = Collections.unmodifiableList(new ArrayList(mVar.b));
|
|
|
|
for (int i = 0; i < unmodifiableList.size(); i++) {
|
|
|
|
hashMap.remove(unmodifiableList.get(i));
|
|
|
|
}
|
|
|
|
HashMap hashMap2 = new HashMap(mVar.a);
|
|
|
|
for (Map.Entry entry : hashMap2.entrySet()) {
|
|
|
|
Object value = entry.getValue();
|
|
|
|
if (value instanceof byte[]) {
|
|
|
|
byte[] bArr2 = (byte[]) value;
|
|
|
|
entry.setValue(Arrays.copyOf(bArr2, bArr2.length));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (Map.Entry entry2 : Collections.unmodifiableMap(hashMap2).entrySet()) {
|
|
|
|
String str = (String) entry2.getKey();
|
|
|
|
Object value2 = entry2.getValue();
|
|
|
|
if (value2 instanceof Long) {
|
|
|
|
bArr = ByteBuffer.allocate(8).putLong(((Long) value2).longValue()).array();
|
|
|
|
} else if (value2 instanceof String) {
|
2021-09-07 07:54:21 +00:00
|
|
|
bArr = ((String) value2).getBytes(c.f1278c);
|
2021-08-09 22:50:52 +00:00
|
|
|
} else if (value2 instanceof byte[]) {
|
|
|
|
bArr = (byte[]) value2;
|
|
|
|
} else {
|
|
|
|
throw new IllegalArgumentException();
|
|
|
|
}
|
|
|
|
hashMap.put(str, bArr);
|
|
|
|
}
|
2021-08-31 07:21:49 +00:00
|
|
|
return b(this.f909c, hashMap) ? this : new n(hashMap);
|
2021-08-09 22:50:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public boolean equals(@Nullable Object obj) {
|
|
|
|
if (this == obj) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (obj == null || n.class != obj.getClass()) {
|
|
|
|
return false;
|
|
|
|
}
|
2021-08-31 07:21:49 +00:00
|
|
|
return b(this.f909c, ((n) obj).f909c);
|
2021-08-09 22:50:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public int hashCode() {
|
|
|
|
if (this.b == 0) {
|
|
|
|
int i = 0;
|
2021-08-31 07:21:49 +00:00
|
|
|
for (Map.Entry<String, byte[]> entry : this.f909c.entrySet()) {
|
2021-08-09 22:50:52 +00:00
|
|
|
i += Arrays.hashCode(entry.getValue()) ^ entry.getKey().hashCode();
|
|
|
|
}
|
|
|
|
this.b = i;
|
|
|
|
}
|
|
|
|
return this.b;
|
|
|
|
}
|
|
|
|
}
|