public static class LazyEither3.Left2<ST,M,PT> extends java.lang.Object implements LazyEither3<ST,M,PT>
LazyEither3.CompletableEither3<ORG,LT1,RT>, LazyEither3.Lazy<ST,M,PT>, LazyEither3.Left1<ST,M,PT>, LazyEither3.Left2<ST,M,PT>, LazyEither3.Right<ST,M,PT>
Constructor and Description |
---|
Left2() |
Modifier and Type | Method and Description |
---|---|
<R1,R2> LazyEither3<ST,R1,R2> |
bimap(java.util.function.Function<? super M,? extends R1> fn1,
java.util.function.Function<? super PT,? extends R2> fn2)
Transform this BiTransformable, changing two value types at once.
|
boolean |
equals(java.lang.Object obj) |
Maybe<PT> |
filter(java.util.function.Predicate<? super PT> test)
Filter this Either3 resulting in a Maybe#none if it is not a Right instance or if the predicate does not
hold.
|
<RT1> LazyEither3<ST,M,RT1> |
flatMap(java.util.function.Function<? super PT,? extends LazyEither3<ST,M,? extends RT1>> mapper)
Flattening transformation on this Either3.
|
<R> R |
fold(java.util.function.Function<? super PT,? extends R> present,
java.util.function.Supplier<? extends R> absent) |
<R> R |
fold(java.util.function.Function<? super ST,? extends R> secondary,
java.util.function.Function<? super M,? extends R> mid,
java.util.function.Function<? super PT,? extends R> primary)
Visit the types in this Either3, only one user supplied function is executed depending on the type
|
Option<PT> |
get() |
int |
hashCode() |
boolean |
isLeft1() |
boolean |
isLeft2() |
boolean |
isRight() |
java.util.Iterator<PT> |
iterator() |
<R> LazyEither3<ST,M,R> |
map(java.util.function.Function<? super PT,? extends R> fn)
Transform this functor using the supplied transformation function
|
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.
|
LazyEither3<ST,M,PT> |
peek(java.util.function.Consumer<? super PT> action)
Peek at the current value of this Transformable, without transforming it
|
ReactiveSeq<PT> |
stream() |
void |
subscribe(org.reactivestreams.Subscriber<? super PT> s) |
LazyEither3<PT,M,ST> |
swap1() |
LazyEither3<ST,PT,M> |
swap2() |
java.lang.String |
toString() |
<T> LazyEither3<ST,M,T> |
unit(T unit) |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
accumulate, always, applyAny, bipeek, coflatMap, consumeAny, either3, filter, filterNot, foldAny, forEach2, forEach3, forEach4, fromFuture, fromIterable, fromLazy, fromPublisher, later, left1, left1Eval, left2, left2Eval, narrowK, narrowK3, nest, notNull, ofType, right, rightEval, sequence, sequence, toEither, toIor, toTrampoline, traverse, traverse, visitAny, visitAny, widen, zip, zip
orElseUse, orElseUse
asSupplier, collect, fold, forEach, generate, isPresent, iterate, nonEmptyList, nonEmptyListGet, orElse, orElseGet, print, print, printErr, printOut, toEither, toLazyEither, toLeft, toMaybe, toOption, toOptional, toRight, toTry, toTry, toTry
public <R> LazyEither3<ST,M,R> map(java.util.function.Function<? super PT,? extends R> fn)
Transformable
of(1,2,3).map(i->i*2)
//[2,4,6]
map
in interface Transformable<PT>
map
in interface LazyEither3<ST,M,PT>
fn
- Transformation functionpublic LazyEither3<ST,M,PT> peek(java.util.function.Consumer<? super PT> action)
Transformable
of(1,2,3).map(System.out::println)
1
2
3
peek
in interface Transformable<PT>
peek
in interface LazyEither3<ST,M,PT>
action
- Consumer that recieves each element from this Transformablepublic Maybe<PT> filter(java.util.function.Predicate<? super PT> test)
LazyEither3
public <RT1> LazyEither3<ST,M,RT1> flatMap(java.util.function.Function<? super PT,? extends LazyEither3<ST,M,? extends RT1>> mapper)
LazyEither3
flatMap
in interface LazyEither3<ST,M,PT>
mapper
- Mapping functionpublic boolean isRight()
isRight
in interface LazyEither3<ST,M,PT>
public boolean isLeft1()
isLeft1
in interface LazyEither3<ST,M,PT>
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String mkString()
Value
public <R> R fold(java.util.function.Function<? super ST,? extends R> secondary, java.util.function.Function<? super M,? extends R> mid, java.util.function.Function<? super PT,? extends R> primary)
LazyEither3
fold
in interface Sealed3<ST,M,PT>
fold
in interface LazyEither3<ST,M,PT>
secondary
- Function to execute if this Either3 is a Left instancemid
- Function to execute if this Either3 is a middle instanceprimary
- Function to execute if this Either3 is a right instancepublic <R1,R2> LazyEither3<ST,R1,R2> bimap(java.util.function.Function<? super M,? extends R1> fn1, java.util.function.Function<? super PT,? extends R2> fn2)
BiTransformable
MapX<String,Integer> map = MapXs.of("hello",2);
MapX<String,Integer> transformedMap = map.bimap(s->s+" world",i->i*4);
//["hello world",8]
bimap
in interface BiTransformable<M,PT>
bimap
in interface LazyEither3<ST,M,PT>
fn1
- transformation function for the first typefn2
- transformation function for the second typepublic ReactiveSeq<PT> stream()
public java.util.Iterator<PT> iterator()
public <R> R fold(java.util.function.Function<? super PT,? extends R> present, java.util.function.Supplier<? extends R> absent)
public void subscribe(org.reactivestreams.Subscriber<? super PT> s)
public <T> LazyEither3<ST,M,T> unit(T unit)
public LazyEither3<ST,PT,M> swap2()
swap2
in interface LazyEither3<ST,M,PT>
public LazyEither3<PT,M,ST> swap1()
swap1
in interface LazyEither3<ST,M,PT>
public boolean isLeft2()
isLeft2
in interface LazyEither3<ST,M,PT>
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object