JsonObject.smali 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  1. .class public final Lcom/google/gson/JsonObject;
  2. .super Lcom/google/gson/JsonElement;
  3. .source ""
  4. # instance fields
  5. .field private final members:Lcom/google/gson/internal/LinkedTreeMap;
  6. .annotation system Ldalvik/annotation/Signature;
  7. value = {
  8. "Lcom/google/gson/internal/LinkedTreeMap<",
  9. "Ljava/lang/String;",
  10. "Lcom/google/gson/JsonElement;",
  11. ">;"
  12. }
  13. .end annotation
  14. .end field
  15. # direct methods
  16. .method public constructor <init>()V
  17. .locals 1
  18. invoke-direct {p0}, Lcom/google/gson/JsonElement;-><init>()V
  19. new-instance v0, Lcom/google/gson/internal/LinkedTreeMap;
  20. invoke-direct {v0}, Lcom/google/gson/internal/LinkedTreeMap;-><init>()V
  21. iput-object v0, p0, Lcom/google/gson/JsonObject;->members:Lcom/google/gson/internal/LinkedTreeMap;
  22. return-void
  23. .end method
  24. .method private createJsonElement(Ljava/lang/Object;)Lcom/google/gson/JsonElement;
  25. .locals 1
  26. if-nez p1, :cond_0
  27. sget-object p1, Lcom/google/gson/JsonNull;->INSTANCE:Lcom/google/gson/JsonNull;
  28. goto :goto_0
  29. :cond_0
  30. new-instance v0, Lcom/google/gson/JsonPrimitive;
  31. invoke-direct {v0, p1}, Lcom/google/gson/JsonPrimitive;-><init>(Ljava/lang/Object;)V
  32. move-object p1, v0
  33. :goto_0
  34. return-object p1
  35. .end method
  36. # virtual methods
  37. .method public add(Ljava/lang/String;Lcom/google/gson/JsonElement;)V
  38. .locals 1
  39. if-nez p2, :cond_0
  40. sget-object p2, Lcom/google/gson/JsonNull;->INSTANCE:Lcom/google/gson/JsonNull;
  41. :cond_0
  42. iget-object v0, p0, Lcom/google/gson/JsonObject;->members:Lcom/google/gson/internal/LinkedTreeMap;
  43. invoke-virtual {v0, p1, p2}, Lcom/google/gson/internal/LinkedTreeMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
  44. return-void
  45. .end method
  46. .method public addProperty(Ljava/lang/String;Ljava/lang/Boolean;)V
  47. .locals 0
  48. invoke-direct {p0, p2}, Lcom/google/gson/JsonObject;->createJsonElement(Ljava/lang/Object;)Lcom/google/gson/JsonElement;
  49. move-result-object p2
  50. invoke-virtual {p0, p1, p2}, Lcom/google/gson/JsonObject;->add(Ljava/lang/String;Lcom/google/gson/JsonElement;)V
  51. return-void
  52. .end method
  53. .method public addProperty(Ljava/lang/String;Ljava/lang/Character;)V
  54. .locals 0
  55. invoke-direct {p0, p2}, Lcom/google/gson/JsonObject;->createJsonElement(Ljava/lang/Object;)Lcom/google/gson/JsonElement;
  56. move-result-object p2
  57. invoke-virtual {p0, p1, p2}, Lcom/google/gson/JsonObject;->add(Ljava/lang/String;Lcom/google/gson/JsonElement;)V
  58. return-void
  59. .end method
  60. .method public addProperty(Ljava/lang/String;Ljava/lang/Number;)V
  61. .locals 0
  62. invoke-direct {p0, p2}, Lcom/google/gson/JsonObject;->createJsonElement(Ljava/lang/Object;)Lcom/google/gson/JsonElement;
  63. move-result-object p2
  64. invoke-virtual {p0, p1, p2}, Lcom/google/gson/JsonObject;->add(Ljava/lang/String;Lcom/google/gson/JsonElement;)V
  65. return-void
  66. .end method
  67. .method public addProperty(Ljava/lang/String;Ljava/lang/String;)V
  68. .locals 0
  69. invoke-direct {p0, p2}, Lcom/google/gson/JsonObject;->createJsonElement(Ljava/lang/Object;)Lcom/google/gson/JsonElement;
  70. move-result-object p2
  71. invoke-virtual {p0, p1, p2}, Lcom/google/gson/JsonObject;->add(Ljava/lang/String;Lcom/google/gson/JsonElement;)V
  72. return-void
  73. .end method
  74. .method bridge synthetic deepCopy()Lcom/google/gson/JsonElement;
  75. .locals 1
  76. invoke-virtual {p0}, Lcom/google/gson/JsonObject;->deepCopy()Lcom/google/gson/JsonObject;
  77. move-result-object v0
  78. return-object v0
  79. .end method
  80. .method deepCopy()Lcom/google/gson/JsonObject;
  81. .locals 4
  82. new-instance v0, Lcom/google/gson/JsonObject;
  83. invoke-direct {v0}, Lcom/google/gson/JsonObject;-><init>()V
  84. iget-object v1, p0, Lcom/google/gson/JsonObject;->members:Lcom/google/gson/internal/LinkedTreeMap;
  85. invoke-virtual {v1}, Lcom/google/gson/internal/LinkedTreeMap;->entrySet()Ljava/util/Set;
  86. move-result-object v1
  87. invoke-interface {v1}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
  88. move-result-object v1
  89. :goto_0
  90. invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
  91. move-result v2
  92. if-eqz v2, :cond_0
  93. invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
  94. move-result-object v2
  95. check-cast v2, Ljava/util/Map$Entry;
  96. invoke-interface {v2}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;
  97. move-result-object v3
  98. check-cast v3, Ljava/lang/String;
  99. invoke-interface {v2}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;
  100. move-result-object v2
  101. check-cast v2, Lcom/google/gson/JsonElement;
  102. invoke-virtual {v2}, Lcom/google/gson/JsonElement;->deepCopy()Lcom/google/gson/JsonElement;
  103. move-result-object v2
  104. invoke-virtual {v0, v3, v2}, Lcom/google/gson/JsonObject;->add(Ljava/lang/String;Lcom/google/gson/JsonElement;)V
  105. goto :goto_0
  106. :cond_0
  107. return-object v0
  108. .end method
  109. .method public entrySet()Ljava/util/Set;
  110. .locals 1
  111. .annotation system Ldalvik/annotation/Signature;
  112. value = {
  113. "()",
  114. "Ljava/util/Set<",
  115. "Ljava/util/Map$Entry<",
  116. "Ljava/lang/String;",
  117. "Lcom/google/gson/JsonElement;",
  118. ">;>;"
  119. }
  120. .end annotation
  121. iget-object v0, p0, Lcom/google/gson/JsonObject;->members:Lcom/google/gson/internal/LinkedTreeMap;
  122. invoke-virtual {v0}, Lcom/google/gson/internal/LinkedTreeMap;->entrySet()Ljava/util/Set;
  123. move-result-object v0
  124. return-object v0
  125. .end method
  126. .method public equals(Ljava/lang/Object;)Z
  127. .locals 1
  128. if-eq p1, p0, :cond_1
  129. instance-of v0, p1, Lcom/google/gson/JsonObject;
  130. if-eqz v0, :cond_0
  131. check-cast p1, Lcom/google/gson/JsonObject;
  132. iget-object p1, p1, Lcom/google/gson/JsonObject;->members:Lcom/google/gson/internal/LinkedTreeMap;
  133. iget-object v0, p0, Lcom/google/gson/JsonObject;->members:Lcom/google/gson/internal/LinkedTreeMap;
  134. invoke-virtual {p1, v0}, Ljava/util/AbstractMap;->equals(Ljava/lang/Object;)Z
  135. move-result p1
  136. if-eqz p1, :cond_0
  137. goto :goto_0
  138. :cond_0
  139. const/4 p1, 0x0
  140. goto :goto_1
  141. :cond_1
  142. :goto_0
  143. const/4 p1, 0x1
  144. :goto_1
  145. return p1
  146. .end method
  147. .method public get(Ljava/lang/String;)Lcom/google/gson/JsonElement;
  148. .locals 1
  149. iget-object v0, p0, Lcom/google/gson/JsonObject;->members:Lcom/google/gson/internal/LinkedTreeMap;
  150. invoke-virtual {v0, p1}, Lcom/google/gson/internal/LinkedTreeMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
  151. move-result-object p1
  152. check-cast p1, Lcom/google/gson/JsonElement;
  153. return-object p1
  154. .end method
  155. .method public getAsJsonArray(Ljava/lang/String;)Lcom/google/gson/JsonArray;
  156. .locals 1
  157. iget-object v0, p0, Lcom/google/gson/JsonObject;->members:Lcom/google/gson/internal/LinkedTreeMap;
  158. invoke-virtual {v0, p1}, Lcom/google/gson/internal/LinkedTreeMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
  159. move-result-object p1
  160. check-cast p1, Lcom/google/gson/JsonArray;
  161. return-object p1
  162. .end method
  163. .method public getAsJsonObject(Ljava/lang/String;)Lcom/google/gson/JsonObject;
  164. .locals 1
  165. iget-object v0, p0, Lcom/google/gson/JsonObject;->members:Lcom/google/gson/internal/LinkedTreeMap;
  166. invoke-virtual {v0, p1}, Lcom/google/gson/internal/LinkedTreeMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
  167. move-result-object p1
  168. check-cast p1, Lcom/google/gson/JsonObject;
  169. return-object p1
  170. .end method
  171. .method public getAsJsonPrimitive(Ljava/lang/String;)Lcom/google/gson/JsonPrimitive;
  172. .locals 1
  173. iget-object v0, p0, Lcom/google/gson/JsonObject;->members:Lcom/google/gson/internal/LinkedTreeMap;
  174. invoke-virtual {v0, p1}, Lcom/google/gson/internal/LinkedTreeMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
  175. move-result-object p1
  176. check-cast p1, Lcom/google/gson/JsonPrimitive;
  177. return-object p1
  178. .end method
  179. .method public has(Ljava/lang/String;)Z
  180. .locals 1
  181. iget-object v0, p0, Lcom/google/gson/JsonObject;->members:Lcom/google/gson/internal/LinkedTreeMap;
  182. invoke-virtual {v0, p1}, Lcom/google/gson/internal/LinkedTreeMap;->containsKey(Ljava/lang/Object;)Z
  183. move-result p1
  184. return p1
  185. .end method
  186. .method public hashCode()I
  187. .locals 1
  188. iget-object v0, p0, Lcom/google/gson/JsonObject;->members:Lcom/google/gson/internal/LinkedTreeMap;
  189. invoke-virtual {v0}, Ljava/util/AbstractMap;->hashCode()I
  190. move-result v0
  191. return v0
  192. .end method
  193. .method public keySet()Ljava/util/Set;
  194. .locals 1
  195. .annotation system Ldalvik/annotation/Signature;
  196. value = {
  197. "()",
  198. "Ljava/util/Set<",
  199. "Ljava/lang/String;",
  200. ">;"
  201. }
  202. .end annotation
  203. iget-object v0, p0, Lcom/google/gson/JsonObject;->members:Lcom/google/gson/internal/LinkedTreeMap;
  204. invoke-virtual {v0}, Lcom/google/gson/internal/LinkedTreeMap;->keySet()Ljava/util/Set;
  205. move-result-object v0
  206. return-object v0
  207. .end method
  208. .method public remove(Ljava/lang/String;)Lcom/google/gson/JsonElement;
  209. .locals 1
  210. iget-object v0, p0, Lcom/google/gson/JsonObject;->members:Lcom/google/gson/internal/LinkedTreeMap;
  211. invoke-virtual {v0, p1}, Lcom/google/gson/internal/LinkedTreeMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;
  212. move-result-object p1
  213. check-cast p1, Lcom/google/gson/JsonElement;
  214. return-object p1
  215. .end method
  216. .method public size()I
  217. .locals 1
  218. iget-object v0, p0, Lcom/google/gson/JsonObject;->members:Lcom/google/gson/internal/LinkedTreeMap;
  219. invoke-virtual {v0}, Lcom/google/gson/internal/LinkedTreeMap;->size()I
  220. move-result v0
  221. return v0
  222. .end method