public static class Ior.Secondary<ST,PT> extends java.lang.Object implements Ior<ST,PT>
Ior.Both<ST,PT>, Ior.Primary<ST,PT>, Ior.Secondary<ST,PT>
ApplicativeFunctor.Applicatives, ApplicativeFunctor.ApplyFunctions<T>
Value.ValueImpl<T>
Convertable.SupplierToConvertable<T>
Constructor and Description |
---|
Secondary() |
Modifier and Type | Method and Description |
---|---|
<R1,R2> Ior<R1,R2> |
bimap(java.util.function.Function<? super ST,? extends R1> fn1,
java.util.function.Function<? super PT,? extends R2> fn2)
Transform this BiFunctor, changing two value types at once.
|
Ior<ST,PT> |
bipeek(java.util.function.Consumer<? super ST> stAction,
java.util.function.Consumer<? super PT> ptAction)
Peek at two data types simulatanously (typically to perform a side-effect with each data point)
|
java.util.Optional<org.jooq.lambda.tuple.Tuple2<ST,PT>> |
both() |
<T2,R> Ior<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
|
Ior<ST,PT> |
filter(java.util.function.Predicate<? super PT> test)
Keep only elements for which the supplied predicates hold
e.g.
|
<LT1,RT1> Ior<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 |
isBoth() |
boolean |
isPrimary() |
boolean |
isSecondary() |
<R> Ior<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>> fn1,
java.util.function.Function<Matchable.CheckValue1<PT,R>,Matchable.CheckValue1<PT,R>> fn2,
java.util.function.Function<Matchable.CheckValue2<ST,PT,R>,Matchable.CheckValue2<ST,PT,R>> fn3,
java.util.function.Supplier<? extends R> otherwise) |
java.lang.String |
mkString()
Returns the class name and the name of the subclass, if there is any value, the value is showed between square brackets.
|
Ior<ST,PT> |
peek(java.util.function.Consumer<? super PT> action)
Peek at the current value of this Functor, without transforming it
|
<LT1,RT1> Ior<LT1,RT1> |
secondaryFlatMap(java.util.function.Function<? super ST,? extends Ior<LT1,RT1>> mapper) |
ST |
secondaryGet() |
<R> Ior<R,PT> |
secondaryMap(java.util.function.Function<? super ST,? extends R> fn) |
Ior<ST,PT> |
secondaryPeek(java.util.function.Consumer<? super ST> action) |
java.util.Optional<ST> |
secondaryToOptional() |
Ior<ST,PT> |
secondaryToPrimayFlatMap(java.util.function.Function<? super ST,? extends Ior<ST,PT>> fn) |
Ior<ST,PT> |
secondaryToPrimayMap(java.util.function.Function<? super ST,? extends PT> fn) |
ReactiveSeq<ST> |
secondaryToStream() |
Value<ST> |
secondaryValue() |
Ior<PT,ST> |
swap() |
Maybe<PT> |
toMaybe()
Returns a function result or a supplier result.
|
java.util.Optional<PT> |
toOptional() |
java.lang.String |
toString() |
Xor<ST,PT> |
toXor() |
Xor<ST,PT> |
toXorDropPrimary() |
ListX<ST> |
unapply() |
<R> R |
visit(java.util.function.Function<? super ST,? extends R> secondary,
java.util.function.Function<? super PT,? extends R> primary,
java.util.function.BiFunction<? super ST,? super PT,? extends R> both) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
accumulatePrimary, accumulatePrimary, accumulatePrimary, accumulateSecondary, accumulateSecondary, accumulateSecondary, anyM, bicast, bitrampoline, both, both, bothValue, cast, coflatMap, combineEager, filterNot, flatMapIterable, flatMapPublisher, fromIterable, fromPublisher, isPresent, nest, notNull, ofType, patternMatch, primary, secondary, sequencePrimary, sequenceSecondary, toIor, 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 Ior<ST,PT>
public Xor<ST,PT> toXorDropPrimary()
toXorDropPrimary
in interface Ior<ST,PT>
public Ior<ST,PT> secondaryToPrimayMap(java.util.function.Function<? super ST,? extends PT> fn)
secondaryToPrimayMap
in interface Ior<ST,PT>
public <R> Ior<R,PT> secondaryMap(java.util.function.Function<? super ST,? extends R> fn)
secondaryMap
in interface Ior<ST,PT>
public <R> Ior<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 Ior<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 Ior<ST,PT> secondaryPeek(java.util.function.Consumer<? super ST> action)
secondaryPeek
in interface Ior<ST,PT>
public Ior<ST,PT> peek(java.util.function.Consumer<? super PT> action)
Functor
of(1,2,3).map(System.out::println)
1
2
3
public Ior<ST,PT> filter(java.util.function.Predicate<? super PT> test)
Filterable
of(1,2,3).filter(i->i>2);
//[3]
public <R1,R2> Ior<R1,R2> bimap(java.util.function.Function<? super ST,? extends R1> fn1, java.util.function.Function<? super PT,? extends R2> fn2)
BiFunctor
MapX<String,Integer> map = MapXs.of("hello",2);
MapX<String,Integer> transformedMap = map.bimap(s->s+" world",i->i*4);
//["hello world",8]
public PT get()
public ST secondaryGet()
secondaryGet
in interface Ior<ST,PT>
public java.util.Optional<ST> secondaryToOptional()
secondaryToOptional
in interface Ior<ST,PT>
public ReactiveSeq<ST> secondaryToStream()
secondaryToStream
in interface Ior<ST,PT>
public <LT1,RT1> Ior<LT1,RT1> flatMap(java.util.function.Function<? super PT,? extends MonadicValue2<? extends LT1,? extends RT1>> mapper)
MonadicValue2
public <LT1,RT1> Ior<LT1,RT1> secondaryFlatMap(java.util.function.Function<? super ST,? extends Ior<LT1,RT1>> mapper)
secondaryFlatMap
in interface Ior<ST,PT>
public Ior<ST,PT> secondaryToPrimayFlatMap(java.util.function.Function<? super ST,? extends Ior<ST,PT>> fn)
secondaryToPrimayFlatMap
in interface Ior<ST,PT>
public Ior<ST,PT> bipeek(java.util.function.Consumer<? super ST> stAction, java.util.function.Consumer<? super PT> ptAction)
BiFunctor
MapX<String,Integer> map = MapXs.of("hello",2);
map.bipeek(s->System.out.pritnln("key = " + s),System.out::println);
public Value<ST> secondaryValue()
secondaryValue
in interface Ior<ST,PT>
public <R> R visit(java.util.function.Function<? super ST,? extends R> secondary, java.util.function.Function<? super PT,? extends R> primary, java.util.function.BiFunction<? super ST,? super PT,? extends R> both)
public Maybe<PT> toMaybe()
Value
public java.util.Optional<PT> toOptional()
toOptional
in interface Convertable<PT>
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String mkString()
Value
public <R> Eval<R> matches(java.util.function.Function<Matchable.CheckValue1<ST,R>,Matchable.CheckValue1<ST,R>> fn1, java.util.function.Function<Matchable.CheckValue1<PT,R>,Matchable.CheckValue1<PT,R>> fn2, java.util.function.Function<Matchable.CheckValue2<ST,PT,R>,Matchable.CheckValue2<ST,PT,R>> fn3, java.util.function.Supplier<? extends R> otherwise)
public <T2,R> Ior<ST,R> combine(Value<? extends T2> app, java.util.function.BiFunction<? super PT,? super T2,? extends R> fn)
ApplicativeFunctor
combine
in interface ApplicativeFunctor<PT>
app
- Value to combine with this one.fn
- BiFunction to combine them