T
- Data type of the element(s) in this FilterableTransformablepublic interface FilterableTransformable<T> extends Filters<T>, Transformable<T>
Modifier and Type | Method and Description |
---|---|
FilterableTransformable<T> |
filter(java.util.function.Predicate<? super T> fn)
Keep only elements for which the supplied predicates hold
e.g.
|
<R> FilterableTransformable<R> |
map(java.util.function.Function<? super T,? extends R> fn)
Transform this functor using the supplied transformation function
|
peek
FilterableTransformable<T> filter(java.util.function.Predicate<? super T> fn)
Filters
of(1,2,3).filter(i->i>2);
//[3]
<R> FilterableTransformable<R> map(java.util.function.Function<? super T,? extends R> fn)
Transformable
of(1,2,3).map(i->i*2)
//[2,4,6]
map
in interface Transformable<T>
fn
- Transformation function