public class MaybeTValueComprehender extends java.lang.Object implements ValueComprehender<MaybeTValue>, Printable
Constructor and Description |
---|
MaybeTValueComprehender() |
Modifier and Type | Method and Description |
---|---|
MaybeTValue |
empty() |
java.lang.Object |
filter(MaybeTValue t,
java.util.function.Predicate p)
Wrapper around filter
|
java.lang.Object |
flatMap(MaybeTValue t,
java.util.function.Function fn) |
java.lang.Class |
getTargetClass() |
java.lang.Object |
map(MaybeTValue t,
java.util.function.Function fn)
Wrapper around map
|
MaybeTValue |
of(java.lang.Object o) |
java.lang.Object |
resolveForCrossTypeFlatMap(Comprehender comp,
MaybeTValue apply)
Answers the question how should this type behave when returned in a flatMap function
by another type? For example - Optional uses comp.of(opt.get()) when a value is present
and comp.empty() when no value is present.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
fromIterator
executeflatMap, instanceOfT, liftAndFlatMap, liftObject, priority, unwrap, unwrapOtherMonadTypes
public java.lang.Object resolveForCrossTypeFlatMap(Comprehender comp, MaybeTValue apply)
Comprehender
resolveForCrossTypeFlatMap
in interface Comprehender<MaybeTValue>
public java.lang.Object filter(MaybeTValue t, java.util.function.Predicate p)
Comprehender
filter
in interface Comprehender<MaybeTValue>
t
- Monadic type being wrappedp
- JDK Predicate to wrap t.filter ( i -> p.test(i));
public java.lang.Object map(MaybeTValue t, java.util.function.Function fn)
Comprehender
map
in interface Comprehender<MaybeTValue>
t
- Monadic type being wrappedfn
- JDK Function to wrap t.map( i -> fn.apply(i));
public java.lang.Object flatMap(MaybeTValue t, java.util.function.Function fn)
flatMap
in interface Comprehender<MaybeTValue>
public MaybeTValue of(java.lang.Object o)
of
in interface Comprehender<MaybeTValue>
public MaybeTValue empty()
empty
in interface Comprehender<MaybeTValue>
public java.lang.Class getTargetClass()
getTargetClass
in interface Comprehender<MaybeTValue>