daily pastebin goal
6%
SHARE
TWEET

Untitled

a guest Jan 12th, 2017 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
Top