Response$Builder.smali 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476
  1. .class public Lokhttp3/Response$Builder;
  2. .super Ljava/lang/Object;
  3. .source ""
  4. # annotations
  5. .annotation system Ldalvik/annotation/EnclosingClass;
  6. value = Lokhttp3/Response;
  7. .end annotation
  8. .annotation system Ldalvik/annotation/InnerClass;
  9. accessFlags = 0x9
  10. name = "Builder"
  11. .end annotation
  12. # instance fields
  13. .field body:Lokhttp3/ResponseBody;
  14. .field cacheResponse:Lokhttp3/Response;
  15. .field code:I
  16. .field handshake:Lokhttp3/Handshake;
  17. .field headers:Lokhttp3/Headers$Builder;
  18. .field message:Ljava/lang/String;
  19. .field networkResponse:Lokhttp3/Response;
  20. .field priorResponse:Lokhttp3/Response;
  21. .field protocol:Lokhttp3/Protocol;
  22. .field receivedResponseAtMillis:J
  23. .field request:Lokhttp3/Request;
  24. .field sentRequestAtMillis:J
  25. # direct methods
  26. .method public constructor <init>()V
  27. .locals 1
  28. invoke-direct {p0}, Ljava/lang/Object;-><init>()V
  29. const/4 v0, -0x1
  30. iput v0, p0, Lokhttp3/Response$Builder;->code:I
  31. new-instance v0, Lokhttp3/Headers$Builder;
  32. invoke-direct {v0}, Lokhttp3/Headers$Builder;-><init>()V
  33. iput-object v0, p0, Lokhttp3/Response$Builder;->headers:Lokhttp3/Headers$Builder;
  34. return-void
  35. .end method
  36. .method constructor <init>(Lokhttp3/Response;)V
  37. .locals 2
  38. invoke-direct {p0}, Ljava/lang/Object;-><init>()V
  39. const/4 v0, -0x1
  40. iput v0, p0, Lokhttp3/Response$Builder;->code:I
  41. iget-object v0, p1, Lokhttp3/Response;->request:Lokhttp3/Request;
  42. iput-object v0, p0, Lokhttp3/Response$Builder;->request:Lokhttp3/Request;
  43. iget-object v0, p1, Lokhttp3/Response;->protocol:Lokhttp3/Protocol;
  44. iput-object v0, p0, Lokhttp3/Response$Builder;->protocol:Lokhttp3/Protocol;
  45. iget v0, p1, Lokhttp3/Response;->code:I
  46. iput v0, p0, Lokhttp3/Response$Builder;->code:I
  47. iget-object v0, p1, Lokhttp3/Response;->message:Ljava/lang/String;
  48. iput-object v0, p0, Lokhttp3/Response$Builder;->message:Ljava/lang/String;
  49. iget-object v0, p1, Lokhttp3/Response;->handshake:Lokhttp3/Handshake;
  50. iput-object v0, p0, Lokhttp3/Response$Builder;->handshake:Lokhttp3/Handshake;
  51. iget-object v0, p1, Lokhttp3/Response;->headers:Lokhttp3/Headers;
  52. invoke-virtual {v0}, Lokhttp3/Headers;->newBuilder()Lokhttp3/Headers$Builder;
  53. move-result-object v0
  54. iput-object v0, p0, Lokhttp3/Response$Builder;->headers:Lokhttp3/Headers$Builder;
  55. iget-object v0, p1, Lokhttp3/Response;->body:Lokhttp3/ResponseBody;
  56. iput-object v0, p0, Lokhttp3/Response$Builder;->body:Lokhttp3/ResponseBody;
  57. iget-object v0, p1, Lokhttp3/Response;->networkResponse:Lokhttp3/Response;
  58. iput-object v0, p0, Lokhttp3/Response$Builder;->networkResponse:Lokhttp3/Response;
  59. iget-object v0, p1, Lokhttp3/Response;->cacheResponse:Lokhttp3/Response;
  60. iput-object v0, p0, Lokhttp3/Response$Builder;->cacheResponse:Lokhttp3/Response;
  61. iget-object v0, p1, Lokhttp3/Response;->priorResponse:Lokhttp3/Response;
  62. iput-object v0, p0, Lokhttp3/Response$Builder;->priorResponse:Lokhttp3/Response;
  63. iget-wide v0, p1, Lokhttp3/Response;->sentRequestAtMillis:J
  64. iput-wide v0, p0, Lokhttp3/Response$Builder;->sentRequestAtMillis:J
  65. iget-wide v0, p1, Lokhttp3/Response;->receivedResponseAtMillis:J
  66. iput-wide v0, p0, Lokhttp3/Response$Builder;->receivedResponseAtMillis:J
  67. return-void
  68. .end method
  69. .method private checkPriorResponse(Lokhttp3/Response;)V
  70. .locals 1
  71. iget-object p1, p1, Lokhttp3/Response;->body:Lokhttp3/ResponseBody;
  72. if-nez p1, :cond_0
  73. return-void
  74. :cond_0
  75. new-instance p1, Ljava/lang/IllegalArgumentException;
  76. const-string v0, "priorResponse.body != null"
  77. invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  78. throw p1
  79. .end method
  80. .method private checkSupportResponse(Ljava/lang/String;Lokhttp3/Response;)V
  81. .locals 1
  82. iget-object v0, p2, Lokhttp3/Response;->body:Lokhttp3/ResponseBody;
  83. if-nez v0, :cond_3
  84. iget-object v0, p2, Lokhttp3/Response;->networkResponse:Lokhttp3/Response;
  85. if-nez v0, :cond_2
  86. iget-object v0, p2, Lokhttp3/Response;->cacheResponse:Lokhttp3/Response;
  87. if-nez v0, :cond_1
  88. iget-object p2, p2, Lokhttp3/Response;->priorResponse:Lokhttp3/Response;
  89. if-nez p2, :cond_0
  90. return-void
  91. :cond_0
  92. new-instance p2, Ljava/lang/IllegalArgumentException;
  93. new-instance v0, Ljava/lang/StringBuilder;
  94. invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
  95. invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  96. const-string p1, ".priorResponse != null"
  97. invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  98. invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  99. move-result-object p1
  100. invoke-direct {p2, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  101. throw p2
  102. :cond_1
  103. new-instance p2, Ljava/lang/IllegalArgumentException;
  104. new-instance v0, Ljava/lang/StringBuilder;
  105. invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
  106. invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  107. const-string p1, ".cacheResponse != null"
  108. invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  109. invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  110. move-result-object p1
  111. invoke-direct {p2, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  112. throw p2
  113. :cond_2
  114. new-instance p2, Ljava/lang/IllegalArgumentException;
  115. new-instance v0, Ljava/lang/StringBuilder;
  116. invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
  117. invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  118. const-string p1, ".networkResponse != null"
  119. invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  120. invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  121. move-result-object p1
  122. invoke-direct {p2, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  123. throw p2
  124. :cond_3
  125. new-instance p2, Ljava/lang/IllegalArgumentException;
  126. new-instance v0, Ljava/lang/StringBuilder;
  127. invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
  128. invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  129. const-string p1, ".body != null"
  130. invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  131. invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  132. move-result-object p1
  133. invoke-direct {p2, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  134. throw p2
  135. .end method
  136. # virtual methods
  137. .method public addHeader(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Response$Builder;
  138. .locals 1
  139. iget-object v0, p0, Lokhttp3/Response$Builder;->headers:Lokhttp3/Headers$Builder;
  140. invoke-virtual {v0, p1, p2}, Lokhttp3/Headers$Builder;->add(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Headers$Builder;
  141. return-object p0
  142. .end method
  143. .method public body(Lokhttp3/ResponseBody;)Lokhttp3/Response$Builder;
  144. .locals 0
  145. iput-object p1, p0, Lokhttp3/Response$Builder;->body:Lokhttp3/ResponseBody;
  146. return-object p0
  147. .end method
  148. .method public build()Lokhttp3/Response;
  149. .locals 3
  150. iget-object v0, p0, Lokhttp3/Response$Builder;->request:Lokhttp3/Request;
  151. if-eqz v0, :cond_3
  152. iget-object v0, p0, Lokhttp3/Response$Builder;->protocol:Lokhttp3/Protocol;
  153. if-eqz v0, :cond_2
  154. iget v0, p0, Lokhttp3/Response$Builder;->code:I
  155. if-ltz v0, :cond_1
  156. iget-object v0, p0, Lokhttp3/Response$Builder;->message:Ljava/lang/String;
  157. if-eqz v0, :cond_0
  158. new-instance v0, Lokhttp3/Response;
  159. invoke-direct {v0, p0}, Lokhttp3/Response;-><init>(Lokhttp3/Response$Builder;)V
  160. return-object v0
  161. :cond_0
  162. new-instance v0, Ljava/lang/IllegalStateException;
  163. const-string v1, "message == null"
  164. invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  165. throw v0
  166. :cond_1
  167. new-instance v0, Ljava/lang/IllegalStateException;
  168. new-instance v1, Ljava/lang/StringBuilder;
  169. invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
  170. const-string v2, "code < 0: "
  171. invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  172. iget v2, p0, Lokhttp3/Response$Builder;->code:I
  173. invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
  174. invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  175. move-result-object v1
  176. invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  177. throw v0
  178. :cond_2
  179. new-instance v0, Ljava/lang/IllegalStateException;
  180. const-string v1, "protocol == null"
  181. invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  182. throw v0
  183. :cond_3
  184. new-instance v0, Ljava/lang/IllegalStateException;
  185. const-string v1, "request == null"
  186. invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  187. throw v0
  188. .end method
  189. .method public cacheResponse(Lokhttp3/Response;)Lokhttp3/Response$Builder;
  190. .locals 1
  191. if-eqz p1, :cond_0
  192. const-string v0, "cacheResponse"
  193. invoke-direct {p0, v0, p1}, Lokhttp3/Response$Builder;->checkSupportResponse(Ljava/lang/String;Lokhttp3/Response;)V
  194. :cond_0
  195. iput-object p1, p0, Lokhttp3/Response$Builder;->cacheResponse:Lokhttp3/Response;
  196. return-object p0
  197. .end method
  198. .method public code(I)Lokhttp3/Response$Builder;
  199. .locals 0
  200. iput p1, p0, Lokhttp3/Response$Builder;->code:I
  201. return-object p0
  202. .end method
  203. .method public handshake(Lokhttp3/Handshake;)Lokhttp3/Response$Builder;
  204. .locals 0
  205. iput-object p1, p0, Lokhttp3/Response$Builder;->handshake:Lokhttp3/Handshake;
  206. return-object p0
  207. .end method
  208. .method public header(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Response$Builder;
  209. .locals 1
  210. iget-object v0, p0, Lokhttp3/Response$Builder;->headers:Lokhttp3/Headers$Builder;
  211. invoke-virtual {v0, p1, p2}, Lokhttp3/Headers$Builder;->set(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Headers$Builder;
  212. return-object p0
  213. .end method
  214. .method public headers(Lokhttp3/Headers;)Lokhttp3/Response$Builder;
  215. .locals 0
  216. invoke-virtual {p1}, Lokhttp3/Headers;->newBuilder()Lokhttp3/Headers$Builder;
  217. move-result-object p1
  218. iput-object p1, p0, Lokhttp3/Response$Builder;->headers:Lokhttp3/Headers$Builder;
  219. return-object p0
  220. .end method
  221. .method public message(Ljava/lang/String;)Lokhttp3/Response$Builder;
  222. .locals 0
  223. iput-object p1, p0, Lokhttp3/Response$Builder;->message:Ljava/lang/String;
  224. return-object p0
  225. .end method
  226. .method public networkResponse(Lokhttp3/Response;)Lokhttp3/Response$Builder;
  227. .locals 1
  228. if-eqz p1, :cond_0
  229. const-string v0, "networkResponse"
  230. invoke-direct {p0, v0, p1}, Lokhttp3/Response$Builder;->checkSupportResponse(Ljava/lang/String;Lokhttp3/Response;)V
  231. :cond_0
  232. iput-object p1, p0, Lokhttp3/Response$Builder;->networkResponse:Lokhttp3/Response;
  233. return-object p0
  234. .end method
  235. .method public priorResponse(Lokhttp3/Response;)Lokhttp3/Response$Builder;
  236. .locals 0
  237. if-eqz p1, :cond_0
  238. invoke-direct {p0, p1}, Lokhttp3/Response$Builder;->checkPriorResponse(Lokhttp3/Response;)V
  239. :cond_0
  240. iput-object p1, p0, Lokhttp3/Response$Builder;->priorResponse:Lokhttp3/Response;
  241. return-object p0
  242. .end method
  243. .method public protocol(Lokhttp3/Protocol;)Lokhttp3/Response$Builder;
  244. .locals 0
  245. iput-object p1, p0, Lokhttp3/Response$Builder;->protocol:Lokhttp3/Protocol;
  246. return-object p0
  247. .end method
  248. .method public receivedResponseAtMillis(J)Lokhttp3/Response$Builder;
  249. .locals 0
  250. iput-wide p1, p0, Lokhttp3/Response$Builder;->receivedResponseAtMillis:J
  251. return-object p0
  252. .end method
  253. .method public removeHeader(Ljava/lang/String;)Lokhttp3/Response$Builder;
  254. .locals 1
  255. iget-object v0, p0, Lokhttp3/Response$Builder;->headers:Lokhttp3/Headers$Builder;
  256. invoke-virtual {v0, p1}, Lokhttp3/Headers$Builder;->removeAll(Ljava/lang/String;)Lokhttp3/Headers$Builder;
  257. return-object p0
  258. .end method
  259. .method public request(Lokhttp3/Request;)Lokhttp3/Response$Builder;
  260. .locals 0
  261. iput-object p1, p0, Lokhttp3/Response$Builder;->request:Lokhttp3/Request;
  262. return-object p0
  263. .end method
  264. .method public sentRequestAtMillis(J)Lokhttp3/Response$Builder;
  265. .locals 0
  266. iput-wide p1, p0, Lokhttp3/Response$Builder;->sentRequestAtMillis:J
  267. return-object p0
  268. .end method