public class AsAnyM
extends java.lang.Object
| Constructor and Description |
|---|
AsAnyM() |
| Modifier and Type | Method and Description |
|---|---|
static <T> AnyM<T> |
anyM(java.util.Collection<T> anyM)
Create a Monad wrapper from a Collection
Create a duck typed Monad wrapper.
|
static <T> AnyM<T> |
anyM(java.util.concurrent.CompletableFuture<T> anyM)
Create a Monad wrapper from a CompletableFuture
Create a duck typed Monad wrapper.
|
static <T> AnyM<T> |
anyM(java.util.Iterator<T> anyM)
Create a Monad wrapper from an Iterator
Create a duck typed Monad wrapper.
|
static <T> AnyM<T> |
anyM(com.nurkiewicz.lazyseq.LazySeq<T> anyM) |
static <T> AnyM<T> |
anyM(java.util.Optional<T> anyM)
Create a Monad wrapper from an Optional
Create a duck typed Monad wrapper.
|
static <T> AnyM<T> |
anyM(java.util.stream.Stream<T> anyM)
Create a Monad wrapper from a Stream
Create a duck typed Monad wrapper.
|
static <T> AnyM<T> |
anyM(Streamable<T> anyM)
Create a Monad wrapper from a Streamable
Create a duck typed Monad wrapper.
|
static <T> AnyM<T> |
anyM(T... values)
Create a Monad wrapper from an array of values
Create a duck typed Monad wrapper.
|
static AnyM<java.lang.String> |
anyMFromBufferedReader(java.io.BufferedReader anyM)
Construct an AnyM backed by a Stream of text from the lines of the BufferedReader
|
static AnyM<java.lang.Character> |
anyMFromCharSequence(java.lang.CharSequence anyM)
Construct an AnyM backed by a Stream of Characters from the text of a String
|
static AnyM<java.lang.String> |
anyMFromFile(java.io.File anyM)
Construct an AnyM backed by a Stream of text from the lines of the supplied file
|
static AnyM<java.lang.String> |
anyMFromURL(java.net.URL anyM)
Construct an AnyM backed by a Stream of text from the lines of the URL
|
static <T> AnyM<T> |
anyMIterable(java.lang.Iterable<T> anyM)
Create a Monad wrapper from an Iterable
Create a duck typed Monad wrapper.
|
static <T> AnyM<T> |
convertToAnyM(java.lang.Object anyM)
Create a Monad wrapper from an Object that will be converted to Monadic form if neccessary by the registered
MonadicConverters.
|
static <T> AnyM<T> |
notTypeSafeAnyM(java.lang.Object anyM)
Create a duck typed Monad wrapper.
|
public static <T> 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> AnyM<T> anyM(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> 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> 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> 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> AnyM<T> anyM(java.util.Collection<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> AnyM<T> anyM(com.nurkiewicz.lazyseq.LazySeq<T> anyM)
public static AnyM<java.lang.String> anyMFromFile(java.io.File anyM)
public static AnyM<java.lang.String> anyMFromBufferedReader(java.io.BufferedReader anyM)
public static AnyM<java.lang.String> anyMFromURL(java.net.URL anyM)
public static AnyM<java.lang.Character> anyMFromCharSequence(java.lang.CharSequence anyM)
public static <T> 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> 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> 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> 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