Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. {"USDT":{"code":"USD",
  2. "codein":"BRLT",
  3. "name":"Dólar Turismo",
  4. "high":"4.09",
  5. "low":"3.9",
  6. "varBid":"0.13",
  7. "pctChange":"3.103",
  8. "bid":"4.08",
  9. "ask":"4.32",
  10. "timestamp":"1558121820000",
  11. "create_date":"2019-05-17 16:39:00"
  12. }
  13. }
  14.  
  15. // Deserialization
  16. //Gson gson = new Gson();
  17. Moedas moedaDia = new Gson().fromJson(response.json, Moedas.class);
  18.  
  19.  
  20. String line = "";
  21.  
  22. result.setResult(moedaDia);
  23.  
  24. public class Moedas {
  25. public List<MoedaDia> USD;
  26.  
  27. public Moedas( List<MoedaDia> USD) {
  28. this.USD = USD;
  29. }
  30.  
  31.  
  32.  
  33. public List<MoedaDia> getValue() {
  34. return USD;
  35. }
  36.  
  37. public void setValue(List<MoedaDia> value) {
  38. this.USD = value;
  39. }
  40. }
  41.  
  42. public class MoedaDia {
  43.  
  44.  
  45. public String code; //": "BRL",
  46. public String codein; //": "BRL",
  47. public String name; //": "Dólar Comercial",
  48. public float high; //": "3,9766",
  49. public float low; //": "3,9748",
  50. public float varBid; //": "0,0021",
  51. public float pctChange; //: "0,05",
  52. public float bid; //": "3,9765",
  53. public float ask; //": "3,9767",
  54. public String timestamp; //": "1557873008",
  55. public String create_date; //": "2019-05-14 21:00:05"
  56.  
  57.  
  58. public MoedaDia(String code, String codein, String name, float high, float low, float varBid, float pctChange, float bid, float ask, String timestamp, String create_date) {
  59. this.code = code;
  60. this.codein = codein;
  61. this.name = name;
  62. this.high = high;
  63. this.low = low;
  64. this.varBid = varBid;
  65. this.pctChange = pctChange;
  66. this.bid = bid;
  67. this.ask = ask;
  68. this.timestamp = timestamp;
  69. this.create_date = create_date;
  70. }
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement