public class AsGenericMonad
extends java.lang.Object
| Constructor and Description |
|---|
AsGenericMonad() |
| Modifier and Type | Method and Description |
|---|---|
static <MONAD,T> Monad<MONAD,T> |
asMonad(java.lang.Object monad)
Create a duck typed Monad wrapper.
|
static <T,MONAD> Monad<T,MONAD> |
convertToMonad(java.lang.Object monad)
Create a Monad wrapper from an Object that will be converted to Monadic form if neccessary by the registered
MonadicConverters.
|
static <T> Monad<java.util.stream.Stream<T>,T> |
monad(java.util.Collection<T> monad)
Create a Monad wrapper from a Collection
The wrapped Monaad should have equivalent methods for
|
static <T> Monad<java.util.concurrent.CompletableFuture<T>,T> |
monad(java.util.concurrent.CompletableFuture<T> monad)
Create a Monad wrapper from a CompletableFuture
The wrapped Monaad should have equivalent methods for
|
static <T> Monad<java.util.stream.Stream<T>,T> |
monad(java.lang.Iterable<T> monad)
Create a Monad wrapper from an Iterable
The wrapped Monaad should have equivalent methods for
|
static <T> Monad<java.util.stream.Stream<T>,T> |
monad(java.util.Iterator<T> monad)
Create a Monad wrapper from an Iterator
The wrapped Monaad should have equivalent methods for
|
static <T> Monad<java.util.Optional<T>,T> |
monad(java.util.Optional<T> monad)
Create a Monad wrapper from an Optional
The wrapped Monaad should have equivalent methods for
|
static <T> Monad<java.util.stream.Stream<T>,T> |
monad(java.util.stream.Stream<T> monad)
Create a Monad wrapper from a Stream
The wrapped Monaad should have equivalent methods for
|
static <T> Monad<java.util.stream.Stream<T>,T> |
monad(Streamable<T> monad)
Create a Monad wrapper from a Streamable Create a duck typed Monad
wrapper.
|
static <T> Monad<java.util.stream.Stream<T>,T> |
monad(T... values)
Create a Monad wrapper from an array of values
The wrapped Monaad should have equivalent methods for
|
static <T> Monad<?,T> |
toMonad(java.lang.Object monad)
Create a Monad wrapper from an Object
The wrapped Monaad should have equivalent methods for
|
public static <MONAD,T> Monad<MONAD,T> asMonad(java.lang.Object monad)
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> Monad<java.util.stream.Stream<T>,T> monad(Streamable<T> monad)
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> Monad<java.util.stream.Stream<T>,T> monad(java.util.stream.Stream<T> monad)
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> Monad<java.util.Optional<T>,T> monad(java.util.Optional<T> monad)
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> Monad<java.util.concurrent.CompletableFuture<T>,T> monad(java.util.concurrent.CompletableFuture<T> monad)
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 typepublic static <T> Monad<java.util.stream.Stream<T>,T> monad(java.util.Collection<T> monad)
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> Monad<java.util.stream.Stream<T>,T> monad(java.lang.Iterable<T> monad)
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> Monad<java.util.stream.Stream<T>,T> monad(java.util.Iterator<T> monad)
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> Monad<java.util.stream.Stream<T>,T> monad(T... values)
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> Monad<?,T> toMonad(java.lang.Object monad)
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,MONAD> Monad<T,MONAD> convertToMonad(java.lang.Object monad)
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 type