T
- Type of this Filterspublic interface Filters<T>
Modifier and Type | Method and Description |
---|---|
Filters<T> |
filter(java.util.function.Predicate<? super T> predicate)
Keep only elements for which the supplied predicates hold
e.g.
|
default Filters<T> |
filterNot(java.util.function.Predicate<? super T> predicate)
Remove any elements for which the predicate holds (inverse operation to filter)
e.g.
|
default Filters<T> |
notNull()
Filter elements retaining only values which are not null
|
default <U> Filters<U> |
ofType(java.lang.Class<? extends U> type)
Keep only those elements in a reactiveStream that are of a given type.
|
Filters<T> filter(java.util.function.Predicate<? super T> predicate)
of(1,2,3).filter(i->i>2);
//[3]
predicate
- to filter elements by, retaining matchesdefault <U> Filters<U> ofType(java.lang.Class<? extends U> type)
// (1, 2, 3) ReactiveSeq.of(1, "a", 2, "b",3).ofType(Integer.class)
default Filters<T> filterNot(java.util.function.Predicate<? super T> predicate)
of(1,2,3).filter(i->i>2);
//[1,2]
predicate
- to filter elements by, retaining matches