discord-jadx/app/src/main/java/ra/c0.java

392 lines
12 KiB
Java

package ra;
import com.facebook.react.uimanager.ViewDefaults;
import java.util.AbstractCollection;
import java.util.AbstractMap;
import java.util.Collection;
import java.util.HashSet;
import java.util.IdentityHashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import qa.g;
import qa.h;
import ra.r0;
/* compiled from: Maps.java */
/* loaded from: classes4.dex */
public final class c0 {
/* compiled from: Maps.java */
/* loaded from: classes4.dex */
static class a extends t0<Map.Entry<K, V>, V> {
a(Iterator it) {
super(it);
}
/* JADX INFO: Access modifiers changed from: package-private */
/* renamed from: c */
public V b(Map.Entry<K, V> entry) {
return entry.getValue();
}
}
/* JADX WARN: Failed to restore enum class, 'enum' modifier removed */
/* compiled from: Maps.java */
/* loaded from: classes4.dex */
private static abstract class b extends Enum<b> implements qa.f<Map.Entry<?, ?>, Object> {
/* renamed from: j reason: collision with root package name */
public static final b f21647j;
/* renamed from: k reason: collision with root package name */
public static final b f21648k;
/* renamed from: l reason: collision with root package name */
private static final /* synthetic */ b[] f21649l;
/* JADX WARN: Failed to restore enum class, 'enum' modifier removed */
/* compiled from: Maps.java */
/* loaded from: classes4.dex */
static class a extends b {
a(String str, int i10) {
super(str, i10, null);
}
/* renamed from: a */
public Object apply(Map.Entry<?, ?> entry) {
return entry.getKey();
}
}
/* JADX WARN: Failed to restore enum class, 'enum' modifier removed */
/* compiled from: Maps.java */
/* renamed from: ra.c0$b$b reason: collision with other inner class name */
/* loaded from: classes4.dex */
static class C0376b extends b {
C0376b(String str, int i10) {
super(str, i10, null);
}
/* renamed from: a */
public Object apply(Map.Entry<?, ?> entry) {
return entry.getValue();
}
}
static {
a aVar = new a("KEY", 0);
f21647j = aVar;
C0376b bVar = new C0376b("VALUE", 1);
f21648k = bVar;
f21649l = new b[]{aVar, bVar};
}
private b(String str, int i10) {
}
/* synthetic */ b(String str, int i10, b0 b0Var) {
this(str, i10);
}
public static b valueOf(String str) {
return (b) Enum.valueOf(b.class, str);
}
public static b[] values() {
return (b[]) f21649l.clone();
}
}
/* compiled from: Maps.java */
/* loaded from: classes4.dex */
static abstract class c<K, V> extends r0.b<Map.Entry<K, V>> {
c() {
}
abstract Map<K, V> a();
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public void clear() {
a().clear();
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public abstract boolean contains(Object obj);
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public boolean isEmpty() {
return a().isEmpty();
}
@Override // ra.r0.b, java.util.AbstractSet, java.util.AbstractCollection, java.util.Collection, java.util.Set
public boolean removeAll(Collection<?> collection) {
try {
return super.removeAll((Collection) h.j(collection));
} catch (UnsupportedOperationException unused) {
return r0.h(this, collection.iterator());
}
}
@Override // ra.r0.b, java.util.AbstractCollection, java.util.Collection, java.util.Set
public boolean retainAll(Collection<?> collection) {
try {
return super.retainAll((Collection) h.j(collection));
} catch (UnsupportedOperationException unused) {
HashSet e10 = r0.e(collection.size());
for (Object obj : collection) {
if (contains(obj)) {
e10.add(((Map.Entry) obj).getKey());
}
}
return a().keySet().retainAll(e10);
}
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public int size() {
return a().size();
}
}
/* compiled from: Maps.java */
/* loaded from: classes4.dex */
static class d<K, V> extends r0.b<K> {
/* renamed from: j reason: collision with root package name */
final Map<K, V> f21650j;
d(Map<K, V> map) {
this.f21650j = (Map) h.j(map);
}
Map<K, V> a() {
return this.f21650j;
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public boolean contains(Object obj) {
return a().containsKey(obj);
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public boolean isEmpty() {
return a().isEmpty();
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public int size() {
return a().size();
}
}
/* compiled from: Maps.java */
/* loaded from: classes4.dex */
static class e<K, V> extends AbstractCollection<V> {
/* renamed from: j reason: collision with root package name */
final Map<K, V> f21651j;
e(Map<K, V> map) {
this.f21651j = (Map) h.j(map);
}
final Map<K, V> a() {
return this.f21651j;
}
@Override // java.util.AbstractCollection, java.util.Collection
public void clear() {
a().clear();
}
@Override // java.util.AbstractCollection, java.util.Collection
public boolean contains(Object obj) {
return a().containsValue(obj);
}
@Override // java.util.AbstractCollection, java.util.Collection
public boolean isEmpty() {
return a().isEmpty();
}
@Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable
public Iterator<V> iterator() {
return c0.k(a().entrySet().iterator());
}
@Override // java.util.AbstractCollection, java.util.Collection
public boolean remove(Object obj) {
try {
return super.remove(obj);
} catch (UnsupportedOperationException unused) {
for (Map.Entry<K, V> entry : a().entrySet()) {
if (g.a(obj, entry.getValue())) {
a().remove(entry.getKey());
return true;
}
}
return false;
}
}
@Override // java.util.AbstractCollection, java.util.Collection
public boolean removeAll(Collection<?> collection) {
try {
return super.removeAll((Collection) h.j(collection));
} catch (UnsupportedOperationException unused) {
HashSet d10 = r0.d();
for (Map.Entry<K, V> entry : a().entrySet()) {
if (collection.contains(entry.getValue())) {
d10.add(entry.getKey());
}
}
return a().keySet().removeAll(d10);
}
}
@Override // java.util.AbstractCollection, java.util.Collection
public boolean retainAll(Collection<?> collection) {
try {
return super.retainAll((Collection) h.j(collection));
} catch (UnsupportedOperationException unused) {
HashSet d10 = r0.d();
for (Map.Entry<K, V> entry : a().entrySet()) {
if (collection.contains(entry.getValue())) {
d10.add(entry.getKey());
}
}
return a().keySet().retainAll(d10);
}
}
@Override // java.util.AbstractCollection, java.util.Collection
public int size() {
return a().size();
}
}
/* compiled from: Maps.java */
/* loaded from: classes4.dex */
static abstract class f<K, V> extends AbstractMap<K, V> {
/* renamed from: j reason: collision with root package name */
private transient Set<Map.Entry<K, V>> f21652j;
/* renamed from: k reason: collision with root package name */
private transient Collection<V> f21653k;
f() {
}
abstract Set<Map.Entry<K, V>> a();
Collection<V> b() {
return new e(this);
}
@Override // java.util.AbstractMap, java.util.Map
public Set<Map.Entry<K, V>> entrySet() {
Set<Map.Entry<K, V>> set = this.f21652j;
if (set != null) {
return set;
}
Set<Map.Entry<K, V>> a10 = a();
this.f21652j = a10;
return a10;
}
@Override // java.util.AbstractMap, java.util.Map
public Collection<V> values() {
Collection<V> collection = this.f21653k;
if (collection != null) {
return collection;
}
Collection<V> b10 = b();
this.f21653k = b10;
return b10;
}
}
static int a(int i10) {
if (i10 >= 3) {
return i10 < 1073741824 ? (int) ((i10 / 0.75f) + 1.0f) : ViewDefaults.NUMBER_OF_LINES;
}
i.b(i10, "expectedSize");
return i10 + 1;
}
static boolean b(Map<?, ?> map, Object obj) {
if (map == obj) {
return true;
}
if (obj instanceof Map) {
return map.entrySet().equals(((Map) obj).entrySet());
}
return false;
}
public static <K, V> Map.Entry<K, V> c(K k2, V v10) {
return new r(k2, v10);
}
static <K> qa.f<Map.Entry<K, ?>, K> d() {
return b.f21647j;
}
public static <K, V> IdentityHashMap<K, V> e() {
return new IdentityHashMap<>();
}
static boolean f(Map<?, ?> map, Object obj) {
h.j(map);
try {
return map.containsKey(obj);
} catch (ClassCastException | NullPointerException unused) {
return false;
}
}
static <V> V g(Map<?, V> map, Object obj) {
h.j(map);
try {
return map.get(obj);
} catch (ClassCastException | NullPointerException unused) {
return null;
}
}
static <V> V h(Map<?, V> map, Object obj) {
h.j(map);
try {
return map.remove(obj);
} catch (ClassCastException | NullPointerException unused) {
return null;
}
}
static String i(Map<?, ?> map) {
StringBuilder a10 = j.a(map.size());
a10.append('{');
boolean z10 = true;
for (Map.Entry<?, ?> entry : map.entrySet()) {
if (!z10) {
a10.append(", ");
}
z10 = false;
a10.append(entry.getKey());
a10.append('=');
a10.append(entry.getValue());
}
a10.append('}');
return a10.toString();
}
static <V> qa.f<Map.Entry<?, V>, V> j() {
return b.f21648k;
}
static <K, V> Iterator<V> k(Iterator<Map.Entry<K, V>> it) {
return new a(it);
}
}