FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Java8InAction/src/main/java/lambdasinaction/chap8/Peek.java at master · java8/Java8InAction · GitHub
java8
/
Java8InAction
Public
Notifications
You must be signed in to change notification settings
Fork
2.2k
Star
3.2k
Code
Issues
18
Pull requests
7
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
Java8InAction
/
src
/
main
/
java
/
lambdasinaction
/
chap8
/
Peek.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
19 lines (13 loc) · 615 Bytes
Breadcrumbs
Java8InAction
/
src
/
main
/
java
/
lambdasinaction
/
chap8
/
Peek.java
Copy path
File metadata and controls
19 lines (13 loc) · 615 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package
lambdasinaction
.
chap8
;
import
java
.
util
.
List
;
import
java
.
util
.
stream
.
Stream
;
import
static
java
.
util
.
stream
.
Collectors
.
toList
;
public
class
Peek
{
public
static
void
main
(
String
[]
args
) {
List
<
Integer
>
result
=
Stream
.
of
(
2
,
3
,
4
,
5
)
.
peek
(
x
->
System
.
out
.
println
(
"taking from stream: "
+
x
)).
map
(
x
->
x
+
17
)
.
peek
(
x
->
System
.
out
.
println
(
"after map: "
+
x
)).
filter
(
x
->
x
%
2
==
0
)
.
peek
(
x
->
System
.
out
.
println
(
"after filter: "
+
x
)).
limit
(
3
)
.
peek
(
x
->
System
.
out
.
println
(
"after limit: "
+
x
)).
collect
(
toList
());
}
}
Back
|
FazBrowse Home
|
New Git URL