Advertisement
Guest User

Untitled

a guest
Jan 12th, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. {
  2. {
  3. name: "assassins_creed",
  4. href: "games/assassins_creedId123"
  5. },
  6. {
  7. name: "bioshock",
  8. href: "games/bioshockId456"
  9. },
  10. {
  11. name: "clean_code",
  12. href: "books/clean_codeId789"
  13. },
  14. {
  15. name: "christmas",
  16. href: "events/xmas001"
  17. }
  18. }
  19.  
  20. List<String> hrefLinks = list.stream()
  21. .map(e -> (String) e.get("href"))
  22. .collect(Collectors.toList());
  23.  
  24. private Observable<List<JSONObject>> dashboard(String access, String urlFragment, Queue<String> errors) {
  25. Client client = ClientBuilder.newClient();
  26. return RxObservable.from(client).target(urlFragment).request()
  27. .header("Authorization", access)
  28. .rx()
  29. .get(new GenericType<List<JSONObject>>(){})
  30. .onErrorReturn(throwable -> {
  31. errors.offer(throwable.getMessage());
  32. return Collections.emptyList();
  33. });
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement