Advertisement
Guest User

Untitled

a guest
Jan 11th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.51 KB | None | 0 0
  1.         //exhibit a...
  2. {
  3.         Gson gson = new Gson();
  4.         Type aType = new TypeToken<List<A>>(){}.getType();
  5.  
  6.         String contentString = result.getResponse().getContentAsString();
  7.         List<A> results = gson.fromJson(contentString, aType);
  8. }
  9.  
  10.  
  11.  
  12.         //exhibit b...
  13. {
  14.         Gson gson = new Gson();
  15.         Type bType = new TypeToken<List<B>>(){}.getType();
  16.  
  17.         String contentString = result.getResponse().getContentAsString();
  18.         List<B> results = gson.fromJson(contentString, bType);
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement