T
- Data type stored within the Maybepublic interface MaybeType<T> extends com.aol.cyclops.hkt.alias.Higher<MaybeType.µ,T>, com.aol.cyclops.control.Maybe<T>
Modifier and Type | Interface and Description |
---|---|
static class |
MaybeType.µ
Witness type
|
static class |
MaybeType.Box<T> |
com.aol.cyclops.control.Maybe.Just<T>, com.aol.cyclops.control.Maybe.Lazy<T>, com.aol.cyclops.control.Maybe.Nothing<T>
com.aol.cyclops.types.applicative.ApplicativeFunctor.Applicatives, com.aol.cyclops.types.applicative.ApplicativeFunctor.ApplyFunctions<T>
Modifier and Type | Method and Description |
---|---|
static <T> MaybeType<T> |
fromOptional(com.aol.cyclops.hkt.alias.Higher<com.aol.cyclops.hkt.jdk.OptionalType.µ,T> optional)
Construct an equivalent Maybe from the Supplied Optional
|
static <X extends java.lang.Throwable,T> |
fromXor(com.aol.cyclops.control.Try<T,X> ty) |
static <ST,T> MaybeType<T> |
fromXor(com.aol.cyclops.control.Xor<ST,T> xor) |
static <T> MaybeType<T> |
just(T value)
Construct an Maybe which contains the provided (non-null) value.
|
static <T> com.aol.cyclops.control.Maybe<T> |
narrow(com.aol.cyclops.hkt.alias.Higher<MaybeType.µ,T> maybe)
Convert the HigherKindedType definition for a Maybe into
|
static <T> MaybeType<T> |
narrowK(com.aol.cyclops.hkt.alias.Higher<MaybeType.µ,T> future)
Convert the raw Higher Kinded Type for MaybeType types into the MaybeType type definition class
|
static <T> java.util.Optional<T> |
narrowOptional(com.aol.cyclops.hkt.alias.Higher<MaybeType.µ,T> Optional)
Convert the HigherKindedType definition for a Maybe into
|
static <T> MaybeType<T> |
none() |
static <T> MaybeType<T> |
of(T value)
Construct an Maybe which contains the provided (non-null) value
Equivalent to @see
Maybe.just(Object) |
static <T> MaybeType<T> |
ofNullable(T value)
Maybe<Integer> maybe = Maybe.ofNullable(null);
//None
Maybe<Integer> maybe = Maybe.ofNullable(10);
//Maybe[10], Some[10]
|
static <T> MaybeType<T> |
widen(com.aol.cyclops.control.Maybe<T> maybe)
Convert a Maybe to a simulated HigherKindedType that captures Maybe nature
and Maybe element data type separately.
|
static <T> MaybeType<T> |
widen(java.util.Optional<T> optional)
Convert a Optional to a simulated HigherKindedType that captures Optional nature
and Optional element data type separately.
|
static <C2,T> com.aol.cyclops.hkt.alias.Higher<C2,com.aol.cyclops.hkt.alias.Higher<MaybeType.µ,T>> |
widen2(com.aol.cyclops.hkt.alias.Higher<C2,MaybeType<T>> nestedMaybe) |
accumulateJust, accumulateJust, accumulateJust, cast, coflatMap, combine, combine, combineEager, filter, filterNot, flatMap, flatMapIterable, flatMapPublisher, fromEval, fromEvalOf, fromIterable, fromOptional, fromPublisher, isPresent, map, narrow, nest, notNull, ofType, patternMatch, peek, recover, recover, sequence, sequence, sequenceJust, toMaybe, trampoline, unit, visit, zip, zip, zip, zip, zip, zip, zip
applyFunctions
collect, fold, fold, generate, iterate, iterator, mapReduce, mkString, newSubscriber, stream, subscribe, test, toDequeX, toEvalAlways, toEvalLater, toEvalNow, toFeatureToggle, toFutureStream, toFutureStream, toIor, toLazyImmutable, toList, toListX, toMutable, toPBagX, toPOrderedSetX, toPQueueX, toPSetX, toPStackX, toPVectorX, toQueueX, toSetX, toSimpleReact, toSimpleReact, toSortedSetX, toTry, toTry, toTry, toXor, toXor, unapply
endsWith, endsWithIterable, findAny, findFirst, firstValue, foldable, foldRight, foldRight, foldRight, foldRightMapToType, get, groupBy, join, join, join, mapReduce, print, print, printErr, printOut, reduce, reduce, reduce, reduce, reduce, reduce, reduce, schedule, scheduleFixedDelay, scheduleFixedRate, single, single, singleOptional, startsWith, startsWithIterable, toConcurrentLazyCollection, toConcurrentLazyStreamable, toLazyCollection, validate, xMatch
collect, fromSupplier, get, orElse, orElseGet, orElseThrow, toAtomicReference, toCompletableFuture, toCompletableFutureAsync, toCompletableFutureAsync, toFutureW, toFutureWAsync, toFutureWAsync, toOptional, toOptionalAtomicReference, toStream
static <ST,T> MaybeType<T> fromXor(com.aol.cyclops.control.Xor<ST,T> xor)
static <X extends java.lang.Throwable,T> MaybeType<T> fromXor(com.aol.cyclops.control.Try<T,X> ty)
static <T> MaybeType<T> none()
none
in interface com.aol.cyclops.control.Maybe<T>
static <T> MaybeType<T> fromOptional(com.aol.cyclops.hkt.alias.Higher<com.aol.cyclops.hkt.jdk.OptionalType.µ,T> optional)
MaybeType<Integer> some = MaybeType.fromOptional(Optional.of(10));
//Maybe[10], Some[10]
MaybeType<Integer> none = MaybeType.fromOptional(Optional.empty());
//Maybe.empty, None[]
opt
- Optional to construct Maybe fromstatic <T> MaybeType<T> widen(java.util.Optional<T> optional)
Optional
- Optional to widen to a MaybeTypestatic <C2,T> com.aol.cyclops.hkt.alias.Higher<C2,com.aol.cyclops.hkt.alias.Higher<MaybeType.µ,T>> widen2(com.aol.cyclops.hkt.alias.Higher<C2,MaybeType<T>> nestedMaybe)
static <T> MaybeType<T> narrowK(com.aol.cyclops.hkt.alias.Higher<MaybeType.µ,T> future)
future
- HKT encoded list into a MaybeTypestatic <T> java.util.Optional<T> narrowOptional(com.aol.cyclops.hkt.alias.Higher<MaybeType.µ,T> Optional)
MaybeType
- Constructor to convert back into narrowed typestatic <T> MaybeType<T> just(T value)
Maybe.of(Object)
Maybe<Integer> some = Maybe.just(10);
some.map(i->i*2);
just
in interface com.aol.cyclops.control.Maybe<T>
value
- Value to wrap inside a Maybestatic <T> MaybeType<T> of(T value)
Maybe.just(Object)
Maybe<Integer> some = Maybe.of(10);
some.map(i->i*2);
static <T> MaybeType<T> ofNullable(T value)
Maybe<Integer> maybe = Maybe.ofNullable(null);
//None
Maybe<Integer> maybe = Maybe.ofNullable(10);
//Maybe[10], Some[10]
ofNullable
in interface com.aol.cyclops.control.Maybe<T>
value
- static <T> MaybeType<T> widen(com.aol.cyclops.control.Maybe<T> maybe)
Maybe
- Maybe to widen to a MaybeTypestatic <T> com.aol.cyclops.control.Maybe<T> narrow(com.aol.cyclops.hkt.alias.Higher<MaybeType.µ,T> maybe)
Maybe
- Type Constructor to convert back into narrowed type