Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
529d54a6
Unverified
Commit
529d54a6
authored
Dec 16, 2018
by
Greg Messner
Committed by
GitHub
Dec 16, 2018
Browse files
Added parallel Stream example.
parent
f94a51d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
529d54a6
...
...
@@ -163,6 +163,10 @@ Example usage:
```
java
// Stream the visible Projects printing out the project name.
gitlabApi
.
getProjectsApi
().
getProjectsStream
().
map
(
Project:
:
getName
).
forEach
(
name
->
System
.
out
.
println
(
name
));
// Operate on the stream in parallel, this example sorts User instances by username
Stream
<
User
>
stream
=
new
UserApi
(
gitLabApi
).
getUsersStream
();
List
<
User
>
sortedUsers
=
stream
.
parallel
().
sorted
(
comparing
(
User:
:
getUsername
)).
collect
(
toList
());
```
---
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment