T
- Data type of element(s) stored in this Transformable@FunctionalInterface
public interface Transformable<T>
Modifier and Type | Method and Description |
---|---|
<R> Transformable<R> |
map(java.util.function.Function<? super T,? extends R> fn)
Transform this functor using the supplied transformation function
|
default Transformable<T> |
peek(java.util.function.Consumer<? super T> c)
Peek at the current value of this Transformable, without transforming it
|
<R> Transformable<R> map(java.util.function.Function<? super T,? extends R> fn)
of(1,2,3).map(i->i*2)
//[2,4,6]
fn
- Transformation functiondefault Transformable<T> peek(java.util.function.Consumer<? super T> c)
of(1,2,3).map(System.out::println)
1
2
3
c
- Consumer that recieves each element from this Transformable