2022-06-10 21:38:30 +09:00

315 lines
8.5 KiB
Smali

.class public final Lcom/google/common/primitives/Primitives;
.super Ljava/lang/Object;
.source "Primitives.java"
# annotations
.annotation build Lcom/google/common/annotations/GwtIncompatible;
.end annotation
.annotation runtime Lcom/google/common/primitives/ElementTypesAreNonnullByDefault;
.end annotation
# static fields
.field private static final PRIMITIVE_TO_WRAPPER_TYPE:Ljava/util/Map;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/Map<",
"Ljava/lang/Class<",
"*>;",
"Ljava/lang/Class<",
"*>;>;"
}
.end annotation
.end field
.field private static final WRAPPER_TO_PRIMITIVE_TYPE:Ljava/util/Map;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/Map<",
"Ljava/lang/Class<",
"*>;",
"Ljava/lang/Class<",
"*>;>;"
}
.end annotation
.end field
# direct methods
.method public static constructor <clinit>()V
.locals 4
.line 1
new-instance v0, Ljava/util/LinkedHashMap;
const/16 v1, 0x10
invoke-direct {v0, v1}, Ljava/util/LinkedHashMap;-><init>(I)V
.line 2
new-instance v2, Ljava/util/LinkedHashMap;
invoke-direct {v2, v1}, Ljava/util/LinkedHashMap;-><init>(I)V
.line 3
sget-object v1, Ljava/lang/Boolean;->TYPE:Ljava/lang/Class;
const-class v3, Ljava/lang/Boolean;
invoke-static {v0, v2, v1, v3}, Lcom/google/common/primitives/Primitives;->add(Ljava/util/Map;Ljava/util/Map;Ljava/lang/Class;Ljava/lang/Class;)V
.line 4
sget-object v1, Ljava/lang/Byte;->TYPE:Ljava/lang/Class;
const-class v3, Ljava/lang/Byte;
invoke-static {v0, v2, v1, v3}, Lcom/google/common/primitives/Primitives;->add(Ljava/util/Map;Ljava/util/Map;Ljava/lang/Class;Ljava/lang/Class;)V
.line 5
sget-object v1, Ljava/lang/Character;->TYPE:Ljava/lang/Class;
const-class v3, Ljava/lang/Character;
invoke-static {v0, v2, v1, v3}, Lcom/google/common/primitives/Primitives;->add(Ljava/util/Map;Ljava/util/Map;Ljava/lang/Class;Ljava/lang/Class;)V
.line 6
sget-object v1, Ljava/lang/Double;->TYPE:Ljava/lang/Class;
const-class v3, Ljava/lang/Double;
invoke-static {v0, v2, v1, v3}, Lcom/google/common/primitives/Primitives;->add(Ljava/util/Map;Ljava/util/Map;Ljava/lang/Class;Ljava/lang/Class;)V
.line 7
sget-object v1, Ljava/lang/Float;->TYPE:Ljava/lang/Class;
const-class v3, Ljava/lang/Float;
invoke-static {v0, v2, v1, v3}, Lcom/google/common/primitives/Primitives;->add(Ljava/util/Map;Ljava/util/Map;Ljava/lang/Class;Ljava/lang/Class;)V
.line 8
sget-object v1, Ljava/lang/Integer;->TYPE:Ljava/lang/Class;
const-class v3, Ljava/lang/Integer;
invoke-static {v0, v2, v1, v3}, Lcom/google/common/primitives/Primitives;->add(Ljava/util/Map;Ljava/util/Map;Ljava/lang/Class;Ljava/lang/Class;)V
.line 9
sget-object v1, Ljava/lang/Long;->TYPE:Ljava/lang/Class;
const-class v3, Ljava/lang/Long;
invoke-static {v0, v2, v1, v3}, Lcom/google/common/primitives/Primitives;->add(Ljava/util/Map;Ljava/util/Map;Ljava/lang/Class;Ljava/lang/Class;)V
.line 10
sget-object v1, Ljava/lang/Short;->TYPE:Ljava/lang/Class;
const-class v3, Ljava/lang/Short;
invoke-static {v0, v2, v1, v3}, Lcom/google/common/primitives/Primitives;->add(Ljava/util/Map;Ljava/util/Map;Ljava/lang/Class;Ljava/lang/Class;)V
.line 11
sget-object v1, Ljava/lang/Void;->TYPE:Ljava/lang/Class;
const-class v3, Ljava/lang/Void;
invoke-static {v0, v2, v1, v3}, Lcom/google/common/primitives/Primitives;->add(Ljava/util/Map;Ljava/util/Map;Ljava/lang/Class;Ljava/lang/Class;)V
.line 12
invoke-static {v0}, Ljava/util/Collections;->unmodifiableMap(Ljava/util/Map;)Ljava/util/Map;
move-result-object v0
sput-object v0, Lcom/google/common/primitives/Primitives;->PRIMITIVE_TO_WRAPPER_TYPE:Ljava/util/Map;
.line 13
invoke-static {v2}, Ljava/util/Collections;->unmodifiableMap(Ljava/util/Map;)Ljava/util/Map;
move-result-object v0
sput-object v0, Lcom/google/common/primitives/Primitives;->WRAPPER_TO_PRIMITIVE_TYPE:Ljava/util/Map;
return-void
.end method
.method private constructor <init>()V
.locals 0
.line 1
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method private static add(Ljava/util/Map;Ljava/util/Map;Ljava/lang/Class;Ljava/lang/Class;)V
.locals 0
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/Map<",
"Ljava/lang/Class<",
"*>;",
"Ljava/lang/Class<",
"*>;>;",
"Ljava/util/Map<",
"Ljava/lang/Class<",
"*>;",
"Ljava/lang/Class<",
"*>;>;",
"Ljava/lang/Class<",
"*>;",
"Ljava/lang/Class<",
"*>;)V"
}
.end annotation
.line 1
invoke-interface {p0, p2, p3}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 2
invoke-interface {p1, p3, p2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
return-void
.end method
.method public static allPrimitiveTypes()Ljava/util/Set;
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"()",
"Ljava/util/Set<",
"Ljava/lang/Class<",
"*>;>;"
}
.end annotation
.line 1
sget-object v0, Lcom/google/common/primitives/Primitives;->PRIMITIVE_TO_WRAPPER_TYPE:Ljava/util/Map;
invoke-interface {v0}, Ljava/util/Map;->keySet()Ljava/util/Set;
move-result-object v0
return-object v0
.end method
.method public static allWrapperTypes()Ljava/util/Set;
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"()",
"Ljava/util/Set<",
"Ljava/lang/Class<",
"*>;>;"
}
.end annotation
.line 1
sget-object v0, Lcom/google/common/primitives/Primitives;->WRAPPER_TO_PRIMITIVE_TYPE:Ljava/util/Map;
invoke-interface {v0}, Ljava/util/Map;->keySet()Ljava/util/Set;
move-result-object v0
return-object v0
.end method
.method public static isWrapperType(Ljava/lang/Class;)Z
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/lang/Class<",
"*>;)Z"
}
.end annotation
.line 1
sget-object v0, Lcom/google/common/primitives/Primitives;->WRAPPER_TO_PRIMITIVE_TYPE:Ljava/util/Map;
invoke-static {p0}, Lcom/google/common/base/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object p0
invoke-interface {v0, p0}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z
move-result p0
return p0
.end method
.method public static unwrap(Ljava/lang/Class;)Ljava/lang/Class;
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"<T:",
"Ljava/lang/Object;",
">(",
"Ljava/lang/Class<",
"TT;>;)",
"Ljava/lang/Class<",
"TT;>;"
}
.end annotation
.line 1
invoke-static {p0}, Lcom/google/common/base/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
.line 2
sget-object v0, Lcom/google/common/primitives/Primitives;->WRAPPER_TO_PRIMITIVE_TYPE:Ljava/util/Map;
invoke-interface {v0, p0}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/lang/Class;
if-nez v0, :cond_0
goto :goto_0
:cond_0
move-object p0, v0
:goto_0
return-object p0
.end method
.method public static wrap(Ljava/lang/Class;)Ljava/lang/Class;
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"<T:",
"Ljava/lang/Object;",
">(",
"Ljava/lang/Class<",
"TT;>;)",
"Ljava/lang/Class<",
"TT;>;"
}
.end annotation
.line 1
invoke-static {p0}, Lcom/google/common/base/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
.line 2
sget-object v0, Lcom/google/common/primitives/Primitives;->PRIMITIVE_TO_WRAPPER_TYPE:Ljava/util/Map;
invoke-interface {v0, p0}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/lang/Class;
if-nez v0, :cond_0
goto :goto_0
:cond_0
move-object p0, v0
:goto_0
return-object p0
.end method