alexandroid/decompiled/jadx/sources/com/google/protobuf/ExtensionRegistryLite.java
KaKi87 a47fad5135 📦 Add decompiled Alexa 2.2.730155.0 (jadx, apktool, Hermes strings)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 00:04:16 +01:00

101 lines
3.9 KiB
Java

package com.google.protobuf;
import com.amazon.clouddrive.extended.model.BulkOperationType;
import com.google.protobuf.GeneratedMessageLite;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
/* loaded from: classes8.dex */
public class ExtensionRegistryLite {
static final String EXTENSION_CLASS_NAME = "com.google.protobuf.Extension";
private static volatile boolean eagerlyParseMessageSets = false;
private final Map<ObjectIntPair, GeneratedMessageLite.GeneratedExtension<?, ?>> extensionsByNumber;
private static final Class<?> extensionClass = resolveExtensionClass();
static final ExtensionRegistryLite EMPTY_REGISTRY_LITE = new ExtensionRegistryLite(true);
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
public static final class ObjectIntPair {
private final int number;
private final Object object;
public ObjectIntPair(Object obj, int i) {
this.object = obj;
this.number = i;
}
public boolean equals(Object obj) {
if (!(obj instanceof ObjectIntPair)) {
return false;
}
ObjectIntPair objectIntPair = (ObjectIntPair) obj;
return this.object == objectIntPair.object && this.number == objectIntPair.number;
}
public int hashCode() {
return (System.identityHashCode(this.object) * 65535) + this.number;
}
}
public ExtensionRegistryLite(ExtensionRegistryLite extensionRegistryLite) {
if (extensionRegistryLite == EMPTY_REGISTRY_LITE) {
this.extensionsByNumber = Collections.EMPTY_MAP;
} else {
this.extensionsByNumber = Collections.unmodifiableMap(extensionRegistryLite.extensionsByNumber);
}
}
public static ExtensionRegistryLite getEmptyRegistry() {
return ExtensionRegistryFactory.createEmpty();
}
public static boolean isEagerlyParseMessageSets() {
return eagerlyParseMessageSets;
}
public static ExtensionRegistryLite newInstance() {
return ExtensionRegistryFactory.create();
}
public static Class<?> resolveExtensionClass() {
return Extension.class;
}
public static void setEagerlyParseMessageSets(boolean z) {
eagerlyParseMessageSets = z;
}
public final void add(ExtensionLite<?, ?> extensionLite) {
if (GeneratedMessageLite.GeneratedExtension.class.isAssignableFrom(extensionLite.getClass())) {
add((GeneratedMessageLite.GeneratedExtension<?, ?>) extensionLite);
}
if (ExtensionRegistryFactory.isFullRegistry(this)) {
try {
getClass().getMethod(BulkOperationType.add, extensionClass).invoke(this, extensionLite);
} catch (Exception e) {
throw new IllegalArgumentException(String.format("Could not invoke ExtensionRegistry#add for %s", extensionLite), e);
}
}
}
public <ContainingType extends MessageLite> GeneratedMessageLite.GeneratedExtension<ContainingType, ?> findLiteExtensionByNumber(ContainingType containingtype, int i) {
return (GeneratedMessageLite.GeneratedExtension) this.extensionsByNumber.get(new ObjectIntPair(containingtype, i));
}
public ExtensionRegistryLite getUnmodifiable() {
return new ExtensionRegistryLite(this);
}
public ExtensionRegistryLite() {
this.extensionsByNumber = new HashMap();
}
public ExtensionRegistryLite(boolean z) {
this.extensionsByNumber = Collections.EMPTY_MAP;
}
public final void add(GeneratedMessageLite.GeneratedExtension<?, ?> generatedExtension) {
this.extensionsByNumber.put(new ObjectIntPair(generatedExtension.getContainingTypeDefaultInstance(), generatedExtension.getNumber()), generatedExtension);
}
}