public static class Xor.Secondary<ST,PT> extends java.lang.Object implements Xor<ST,PT>
Xor.Primary<ST,PT>, Xor.Secondary<ST,PT>
ApplicativeFunctor.Applicatives, ApplicativeFunctor.ApplyFunctions<T>
Value.ValueImpl<T>
Convertable.SupplierToConvertable<T>
Constructor and Description |
---|
Secondary() |
Modifier and Type | Method and Description |
---|---|
<T2,R> Xor<ST,R> |
combine(Value<? extends T2> app,
java.util.function.BiFunction<? super PT,? super T2,? extends R> fn)
Lazily combine this ApplicativeFunctor with the supplied value via the supplied BiFunction
|
Xor<ST,PT> |
filter(java.util.function.Predicate<? super PT> test)
Keep only elements for which the supplied predicates hold
e.g.
|
<LT1,RT1> Xor<LT1,RT1> |
flatMap(java.util.function.Function<? super PT,? extends MonadicValue2<? extends LT1,? extends RT1>> mapper)
Perform a flattening transformation of this Monadicvalue2
|
PT |
get() |
boolean |
isPrimary() |
boolean |
isSecondary() |
<R> Xor<ST,R> |
map(java.util.function.Function<? super PT,? extends R> fn)
Transform this functor using the supplied transformation function
|
<R> Eval<R> |
matches(java.util.function.Function<Matchable.CheckValue1<ST,R>,Matchable.CheckValue1<ST,R>> secondary,
java.util.function.Function<Matchable.CheckValue1<PT,R>,Matchable.CheckValue1<PT,R>> primary,
java.util.function.Supplier<? extends R> otherwise) |
java.lang.String |
mkString() |
Xor<ST,PT> |
peek(java.util.function.Consumer<? super PT> action)
Peek at the current value of this Functor, without transforming it
|
void |
peek(java.util.function.Consumer<? super ST> stAction,
java.util.function.Consumer<? super PT> ptAction) |
<LT1,RT1> Xor<LT1,RT1> |
secondaryFlatMap(java.util.function.Function<? super ST,? extends Xor<LT1,RT1>> mapper) |
ST |
secondaryGet() |
<R> Xor<R,PT> |
secondaryMap(java.util.function.Function<? super ST,? extends R> fn) |
Xor<ST,PT> |
secondaryPeek(java.util.function.Consumer<? super ST> action) |
java.util.Optional<ST> |
secondaryToOptional() |
Xor<ST,PT> |
secondaryToPrimayFlatMap(java.util.function.Function<? super ST,? extends Xor<ST,PT>> fn) |
Xor<ST,PT> |
secondaryToPrimayMap(java.util.function.Function<? super ST,? extends PT> fn) |
ReactiveSeq<ST> |
secondaryToStream() |
Value<ST> |
secondaryValue() |
Xor<PT,ST> |
swap() |
Ior<ST,PT> |
toIor() |
Maybe<PT> |
toMaybe() |
java.util.Optional<PT> |
toOptional() |
java.lang.String |
toString() |
ListX<ST> |
unapply() |
<R> R |
visit(java.util.function.Function<? super ST,? extends R> secondary,
java.util.function.Function<? super PT,? extends R> primary) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
accumulatePrimary, accumulatePrimary, accumulatePrimary, accumulateSecondary, accumulateSecondary, accumulateSecondary, anyM, cast, coflatMap, combine, combineEager, combineToList, filterNot, fromIterable, fromPublisher, isPresent, list, mapBoth, nest, notNull, ofType, patternMatch, primary, secondary, sequencePrimary, sequenceSecondary, toXor, toXor, trampoline, unit, zip, zip, zip, zip, zip, zip, zip
applyFunctions
collect, fold, fold, generate, iterate, iterator, mapReduce, newSubscriber, of, stream, subscribe, test, toDequeX, toEvalAlways, toEvalLater, toEvalNow, toFeatureToggle, toFutureStream, toFutureStream, toLazyImmutable, toList, toListX, toMutable, toPBagX, toPOrderedSetX, toPQueueX, toPSetX, toPStackX, toPVectorX, toQueueX, toSetX, toSimpleReact, toSimpleReact, toSortedSetX, toTry, toTry, toTry
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, orElse, orElseGet, orElseThrow, toAtomicReference, toCompletableFuture, toCompletableFutureAsync, toCompletableFutureAsync, toFutureW, toFutureWAsync, toFutureWAsync, toOptionalAtomicReference, toStream, visit
public boolean isSecondary()
isSecondary
in interface Xor<ST,PT>
public <R> Eval<R> matches(java.util.function.Function<Matchable.CheckValue1<ST,R>,Matchable.CheckValue1<ST,R>> secondary, java.util.function.Function<Matchable.CheckValue1<PT,R>,Matchable.CheckValue1<PT,R>> primary, java.util.function.Supplier<? extends R> otherwise)
public Xor<ST,PT> secondaryToPrimayMap(java.util.function.Function<? super ST,? extends PT> fn)
secondaryToPrimayMap
in interface Xor<ST,PT>
public <R> Xor<R,PT> secondaryMap(java.util.function.Function<? super ST,? extends R> fn)
secondaryMap
in interface Xor<ST,PT>
public <R> Xor<ST,R> map(java.util.function.Function<? super PT,? extends R> fn)
Functor
of(1,2,3).map(i->i*2)
//[2,4,6]
map
in interface Xor<ST,PT>
map
in interface ConvertableFunctor<PT>
map
in interface Functor<PT>
map
in interface MonadicValue<PT>
map
in interface MonadicValue2<ST,PT>
fn
- Transformation functionpublic Xor<ST,PT> secondaryPeek(java.util.function.Consumer<? super ST> action)
secondaryPeek
in interface Xor<ST,PT>
public Xor<ST,PT> peek(java.util.function.Consumer<? super PT> action)
Functor
of(1,2,3).map(System.out::println)
1
2
3
public Xor<ST,PT> filter(java.util.function.Predicate<? super PT> test)
Filterable
of(1,2,3).filter(i->i>2);
//[3]
public PT get()
public ST secondaryGet()
secondaryGet
in interface Xor<ST,PT>
public java.util.Optional<ST> secondaryToOptional()
secondaryToOptional
in interface Xor<ST,PT>
public ReactiveSeq<ST> secondaryToStream()
secondaryToStream
in interface Xor<ST,PT>
public <LT1,RT1> Xor<LT1,RT1> flatMap(java.util.function.Function<? super PT,? extends MonadicValue2<? extends LT1,? extends RT1>> mapper)
MonadicValue2
public <LT1,RT1> Xor<LT1,RT1> secondaryFlatMap(java.util.function.Function<? super ST,? extends Xor<LT1,RT1>> mapper)
secondaryFlatMap
in interface Xor<ST,PT>
public Xor<ST,PT> secondaryToPrimayFlatMap(java.util.function.Function<? super ST,? extends Xor<ST,PT>> fn)
secondaryToPrimayFlatMap
in interface Xor<ST,PT>
public void peek(java.util.function.Consumer<? super ST> stAction, java.util.function.Consumer<? super PT> ptAction)
public <R> R visit(java.util.function.Function<? super ST,? extends R> secondary, java.util.function.Function<? super PT,? extends R> primary)
public java.util.Optional<PT> toOptional()
toOptional
in interface Xor<ST,PT>
toOptional
in interface Convertable<PT>
public Value<ST> secondaryValue()
secondaryValue
in interface Xor<ST,PT>
public java.lang.String toString()
toString
in class java.lang.Object
public <T2,R> Xor<ST,R> combine(Value<? extends T2> app, java.util.function.BiFunction<? super PT,? super T2,? extends R> fn)
ApplicativeFunctor