Skip to content
This repository has been archived by the owner on Oct 12, 2021. It is now read-only.

Commit

Permalink
Avoid collection->array->collection transform
Browse files Browse the repository at this point in the history
  • Loading branch information
berezovskyi committed Sep 23, 2019
1 parent 60a4033 commit 7bf325a
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -186,8 +186,10 @@ public <T> List<T> getResources(final URI[] links, final Class<T> clazz) {
* Gets OSLC resources in parallel from a collection of URIs and unwraps their corresponding entities.
*/
public <T> List<T> getResources(final Collection<URI> links, final Class<T> clazz) {
final URI[] uris = links.toArray(new URI[0]);
return getResources(uris, clazz);
return links.parallelStream().map(uri -> {
final Response resource = getResource(uri.toString());
return resource.readEntity(clazz);
}).collect(Collectors.toList());
}

/**
Expand Down

0 comments on commit 7bf325a

Please sign in to comment.