MockResponse.smali 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715
  1. .class public final Lokhttp3/mockwebserver/MockResponse;
  2. .super Ljava/lang/Object;
  3. .source ""
  4. # interfaces
  5. .implements Ljava/lang/Cloneable;
  6. # static fields
  7. .field private static final CHUNKED_BODY_HEADER:Ljava/lang/String; = "Transfer-encoding: chunked"
  8. # instance fields
  9. .field private body:Lokio/Buffer;
  10. .field private bodyDelayAmount:J
  11. .field private bodyDelayUnit:Ljava/util/concurrent/TimeUnit;
  12. .field private headers:Lokhttp3/Headers$Builder;
  13. .field private headersDelayAmount:J
  14. .field private headersDelayUnit:Ljava/util/concurrent/TimeUnit;
  15. .field private http2ErrorCode:I
  16. .field private promises:Ljava/util/List;
  17. .annotation system Ldalvik/annotation/Signature;
  18. value = {
  19. "Ljava/util/List<",
  20. "Lokhttp3/mockwebserver/PushPromise;",
  21. ">;"
  22. }
  23. .end annotation
  24. .end field
  25. .field private settings:Lokhttp3/internal/http2/Settings;
  26. .field private socketPolicy:Lokhttp3/mockwebserver/SocketPolicy;
  27. .field private status:Ljava/lang/String;
  28. .field private throttleBytesPerPeriod:J
  29. .field private throttlePeriodAmount:J
  30. .field private throttlePeriodUnit:Ljava/util/concurrent/TimeUnit;
  31. .field private webSocketListener:Lokhttp3/WebSocketListener;
  32. # direct methods
  33. .method public constructor <init>()V
  34. .locals 3
  35. invoke-direct {p0}, Ljava/lang/Object;-><init>()V
  36. new-instance v0, Lokhttp3/Headers$Builder;
  37. invoke-direct {v0}, Lokhttp3/Headers$Builder;-><init>()V
  38. iput-object v0, p0, Lokhttp3/mockwebserver/MockResponse;->headers:Lokhttp3/Headers$Builder;
  39. const-wide v0, 0x7fffffffffffffffL
  40. iput-wide v0, p0, Lokhttp3/mockwebserver/MockResponse;->throttleBytesPerPeriod:J
  41. const-wide/16 v0, 0x1
  42. iput-wide v0, p0, Lokhttp3/mockwebserver/MockResponse;->throttlePeriodAmount:J
  43. sget-object v0, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;
  44. iput-object v0, p0, Lokhttp3/mockwebserver/MockResponse;->throttlePeriodUnit:Ljava/util/concurrent/TimeUnit;
  45. sget-object v0, Lokhttp3/mockwebserver/SocketPolicy;->KEEP_OPEN:Lokhttp3/mockwebserver/SocketPolicy;
  46. iput-object v0, p0, Lokhttp3/mockwebserver/MockResponse;->socketPolicy:Lokhttp3/mockwebserver/SocketPolicy;
  47. const/4 v0, -0x1
  48. iput v0, p0, Lokhttp3/mockwebserver/MockResponse;->http2ErrorCode:I
  49. const-wide/16 v0, 0x0
  50. iput-wide v0, p0, Lokhttp3/mockwebserver/MockResponse;->bodyDelayAmount:J
  51. sget-object v2, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;
  52. iput-object v2, p0, Lokhttp3/mockwebserver/MockResponse;->bodyDelayUnit:Ljava/util/concurrent/TimeUnit;
  53. iput-wide v0, p0, Lokhttp3/mockwebserver/MockResponse;->headersDelayAmount:J
  54. iput-object v2, p0, Lokhttp3/mockwebserver/MockResponse;->headersDelayUnit:Ljava/util/concurrent/TimeUnit;
  55. new-instance v0, Ljava/util/ArrayList;
  56. invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
  57. iput-object v0, p0, Lokhttp3/mockwebserver/MockResponse;->promises:Ljava/util/List;
  58. const/16 v0, 0xc8
  59. invoke-virtual {p0, v0}, Lokhttp3/mockwebserver/MockResponse;->setResponseCode(I)Lokhttp3/mockwebserver/MockResponse;
  60. const/4 v0, 0x0
  61. invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
  62. move-result-object v0
  63. const-string v1, "Content-Length"
  64. invoke-virtual {p0, v1, v0}, Lokhttp3/mockwebserver/MockResponse;->setHeader(Ljava/lang/String;Ljava/lang/Object;)Lokhttp3/mockwebserver/MockResponse;
  65. return-void
  66. .end method
  67. # virtual methods
  68. .method public addHeader(Ljava/lang/String;)Lokhttp3/mockwebserver/MockResponse;
  69. .locals 1
  70. iget-object v0, p0, Lokhttp3/mockwebserver/MockResponse;->headers:Lokhttp3/Headers$Builder;
  71. invoke-virtual {v0, p1}, Lokhttp3/Headers$Builder;->add(Ljava/lang/String;)Lokhttp3/Headers$Builder;
  72. return-object p0
  73. .end method
  74. .method public addHeader(Ljava/lang/String;Ljava/lang/Object;)Lokhttp3/mockwebserver/MockResponse;
  75. .locals 1
  76. iget-object v0, p0, Lokhttp3/mockwebserver/MockResponse;->headers:Lokhttp3/Headers$Builder;
  77. invoke-static {p2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
  78. move-result-object p2
  79. invoke-virtual {v0, p1, p2}, Lokhttp3/Headers$Builder;->add(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Headers$Builder;
  80. return-object p0
  81. .end method
  82. .method public addHeaderLenient(Ljava/lang/String;Ljava/lang/Object;)Lokhttp3/mockwebserver/MockResponse;
  83. .locals 2
  84. sget-object v0, Lokhttp3/internal/Internal;->instance:Lokhttp3/internal/Internal;
  85. iget-object v1, p0, Lokhttp3/mockwebserver/MockResponse;->headers:Lokhttp3/Headers$Builder;
  86. invoke-static {p2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
  87. move-result-object p2
  88. invoke-virtual {v0, v1, p1, p2}, Lokhttp3/internal/Internal;->addLenient(Lokhttp3/Headers$Builder;Ljava/lang/String;Ljava/lang/String;)V
  89. return-object p0
  90. .end method
  91. .method public clearHeaders()Lokhttp3/mockwebserver/MockResponse;
  92. .locals 1
  93. new-instance v0, Lokhttp3/Headers$Builder;
  94. invoke-direct {v0}, Lokhttp3/Headers$Builder;-><init>()V
  95. iput-object v0, p0, Lokhttp3/mockwebserver/MockResponse;->headers:Lokhttp3/Headers$Builder;
  96. return-object p0
  97. .end method
  98. .method public bridge synthetic clone()Ljava/lang/Object;
  99. .locals 1
  100. .annotation system Ldalvik/annotation/Throws;
  101. value = {
  102. Ljava/lang/CloneNotSupportedException;
  103. }
  104. .end annotation
  105. invoke-virtual {p0}, Lokhttp3/mockwebserver/MockResponse;->clone()Lokhttp3/mockwebserver/MockResponse;
  106. move-result-object v0
  107. return-object v0
  108. .end method
  109. .method public clone()Lokhttp3/mockwebserver/MockResponse;
  110. .locals 3
  111. :try_start_0
  112. invoke-super {p0}, Ljava/lang/Object;->clone()Ljava/lang/Object;
  113. move-result-object v0
  114. check-cast v0, Lokhttp3/mockwebserver/MockResponse;
  115. iget-object v1, p0, Lokhttp3/mockwebserver/MockResponse;->headers:Lokhttp3/Headers$Builder;
  116. invoke-virtual {v1}, Lokhttp3/Headers$Builder;->build()Lokhttp3/Headers;
  117. move-result-object v1
  118. invoke-virtual {v1}, Lokhttp3/Headers;->newBuilder()Lokhttp3/Headers$Builder;
  119. move-result-object v1
  120. iput-object v1, v0, Lokhttp3/mockwebserver/MockResponse;->headers:Lokhttp3/Headers$Builder;
  121. new-instance v1, Ljava/util/ArrayList;
  122. iget-object v2, p0, Lokhttp3/mockwebserver/MockResponse;->promises:Ljava/util/List;
  123. invoke-direct {v1, v2}, Ljava/util/ArrayList;-><init>(Ljava/util/Collection;)V
  124. iput-object v1, v0, Lokhttp3/mockwebserver/MockResponse;->promises:Ljava/util/List;
  125. :try_end_0
  126. .catch Ljava/lang/CloneNotSupportedException; {:try_start_0 .. :try_end_0} :catch_0
  127. return-object v0
  128. :catch_0
  129. new-instance v0, Ljava/lang/AssertionError;
  130. invoke-direct {v0}, Ljava/lang/AssertionError;-><init>()V
  131. throw v0
  132. .end method
  133. .method public getBody()Lokio/Buffer;
  134. .locals 1
  135. iget-object v0, p0, Lokhttp3/mockwebserver/MockResponse;->body:Lokio/Buffer;
  136. if-eqz v0, :cond_0
  137. invoke-virtual {v0}, Lokio/Buffer;->clone()Lokio/Buffer;
  138. move-result-object v0
  139. goto :goto_0
  140. :cond_0
  141. const/4 v0, 0x0
  142. :goto_0
  143. return-object v0
  144. .end method
  145. .method public getBodyDelay(Ljava/util/concurrent/TimeUnit;)J
  146. .locals 3
  147. iget-wide v0, p0, Lokhttp3/mockwebserver/MockResponse;->bodyDelayAmount:J
  148. iget-object v2, p0, Lokhttp3/mockwebserver/MockResponse;->bodyDelayUnit:Ljava/util/concurrent/TimeUnit;
  149. invoke-virtual {p1, v0, v1, v2}, Ljava/util/concurrent/TimeUnit;->convert(JLjava/util/concurrent/TimeUnit;)J
  150. move-result-wide v0
  151. return-wide v0
  152. .end method
  153. .method public getHeaders()Lokhttp3/Headers;
  154. .locals 1
  155. iget-object v0, p0, Lokhttp3/mockwebserver/MockResponse;->headers:Lokhttp3/Headers$Builder;
  156. invoke-virtual {v0}, Lokhttp3/Headers$Builder;->build()Lokhttp3/Headers;
  157. move-result-object v0
  158. return-object v0
  159. .end method
  160. .method public getHeadersDelay(Ljava/util/concurrent/TimeUnit;)J
  161. .locals 3
  162. iget-wide v0, p0, Lokhttp3/mockwebserver/MockResponse;->headersDelayAmount:J
  163. iget-object v2, p0, Lokhttp3/mockwebserver/MockResponse;->headersDelayUnit:Ljava/util/concurrent/TimeUnit;
  164. invoke-virtual {p1, v0, v1, v2}, Ljava/util/concurrent/TimeUnit;->convert(JLjava/util/concurrent/TimeUnit;)J
  165. move-result-wide v0
  166. return-wide v0
  167. .end method
  168. .method public getHttp2ErrorCode()I
  169. .locals 1
  170. iget v0, p0, Lokhttp3/mockwebserver/MockResponse;->http2ErrorCode:I
  171. return v0
  172. .end method
  173. .method public getPushPromises()Ljava/util/List;
  174. .locals 1
  175. .annotation system Ldalvik/annotation/Signature;
  176. value = {
  177. "()",
  178. "Ljava/util/List<",
  179. "Lokhttp3/mockwebserver/PushPromise;",
  180. ">;"
  181. }
  182. .end annotation
  183. iget-object v0, p0, Lokhttp3/mockwebserver/MockResponse;->promises:Ljava/util/List;
  184. return-object v0
  185. .end method
  186. .method public getSettings()Lokhttp3/internal/http2/Settings;
  187. .locals 1
  188. iget-object v0, p0, Lokhttp3/mockwebserver/MockResponse;->settings:Lokhttp3/internal/http2/Settings;
  189. return-object v0
  190. .end method
  191. .method public getSocketPolicy()Lokhttp3/mockwebserver/SocketPolicy;
  192. .locals 1
  193. iget-object v0, p0, Lokhttp3/mockwebserver/MockResponse;->socketPolicy:Lokhttp3/mockwebserver/SocketPolicy;
  194. return-object v0
  195. .end method
  196. .method public getStatus()Ljava/lang/String;
  197. .locals 1
  198. iget-object v0, p0, Lokhttp3/mockwebserver/MockResponse;->status:Ljava/lang/String;
  199. return-object v0
  200. .end method
  201. .method public getThrottleBytesPerPeriod()J
  202. .locals 2
  203. iget-wide v0, p0, Lokhttp3/mockwebserver/MockResponse;->throttleBytesPerPeriod:J
  204. return-wide v0
  205. .end method
  206. .method public getThrottlePeriod(Ljava/util/concurrent/TimeUnit;)J
  207. .locals 3
  208. iget-wide v0, p0, Lokhttp3/mockwebserver/MockResponse;->throttlePeriodAmount:J
  209. iget-object v2, p0, Lokhttp3/mockwebserver/MockResponse;->throttlePeriodUnit:Ljava/util/concurrent/TimeUnit;
  210. invoke-virtual {p1, v0, v1, v2}, Ljava/util/concurrent/TimeUnit;->convert(JLjava/util/concurrent/TimeUnit;)J
  211. move-result-wide v0
  212. return-wide v0
  213. .end method
  214. .method public getWebSocketListener()Lokhttp3/WebSocketListener;
  215. .locals 1
  216. iget-object v0, p0, Lokhttp3/mockwebserver/MockResponse;->webSocketListener:Lokhttp3/WebSocketListener;
  217. return-object v0
  218. .end method
  219. .method public removeHeader(Ljava/lang/String;)Lokhttp3/mockwebserver/MockResponse;
  220. .locals 1
  221. iget-object v0, p0, Lokhttp3/mockwebserver/MockResponse;->headers:Lokhttp3/Headers$Builder;
  222. invoke-virtual {v0, p1}, Lokhttp3/Headers$Builder;->removeAll(Ljava/lang/String;)Lokhttp3/Headers$Builder;
  223. return-object p0
  224. .end method
  225. .method public setBody(Ljava/lang/String;)Lokhttp3/mockwebserver/MockResponse;
  226. .locals 1
  227. new-instance v0, Lokio/Buffer;
  228. invoke-direct {v0}, Lokio/Buffer;-><init>()V
  229. invoke-virtual {v0, p1}, Lokio/Buffer;->writeUtf8(Ljava/lang/String;)Lokio/Buffer;
  230. move-result-object p1
  231. invoke-virtual {p0, p1}, Lokhttp3/mockwebserver/MockResponse;->setBody(Lokio/Buffer;)Lokhttp3/mockwebserver/MockResponse;
  232. move-result-object p1
  233. return-object p1
  234. .end method
  235. .method public setBody(Lokio/Buffer;)Lokhttp3/mockwebserver/MockResponse;
  236. .locals 2
  237. invoke-virtual {p1}, Lokio/Buffer;->size()J
  238. move-result-wide v0
  239. invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
  240. move-result-object v0
  241. const-string v1, "Content-Length"
  242. invoke-virtual {p0, v1, v0}, Lokhttp3/mockwebserver/MockResponse;->setHeader(Ljava/lang/String;Ljava/lang/Object;)Lokhttp3/mockwebserver/MockResponse;
  243. invoke-virtual {p1}, Lokio/Buffer;->clone()Lokio/Buffer;
  244. move-result-object p1
  245. iput-object p1, p0, Lokhttp3/mockwebserver/MockResponse;->body:Lokio/Buffer;
  246. return-object p0
  247. .end method
  248. .method public setBodyDelay(JLjava/util/concurrent/TimeUnit;)Lokhttp3/mockwebserver/MockResponse;
  249. .locals 0
  250. iput-wide p1, p0, Lokhttp3/mockwebserver/MockResponse;->bodyDelayAmount:J
  251. iput-object p3, p0, Lokhttp3/mockwebserver/MockResponse;->bodyDelayUnit:Ljava/util/concurrent/TimeUnit;
  252. return-object p0
  253. .end method
  254. .method public setChunkedBody(Ljava/lang/String;I)Lokhttp3/mockwebserver/MockResponse;
  255. .locals 1
  256. new-instance v0, Lokio/Buffer;
  257. invoke-direct {v0}, Lokio/Buffer;-><init>()V
  258. invoke-virtual {v0, p1}, Lokio/Buffer;->writeUtf8(Ljava/lang/String;)Lokio/Buffer;
  259. move-result-object p1
  260. invoke-virtual {p0, p1, p2}, Lokhttp3/mockwebserver/MockResponse;->setChunkedBody(Lokio/Buffer;I)Lokhttp3/mockwebserver/MockResponse;
  261. move-result-object p1
  262. return-object p1
  263. .end method
  264. .method public setChunkedBody(Lokio/Buffer;I)Lokhttp3/mockwebserver/MockResponse;
  265. .locals 5
  266. const-string v0, "Content-Length"
  267. invoke-virtual {p0, v0}, Lokhttp3/mockwebserver/MockResponse;->removeHeader(Ljava/lang/String;)Lokhttp3/mockwebserver/MockResponse;
  268. iget-object v0, p0, Lokhttp3/mockwebserver/MockResponse;->headers:Lokhttp3/Headers$Builder;
  269. const-string v1, "Transfer-encoding: chunked"
  270. invoke-virtual {v0, v1}, Lokhttp3/Headers$Builder;->add(Ljava/lang/String;)Lokhttp3/Headers$Builder;
  271. new-instance v0, Lokio/Buffer;
  272. invoke-direct {v0}, Lokio/Buffer;-><init>()V
  273. :goto_0
  274. invoke-virtual {p1}, Lokio/Buffer;->exhausted()Z
  275. move-result v1
  276. if-nez v1, :cond_0
  277. invoke-virtual {p1}, Lokio/Buffer;->size()J
  278. move-result-wide v1
  279. int-to-long v3, p2
  280. invoke-static {v1, v2, v3, v4}, Ljava/lang/Math;->min(JJ)J
  281. move-result-wide v1
  282. invoke-virtual {v0, v1, v2}, Lokio/Buffer;->writeHexadecimalUnsignedLong(J)Lokio/Buffer;
  283. const-string v3, "\r\n"
  284. invoke-virtual {v0, v3}, Lokio/Buffer;->writeUtf8(Ljava/lang/String;)Lokio/Buffer;
  285. invoke-virtual {v0, p1, v1, v2}, Lokio/Buffer;->write(Lokio/Buffer;J)V
  286. invoke-virtual {v0, v3}, Lokio/Buffer;->writeUtf8(Ljava/lang/String;)Lokio/Buffer;
  287. goto :goto_0
  288. :cond_0
  289. const-string p1, "0\r\n\r\n"
  290. invoke-virtual {v0, p1}, Lokio/Buffer;->writeUtf8(Ljava/lang/String;)Lokio/Buffer;
  291. iput-object v0, p0, Lokhttp3/mockwebserver/MockResponse;->body:Lokio/Buffer;
  292. return-object p0
  293. .end method
  294. .method public setHeader(Ljava/lang/String;Ljava/lang/Object;)Lokhttp3/mockwebserver/MockResponse;
  295. .locals 0
  296. invoke-virtual {p0, p1}, Lokhttp3/mockwebserver/MockResponse;->removeHeader(Ljava/lang/String;)Lokhttp3/mockwebserver/MockResponse;
  297. invoke-virtual {p0, p1, p2}, Lokhttp3/mockwebserver/MockResponse;->addHeader(Ljava/lang/String;Ljava/lang/Object;)Lokhttp3/mockwebserver/MockResponse;
  298. move-result-object p1
  299. return-object p1
  300. .end method
  301. .method public setHeaders(Lokhttp3/Headers;)Lokhttp3/mockwebserver/MockResponse;
  302. .locals 0
  303. invoke-virtual {p1}, Lokhttp3/Headers;->newBuilder()Lokhttp3/Headers$Builder;
  304. move-result-object p1
  305. iput-object p1, p0, Lokhttp3/mockwebserver/MockResponse;->headers:Lokhttp3/Headers$Builder;
  306. return-object p0
  307. .end method
  308. .method public setHeadersDelay(JLjava/util/concurrent/TimeUnit;)Lokhttp3/mockwebserver/MockResponse;
  309. .locals 0
  310. iput-wide p1, p0, Lokhttp3/mockwebserver/MockResponse;->headersDelayAmount:J
  311. iput-object p3, p0, Lokhttp3/mockwebserver/MockResponse;->headersDelayUnit:Ljava/util/concurrent/TimeUnit;
  312. return-object p0
  313. .end method
  314. .method public setHttp2ErrorCode(I)Lokhttp3/mockwebserver/MockResponse;
  315. .locals 0
  316. iput p1, p0, Lokhttp3/mockwebserver/MockResponse;->http2ErrorCode:I
  317. return-object p0
  318. .end method
  319. .method public setResponseCode(I)Lokhttp3/mockwebserver/MockResponse;
  320. .locals 3
  321. const/16 v0, 0xc8
  322. const/16 v1, 0x64
  323. if-lt p1, v1, :cond_0
  324. if-ge p1, v0, :cond_0
  325. const-string v0, "Informational"
  326. goto :goto_0
  327. :cond_0
  328. const/16 v1, 0x12c
  329. if-lt p1, v0, :cond_1
  330. if-ge p1, v1, :cond_1
  331. const-string v0, "OK"
  332. goto :goto_0
  333. :cond_1
  334. const/16 v0, 0x190
  335. if-lt p1, v1, :cond_2
  336. if-ge p1, v0, :cond_2
  337. const-string v0, "Redirection"
  338. goto :goto_0
  339. :cond_2
  340. const/16 v1, 0x1f4
  341. if-lt p1, v0, :cond_3
  342. if-ge p1, v1, :cond_3
  343. const-string v0, "Client Error"
  344. goto :goto_0
  345. :cond_3
  346. if-lt p1, v1, :cond_4
  347. const/16 v0, 0x258
  348. if-ge p1, v0, :cond_4
  349. const-string v0, "Server Error"
  350. goto :goto_0
  351. :cond_4
  352. const-string v0, "Mock Response"
  353. :goto_0
  354. new-instance v1, Ljava/lang/StringBuilder;
  355. invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
  356. const-string v2, "HTTP/1.1 "
  357. invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  358. invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
  359. const-string p1, " "
  360. invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  361. invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  362. invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  363. move-result-object p1
  364. invoke-virtual {p0, p1}, Lokhttp3/mockwebserver/MockResponse;->setStatus(Ljava/lang/String;)Lokhttp3/mockwebserver/MockResponse;
  365. move-result-object p1
  366. return-object p1
  367. .end method
  368. .method public setSocketPolicy(Lokhttp3/mockwebserver/SocketPolicy;)Lokhttp3/mockwebserver/MockResponse;
  369. .locals 0
  370. iput-object p1, p0, Lokhttp3/mockwebserver/MockResponse;->socketPolicy:Lokhttp3/mockwebserver/SocketPolicy;
  371. return-object p0
  372. .end method
  373. .method public setStatus(Ljava/lang/String;)Lokhttp3/mockwebserver/MockResponse;
  374. .locals 0
  375. iput-object p1, p0, Lokhttp3/mockwebserver/MockResponse;->status:Ljava/lang/String;
  376. return-object p0
  377. .end method
  378. .method public throttleBody(JJLjava/util/concurrent/TimeUnit;)Lokhttp3/mockwebserver/MockResponse;
  379. .locals 0
  380. iput-wide p1, p0, Lokhttp3/mockwebserver/MockResponse;->throttleBytesPerPeriod:J
  381. iput-wide p3, p0, Lokhttp3/mockwebserver/MockResponse;->throttlePeriodAmount:J
  382. iput-object p5, p0, Lokhttp3/mockwebserver/MockResponse;->throttlePeriodUnit:Ljava/util/concurrent/TimeUnit;
  383. return-object p0
  384. .end method
  385. .method public toString()Ljava/lang/String;
  386. .locals 1
  387. iget-object v0, p0, Lokhttp3/mockwebserver/MockResponse;->status:Ljava/lang/String;
  388. return-object v0
  389. .end method
  390. .method public withPush(Lokhttp3/mockwebserver/PushPromise;)Lokhttp3/mockwebserver/MockResponse;
  391. .locals 1
  392. iget-object v0, p0, Lokhttp3/mockwebserver/MockResponse;->promises:Ljava/util/List;
  393. invoke-interface {v0, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
  394. return-object p0
  395. .end method
  396. .method public withSettings(Lokhttp3/internal/http2/Settings;)Lokhttp3/mockwebserver/MockResponse;
  397. .locals 0
  398. iput-object p1, p0, Lokhttp3/mockwebserver/MockResponse;->settings:Lokhttp3/internal/http2/Settings;
  399. return-object p0
  400. .end method
  401. .method public withWebSocketUpgrade(Lokhttp3/WebSocketListener;)Lokhttp3/mockwebserver/MockResponse;
  402. .locals 2
  403. const-string v0, "HTTP/1.1 101 Switching Protocols"
  404. invoke-virtual {p0, v0}, Lokhttp3/mockwebserver/MockResponse;->setStatus(Ljava/lang/String;)Lokhttp3/mockwebserver/MockResponse;
  405. const-string v0, "Upgrade"
  406. const-string v1, "Connection"
  407. invoke-virtual {p0, v1, v0}, Lokhttp3/mockwebserver/MockResponse;->setHeader(Ljava/lang/String;Ljava/lang/Object;)Lokhttp3/mockwebserver/MockResponse;
  408. const-string v1, "websocket"
  409. invoke-virtual {p0, v0, v1}, Lokhttp3/mockwebserver/MockResponse;->setHeader(Ljava/lang/String;Ljava/lang/Object;)Lokhttp3/mockwebserver/MockResponse;
  410. const/4 v0, 0x0
  411. iput-object v0, p0, Lokhttp3/mockwebserver/MockResponse;->body:Lokio/Buffer;
  412. iput-object p1, p0, Lokhttp3/mockwebserver/MockResponse;->webSocketListener:Lokhttp3/WebSocketListener;
  413. return-object p0
  414. .end method