Code sample using Stream
// process the stream myIterableStream.stream().forEach(resp -> { if (resp.getStatusCode() ==HttpURLConnection
.HTTP_OK) {System
.out.printf("Response headers are %s. Url %s%n", resp.getDeserializedHeaders(), resp.getRequest().getUrl()); resp.getItems().forEach(value -> {System
.out.printf("Response value is %d%n", value); }); } });
Code sample using Iterator
// Iterate over iterator for (PagedResponseBase
<String
,Integer
> resp : myIterableStream) { if (resp.getStatusCode() ==HttpURLConnection
.HTTP_OK) {System
.out.printf("Response headers are %s. Url %s%n", resp.getDeserializedHeaders(), resp.getRequest().getUrl()); resp.getItems().forEach(value -> {System
.out.printf("Response value is %d%n", value); }); } }
Code sample using Stream and filter
// process the stream myIterableStream.stream().filter(resp -> resp.getStatusCode() ==HttpURLConnection
.HTTP_OK) .limit(10) .forEach(resp -> {System
.out.printf("Response headers are %s. Url %s%n", resp.getDeserializedHeaders(), resp.getRequest().getUrl()); resp.getItems().forEach(value -> {System
.out.printf("Response value is %d%n", value); }); });
ncG1vNJzZmiZqqq%2Fpr%2FDpJuom6Njr627wWeaqKqVY8SqusOorqxmnprBcHDWnploopGrrnCt2a6pnmWTpL%2Bme5BnaWdoX5i8rnvAs6yrnV%2BYvLOxjq6roqRffsGmvsCbo56LpKeyormNoaumpA%3D%3D