@Test public void testFromSource() throws Exception { }
public static List<Source> fromSource(String response, Currency currency, Wallet wallet){ Gson gson = new Gson(); SourceJson sourceJson = gson.fromJson(response, SourceJson.class); List<Source> res = new ArrayList<>(); for(Sources s : sourceJson.sources){ Source source = new Source(); source.setCurrency(currency); source.setWallet(wallet); source.setState(SourceState.VALID.name()); source.setType(s.type); source.setNoffset(s.noffset); source.setIdentifier(s.identifier); source.setAmount(s.amount); source.setBase(s.base); res.add(source); } return res; }
SourceJson implements Serializable { public static List<Source> fromSource(String response, Currency currency, Wallet wallet){ Gson gson = new Gson(); SourceJson sourceJson = gson.fromJson(response, SourceJson.class); List<Source> res = new ArrayList<>(); for(Sources s : sourceJson.sources){ Source source = new Source(); source.setCurrency(currency); source.setWallet(wallet); source.setState(SourceState.VALID.name()); source.setType(s.type); source.setNoffset(s.noffset); source.setIdentifier(s.identifier); source.setAmount(s.amount); source.setBase(s.base); res.add(source); } return res; } }
SourceJson implements Serializable { public static List<Source> fromSource(String response, Currency currency, Wallet wallet){ Gson gson = new Gson(); SourceJson sourceJson = gson.fromJson(response, SourceJson.class); List<Source> res = new ArrayList<>(); for(Sources s : sourceJson.sources){ Source source = new Source(); source.setCurrency(currency); source.setWallet(wallet); source.setState(SourceState.VALID.name()); source.setType(s.type); source.setNoffset(s.noffset); source.setIdentifier(s.identifier); source.setAmount(s.amount); source.setBase(s.base); res.add(source); } return res; }  }
SourceJson implements Serializable { public static List<Source> fromSource(String response, Currency currency, Wallet wallet){ Gson gson = new Gson(); SourceJson sourceJson = gson.fromJson(response, SourceJson.class); List<Source> res = new ArrayList<>(); for(Sources s : sourceJson.sources){ Source source = new Source(); source.setCurrency(currency); source.setWallet(wallet); source.setState(SourceState.VALID.name()); source.setType(s.type); source.setNoffset(s.noffset); source.setIdentifier(s.identifier); source.setAmount(s.amount); source.setBase(s.base); res.add(source); } return res; }  static List<Source> fromSource(String response, Currency currency, Wallet wallet); }
SourceJson implements Serializable { public static List<Source> fromSource(String response, Currency currency, Wallet wallet){ Gson gson = new Gson(); SourceJson sourceJson = gson.fromJson(response, SourceJson.class); List<Source> res = new ArrayList<>(); for(Sources s : sourceJson.sources){ Source source = new Source(); source.setCurrency(currency); source.setWallet(wallet); source.setState(SourceState.VALID.name()); source.setType(s.type); source.setNoffset(s.noffset); source.setIdentifier(s.identifier); source.setAmount(s.amount); source.setBase(s.base); res.add(source); } return res; }  static List<Source> fromSource(String response, Currency currency, Wallet wallet); public String currency; public String pubkey; public Sources[] sources; }