-
Notifications
You must be signed in to change notification settings - Fork 15
exclude
Mahmoud Ben Hassine edited this page Oct 9, 2015
·
5 revisions
Exclude elements matching a predicate from a stream.
Name | Type | Mandatory | Default |
---|---|---|---|
predicate | Predicate | Yes | N/A |
Stream<String> stream = Stream.of("a", "b");
XStream.unixify(stream)
.exclude(contains("a"))
.to(stdOut()); // prints "b"
// Or
XStream.from(stream)
.pipe(exclude(contains("a")))
.to(stdOut()); // prints "b"
UnixStream is created with passion by Mahmoud Ben Hassine