Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- {
- name: "assassins_creed",
- href: "games/assassins_creedId123"
- },
- {
- name: "bioshock",
- href: "games/bioshockId456"
- },
- {
- name: "clean_code",
- href: "books/clean_codeId789"
- },
- {
- name: "christmas",
- href: "events/xmas001"
- }
- }
- List<String> hrefLinks = list.stream()
- .map(e -> (String) e.get("href"))
- .collect(Collectors.toList());
- private Observable<List<JSONObject>> dashboard(String access, String urlFragment, Queue<String> errors) {
- Client client = ClientBuilder.newClient();
- return RxObservable.from(client).target(urlFragment).request()
- .header("Authorization", access)
- .rx()
- .get(new GenericType<List<JSONObject>>(){})
- .onErrorReturn(throwable -> {
- errors.offer(throwable.getMessage());
- return Collections.emptyList();
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement