.class public final Lcom/google/common/base/Enums; .super Ljava/lang/Object; .source "Enums.java" # annotations .annotation build Lcom/google/common/annotations/Beta; .end annotation .annotation build Lcom/google/common/annotations/GwtCompatible; emulated = true .end annotation .annotation system Ldalvik/annotation/MemberClasses; value = { Lcom/google/common/base/Enums$1;, Lcom/google/common/base/Enums$StringConverter;, Lcom/google/common/base/Enums$ValueOfFunction; } .end annotation # static fields .field private static final enumConstantCache:Ljava/util/Map; .annotation build Lcom/google/common/annotations/GwtIncompatible; value = "java.lang.ref.WeakReference" .end annotation .annotation system Ldalvik/annotation/Signature; value = { "Ljava/util/Map", "<", "Ljava/lang/Class", "<+", "Ljava/lang/Enum", "<*>;>;", "Ljava/util/Map", "<", "Ljava/lang/String;", "Ljava/lang/ref/WeakReference", "<+", "Ljava/lang/Enum", "<*>;>;>;>;" } .end annotation .end field # direct methods .method static constructor ()V .locals 1 .prologue .line 137 new-instance v0, Ljava/util/WeakHashMap; invoke-direct {v0}, Ljava/util/WeakHashMap;->()V sput-object v0, Lcom/google/common/base/Enums;->enumConstantCache:Ljava/util/Map; return-void .end method .method private constructor ()V .locals 0 .prologue .line 46 invoke-direct {p0}, Ljava/lang/Object;->()V return-void .end method .method static getEnumConstants(Ljava/lang/Class;)Ljava/util/Map; .locals 2 .annotation build Lcom/google/common/annotations/GwtIncompatible; value = "java.lang.ref.WeakReference" .end annotation .annotation system Ldalvik/annotation/Signature; value = { ";>(", "Ljava/lang/Class", ";)", "Ljava/util/Map", "<", "Ljava/lang/String;", "Ljava/lang/ref/WeakReference", "<+", "Ljava/lang/Enum", "<*>;>;>;" } .end annotation .prologue .line 155 sget-object v1, Lcom/google/common/base/Enums;->enumConstantCache:Ljava/util/Map; monitor-enter v1 .line 156 :try_start_0 sget-object v0, Lcom/google/common/base/Enums;->enumConstantCache: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/util/Map; .line 158 if-nez v0, :cond_0 .line 159 invoke-static {p0}, Lcom/google/common/base/Enums;->populateCache(Ljava/lang/Class;)Ljava/util/Map; move-result-object v0 .line 161 :cond_0 monitor-exit v1 return-object v0 .line 162 :catchall_0 move-exception v0 monitor-exit v1 :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 throw v0 .end method .method public static getField(Ljava/lang/Enum;)Ljava/lang/reflect/Field; .locals 2 .annotation build Lcom/google/common/annotations/GwtIncompatible; value = "reflection" .end annotation .annotation system Ldalvik/annotation/Signature; value = { "(", "Ljava/lang/Enum", "<*>;)", "Ljava/lang/reflect/Field;" } .end annotation .prologue .line 57 invoke-virtual {p0}, Ljava/lang/Enum;->getDeclaringClass()Ljava/lang/Class; move-result-object v0 .line 59 :try_start_0 invoke-virtual {p0}, Ljava/lang/Enum;->name()Ljava/lang/String; move-result-object v1 invoke-virtual {v0, v1}, Ljava/lang/Class;->getDeclaredField(Ljava/lang/String;)Ljava/lang/reflect/Field; :try_end_0 .catch Ljava/lang/NoSuchFieldException; {:try_start_0 .. :try_end_0} :catch_0 move-result-object v0 return-object v0 .line 60 :catch_0 move-exception v0 .line 61 new-instance v1, Ljava/lang/AssertionError; invoke-direct {v1, v0}, Ljava/lang/AssertionError;->(Ljava/lang/Object;)V throw v1 .end method .method public static getIfPresent(Ljava/lang/Class;Ljava/lang/String;)Lcom/google/common/base/Optional; .locals 1 .annotation system Ldalvik/annotation/Signature; value = { ";>(", "Ljava/lang/Class", ";", "Ljava/lang/String;", ")", "Lcom/google/common/base/Optional", ";" } .end annotation .prologue .line 130 invoke-static {p0}, Lcom/google/common/base/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object; .line 131 invoke-static {p1}, Lcom/google/common/base/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object; .line 132 invoke-static {p0, p1}, Lcom/google/common/base/Platform;->getEnumIfPresent(Ljava/lang/Class;Ljava/lang/String;)Lcom/google/common/base/Optional; move-result-object v0 return-object v0 .end method .method private static populateCache(Ljava/lang/Class;)Ljava/util/Map; .locals 5 .annotation build Lcom/google/common/annotations/GwtIncompatible; value = "java.lang.ref.WeakReference" .end annotation .annotation system Ldalvik/annotation/Signature; value = { ";>(", "Ljava/lang/Class", ";)", "Ljava/util/Map", "<", "Ljava/lang/String;", "Ljava/lang/ref/WeakReference", "<+", "Ljava/lang/Enum", "<*>;>;>;" } .end annotation .prologue .line 143 new-instance v1, Ljava/util/HashMap; invoke-direct {v1}, Ljava/util/HashMap;->()V .line 145 invoke-static {p0}, Ljava/util/EnumSet;->allOf(Ljava/lang/Class;)Ljava/util/EnumSet; move-result-object v0 invoke-virtual {v0}, Ljava/util/EnumSet;->iterator()Ljava/util/Iterator; move-result-object v2 :goto_0 invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z move-result v0 if-eqz v0, :cond_0 invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object; move-result-object v0 check-cast v0, Ljava/lang/Enum; .line 146 invoke-virtual {v0}, Ljava/lang/Enum;->name()Ljava/lang/String; move-result-object v3 new-instance v4, Ljava/lang/ref/WeakReference; invoke-direct {v4, v0}, Ljava/lang/ref/WeakReference;->(Ljava/lang/Object;)V invoke-interface {v1, v3, v4}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; goto :goto_0 .line 148 :cond_0 sget-object v0, Lcom/google/common/base/Enums;->enumConstantCache:Ljava/util/Map; invoke-interface {v0, p0, v1}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; .line 149 return-object v1 .end method .method public static stringConverter(Ljava/lang/Class;)Lcom/google/common/base/Converter; .locals 1 .annotation system Ldalvik/annotation/Signature; value = { ";>(", "Ljava/lang/Class", ";)", "Lcom/google/common/base/Converter", "<", "Ljava/lang/String;", "TT;>;" } .end annotation .prologue .line 174 new-instance v0, Lcom/google/common/base/Enums$StringConverter; invoke-direct {v0, p0}, Lcom/google/common/base/Enums$StringConverter;->(Ljava/lang/Class;)V return-object v0 .end method .method public static valueOfFunction(Ljava/lang/Class;)Lcom/google/common/base/Function; .locals 2 .annotation system Ldalvik/annotation/Signature; value = { ";>(", "Ljava/lang/Class", ";)", "Lcom/google/common/base/Function", "<", "Ljava/lang/String;", "TT;>;" } .end annotation .annotation runtime Ljava/lang/Deprecated; .end annotation .prologue .line 80 new-instance v0, Lcom/google/common/base/Enums$ValueOfFunction; const/4 v1, 0x0 invoke-direct {v0, p0, v1}, Lcom/google/common/base/Enums$ValueOfFunction;->(Ljava/lang/Class;Lcom/google/common/base/Enums$1;)V return-object v0 .end method