public class AsFunctor
extends java.lang.Object
| Constructor and Description |
|---|
AsFunctor() |
| Modifier and Type | Method and Description |
|---|---|
static <T> WrappingFunctor<T> |
asFunctor(java.lang.Object o)
Create a Duck typed functor.
|
public static <T> WrappingFunctor<T> asFunctor(java.lang.Object o)
Functor<Integer> mappedStream = AsFunctor.asFunctor(Stream.of(1,2,3))
.map( i->i*2);
Where F is a Functional Interface of any type that takes a single parameter and returns
a result.o - functor to wrap