@Deprecated
public class AsAnyM
extends java.lang.Object
| Constructor and Description |
|---|
AsAnyM()
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
static <T> com.aol.cyclops.monad.AnyM<T> |
anyM(java.util.Collection<T> anyM)
Deprecated.
Create a Monad wrapper from a Collection
Create a duck typed Monad wrapper.
|
static <T> com.aol.cyclops.monad.AnyM<T> |
anyM(java.util.concurrent.CompletableFuture<T> anyM)
Deprecated.
Create a Monad wrapper from a CompletableFuture
Create a duck typed Monad wrapper.
|
static <T> com.aol.cyclops.monad.AnyM<T> |
anyM(java.util.Iterator<T> anyM)
Deprecated.
Create a Monad wrapper from an Iterator
Create a duck typed Monad wrapper.
|
static <T> com.aol.cyclops.monad.AnyM<T> |
anyM(java.util.Optional<T> anyM)
Deprecated.
Create a Monad wrapper from an Optional
Create a duck typed Monad wrapper.
|
static <T> com.aol.cyclops.monad.AnyM<T> |
anyM(java.util.stream.Stream<T> anyM)
Deprecated.
Create a Monad wrapper from a Stream
Create a duck typed Monad wrapper.
|
static <T> com.aol.cyclops.monad.AnyM<T> |
anyM(com.aol.cyclops.sequence.streamable.Streamable<T> anyM)
Deprecated.
Create a Monad wrapper from a Streamable
Create a duck typed Monad wrapper.
|
static <T> com.aol.cyclops.monad.AnyM<T> |
anyM(T... values)
Deprecated.
Create a Monad wrapper from an array of values
Create a duck typed Monad wrapper.
|
static com.aol.cyclops.monad.AnyM<java.lang.String> |
anyMFromBufferedReader(java.io.BufferedReader anyM)
Deprecated.
Construct an AnyM backed by a Stream of text from the lines of the BufferedReader
|
static com.aol.cyclops.monad.AnyM<java.lang.Character> |
anyMFromCharSequence(java.lang.CharSequence anyM)
Deprecated.
Construct an AnyM backed by a Stream of Characters from the text of a String
|
static com.aol.cyclops.monad.AnyM<java.lang.String> |
anyMFromFile(java.io.File anyM)
Deprecated.
Construct an AnyM backed by a Stream of text from the lines of the supplied file
|
static com.aol.cyclops.monad.AnyM<java.lang.String> |
anyMFromURL(java.net.URL anyM)
Deprecated.
Construct an AnyM backed by a Stream of text from the lines of the URL
|
static <T> com.aol.cyclops.monad.AnyM<T> |
anyMIterable(java.lang.Iterable<T> anyM)
Deprecated.
Create a Monad wrapper from an Iterable
Create a duck typed Monad wrapper.
|
static <T> com.aol.cyclops.monad.AnyM<T> |
anyMList(java.util.List<T> anyM)
Deprecated.
Create an AnyM backed by a list.
|
static <T> com.aol.cyclops.monad.AnyM<T> |
anyMSet(java.util.Set<T> anyM)
Deprecated.
Create an AnyM backed by a Set
Adds map,flatMap, filter methods - but not as efficient as using AsAnyM.anyM(Collection anyM) which converts the Collection to a Stream
|
static <T> com.aol.cyclops.monad.AnyM<T> |
convertToAnyM(java.lang.Object anyM)
Deprecated.
Create a Monad wrapper from an Object that will be converted to Monadic form if neccessary by the registered
MonadicConverters.
|
static <T> com.aol.cyclops.monad.AnyM<T> |
notTypeSafeAnyM(java.lang.Object anyM)
Deprecated.
Create a duck typed Monad wrapper.
|
public static <T> com.aol.cyclops.monad.AnyM<T> notTypeSafeAnyM(java.lang.Object anyM)
Monad<Stream<Integer>,Integer> stream;
we can write
AnyM<Integer> stream;
The wrapped Monaad should have equivalent methods for
map(F f)
flatMap(F<x,MONAD> fm)
and optionally
filter(P p)
A Comprehender instance can be created and registered for new Monad Types. Cyclops will attempt
to manage any Monad type (via the InvokeDynamicComprehender) althouh behaviour is best guaranteed with
customised Comprehenders.
Where F is a Functional Interface of any type that takes a single parameter and returns
a result.
Where P is a Functional Interface of any type that takes a single parameter and returns
a boolean
flatMap operations on the duck typed Monad can return any Monad typeanyM - to wrappublic static <T> com.aol.cyclops.monad.AnyM<T> anyM(com.aol.cyclops.sequence.streamable.Streamable<T> anyM)
Monad<Stream<Integer>,Integer> stream;
we can write
AnyM<Integer> stream;
The wrapped Monaad should have equivalent methods for
map(F f)
flatMap(F<x,MONAD> fm)
and optionally
filter(P p)
A Comprehender instance can be created and registered for new Monad Types. Cyclops will attempt
to manage any Monad type (via the InvokeDynamicComprehender) althouh behaviour is best guaranteed with
customised Comprehenders.
Where F is a Functional Interface of any type that takes a single parameter and returns
a result.
Where P is a Functional Interface of any type that takes a single parameter and returns
a boolean
flatMap operations on the duck typed Monad can return any Monad typeanyM - to wrappublic static <T> com.aol.cyclops.monad.AnyM<T> anyM(java.util.stream.Stream<T> anyM)
Monad<Stream<Integer>,Integer> stream;
we can write
AnyM<Integer> stream;
The wrapped Monaad should have equivalent methods for
map(F f)
flatMap(F<x,MONAD> fm)
and optionally
filter(P p)
A Comprehender instance can be created and registered for new Monad Types. Cyclops will attempt
to manage any Monad type (via the InvokeDynamicComprehender) althouh behaviour is best guaranteed with
customised Comprehenders.
Where F is a Functional Interface of any type that takes a single parameter and returns
a result.
Where P is a Functional Interface of any type that takes a single parameter and returns
a boolean
flatMap operations on the duck typed Monad can return any Monad typeanyM - to wrappublic static <T> com.aol.cyclops.monad.AnyM<T> anyM(java.util.Optional<T> anyM)
Monad<Optional<Integer>,Integer> opt;
we can write
AnyM<Integer> opt;
The wrapped Monaad should have equivalent methods for
map(F f)
flatMap(F<x,MONAD> fm)
and optionally
filter(P p)
A Comprehender instance can be created and registered for new Monad Types. Cyclops will attempt
to manage any Monad type (via the InvokeDynamicComprehender) althouh behaviour is best guaranteed with
customised Comprehenders.
Where F is a Functional Interface of any type that takes a single parameter and returns
a result.
Where P is a Functional Interface of any type that takes a single parameter and returns
a boolean
flatMap operations on the duck typed Monad can return any Monad typeanyM - to wrappublic static <T> com.aol.cyclops.monad.AnyM<T> anyM(java.util.concurrent.CompletableFuture<T> anyM)
Monad<CompletableFuture<Integer>,Integer> future;
we can write
AnyM<Integer> future;
The wrapped Monaad should have equivalent methods for
map(F f) -- thenApply/Async
flatMap(F<x,MONAD> fm) -- thenCompose/Async
and optionally
filter(P p) -- not present for CompletableFutures
A Comprehender instance can be created and registered for new Monad Types. Cyclops will attempt
to manage any Monad type (via the InvokeDynamicComprehender) althouh behaviour is best guaranteed with
customised Comprehenders.
Where F is a Functional Interface of any type that takes a single parameter and returns
a result.
Where P is a Functional Interface of any type that takes a single parameter and returns
a boolean
flatMap operations on the duck typed Monad can return any Monad typeanyM - to wrappublic static <T> com.aol.cyclops.monad.AnyM<T> anyM(java.util.Collection<T> anyM)
AnyMThe wrapped Monaad should have equivalent methods forstream = AsAnyM.anyM(Arrays.asList(10,20,30)); }
map(F f)
stream.map(i->i+2);
flatMap(F<x,AnyM> fm)
stream.flatMap(i-> AsAnyM.anyM(loadData(i));
and optionally
filter(P p)
stream.filter(i<20);
A Comprehender instance can be created and registered for new Monad Types. Cyclops will attempt
to manage any Monad type (via the InvokeDynamicComprehender) althouh behaviour is best guaranteed with
customised Comprehenders.
Where F is a Functional Interface of any type that takes a single parameter and returns
a result.
Where P is a Functional Interface of any type that takes a single parameter and returns
a boolean
flatMap operations on the duck typed Monad can return any Monad typeanyM - to wrappublic static <T> com.aol.cyclops.monad.AnyM<T> anyMList(java.util.List<T> anyM)
AnyM<Integer> list = AsAnyM.anyMList(Arrays.asList(1,2,3));
assertThat(list.unwrap(),instanceOf(List.class));
anyM - to wrappublic static <T> com.aol.cyclops.monad.AnyM<T> anyMSet(java.util.Set<T> anyM)
AnyM<Integer> set = AsAnyM.anyMSet(new HashSet<>(Arrays.asList(1,2,3)));
assertThat(set.unwrap(),instanceOf(Set.class));
anyM - to wrappublic static com.aol.cyclops.monad.AnyM<java.lang.String> anyMFromFile(java.io.File anyM)
public static com.aol.cyclops.monad.AnyM<java.lang.String> anyMFromBufferedReader(java.io.BufferedReader anyM)
public static com.aol.cyclops.monad.AnyM<java.lang.String> anyMFromURL(java.net.URL anyM)
public static com.aol.cyclops.monad.AnyM<java.lang.Character> anyMFromCharSequence(java.lang.CharSequence anyM)
public static <T> com.aol.cyclops.monad.AnyM<T> anyMIterable(java.lang.Iterable<T> anyM)
Monad<Stream<Integer>,Integer> stream;
we can write
AnyM<Integer> stream;
The wrapped Monaad should have equivalent methods for
map(F f)
flatMap(F<x,MONAD> fm)
and optionally
filter(P p)
A Comprehender instance can be created and registered for new Monad Types. Cyclops will attempt
to manage any Monad type (via the InvokeDynamicComprehender) althouh behaviour is best guaranteed with
customised Comprehenders.
Where F is a Functional Interface of any type that takes a single parameter and returns
a result.
Where P is a Functional Interface of any type that takes a single parameter and returns
a boolean
flatMap operations on the duck typed Monad can return any Monad typeanyM - to wrappublic static <T> com.aol.cyclops.monad.AnyM<T> anyM(java.util.Iterator<T> anyM)
Monad<Stream<Integer>,Integer> stream;
we can write
AnyM<Integer> stream;
The wrapped Monaad should have equivalent methods for
map(F f)
flatMap(F<x,MONAD> fm)
and optionally
filter(P p)
A Comprehender instance can be created and registered for new Monad Types. Cyclops will attempt
to manage any Monad type (via the InvokeDynamicComprehender) althouh behaviour is best guaranteed with
customised Comprehenders.
Where F is a Functional Interface of any type that takes a single parameter and returns
a result.
Where P is a Functional Interface of any type that takes a single parameter and returns
a boolean
flatMap operations on the duck typed Monad can return any Monad typeanyM - to wrappublic static <T> com.aol.cyclops.monad.AnyM<T> anyM(T... values)
Monad<Stream<Integer>,Integer> stream;
we can write
AnyM<Integer> stream;
The wrapped Monaad should have equivalent methods for
map(F f)
flatMap(F<x,MONAD> fm)
and optionally
filter(P p)
A Comprehender instance can be created and registered for new Monad Types. Cyclops will attempt
to manage any Monad type (via the InvokeDynamicComprehender) althouh behaviour is best guaranteed with
customised Comprehenders.
Where F is a Functional Interface of any type that takes a single parameter and returns
a result.
Where P is a Functional Interface of any type that takes a single parameter and returns
a boolean
flatMap operations on the duck typed Monad can return any Monad typepublic static <T> com.aol.cyclops.monad.AnyM<T> convertToAnyM(java.lang.Object anyM)
Monad<Stream<Integer>,Integer> stream;
we can write
AnyM<Integer> stream;
The wrapped Monaad should have equivalent methods for
map(F f)
flatMap(F<x,MONAD> fm)
and optionally
filter(P p)
A Comprehender instance can be created and registered for new Monad Types. Cyclops will attempt
to manage any Monad type (via the InvokeDynamicComprehender) althouh behaviour is best guaranteed with
customised Comprehenders.
Where F is a Functional Interface of any type that takes a single parameter and returns
a result.
Where P is a Functional Interface of any type that takes a single parameter and returns
a boolean
flatMap operations on the duck typed Monad can return any Monad typeanyM - to wrap