L
- The type of the Left value of an Either.R
- The type of the Right value of an Either.Either.swap()
instead of projections.@Deprecated public static final class Either.RightProjection<L,R> extends java.lang.Object implements Value<R>
Modifier and Type | Method and Description |
---|---|
<L2,R2> Either.RightProjection<L2,R2> |
bimap(java.util.function.Function<? super L,? extends L2> leftMapper,
java.util.function.Function<? super R,? extends R2> rightMapper)
Deprecated.
|
boolean |
equals(java.lang.Object obj)
Deprecated.
Clarifies that values have a proper equals() method implemented.
|
Option<Either.RightProjection<L,R>> |
filter(java.util.function.Predicate<? super R> predicate)
Deprecated.
Returns
Some value of type R if this is a right projection of a Right value and the predicate
applies to the underlying value. |
<U> Either.RightProjection<L,U> |
flatMap(java.util.function.Function<? super R,? extends Either.RightProjection<L,? extends U>> mapper)
Deprecated.
FlatMaps this RightProjection.
|
R |
get()
Deprecated.
Gets the
Right value or throws. |
R |
getOrElse(R other)
Deprecated.
Gets the Right value or an alternate value, if the projected Either is a Left.
|
R |
getOrElseGet(java.util.function.Function<? super L,? extends R> other)
Deprecated.
Gets the Right value or an alternate value, if the projected Either is a Left.
|
<X extends java.lang.Throwable> |
getOrElseThrow(java.util.function.Function<? super L,X> exceptionFunction)
Deprecated.
Gets the Right value or throws, if the projected Either is a Left.
|
int |
hashCode()
Deprecated.
Clarifies that values have a proper hashCode() method implemented.
|
boolean |
isAsync()
Deprecated.
A
RightProjection 's value is computed synchronously. |
boolean |
isEmpty()
Deprecated.
Checks, this
Value is empty, i.e. |
boolean |
isLazy()
Deprecated.
A
RightProjection 's value is computed eagerly. |
boolean |
isSingleValued()
Deprecated.
A
RightProjection is single-valued. |
Iterator<R> |
iterator()
Deprecated.
Returns a rich
io.vavr.collection.Iterator . |
<U> Either.RightProjection<L,U> |
map(java.util.function.Function<? super R,? extends U> mapper)
Deprecated.
Maps the right value if the projected Either is a Right.
|
Either.RightProjection<L,R> |
orElse(Either.RightProjection<? extends L,? extends R> other)
Deprecated.
|
Either.RightProjection<L,R> |
orElse(java.util.function.Supplier<? extends Either.RightProjection<? extends L,? extends R>> supplier)
Deprecated.
|
void |
orElseRun(java.util.function.Consumer<? super L> action)
Deprecated.
Runs an action in the case this is a projection on a Left value.
|
Either.RightProjection<L,R> |
peek(java.util.function.Consumer<? super R> action)
Deprecated.
Applies the given action to the value if the projected either is a Right.
|
java.lang.String |
stringPrefix()
Deprecated.
Returns the name of this Value type, which is used by toString().
|
Either<L,R> |
toEither()
Deprecated.
Returns the underlying either of this projection.
|
java.lang.String |
toString()
Deprecated.
Clarifies that values have a proper toString() method implemented.
|
<U> U |
transform(java.util.function.Function<? super Either.RightProjection<L,R>,? extends U> f)
Deprecated.
Transforms this
RightProjection . |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
collect, collect, contains, corresponds, eq, exists, forAll, forEach, getOrElse, getOrElseThrow, getOrElseTry, getOrNull, narrow, out, out, spliterator, stderr, stdout, toArray, toCharSeq, toCompletableFuture, toEither, toEither, toInvalid, toInvalid, toJavaArray, toJavaArray, toJavaArray, toJavaCollection, toJavaList, toJavaList, toJavaMap, toJavaMap, toJavaMap, toJavaOptional, toJavaParallelStream, toJavaSet, toJavaSet, toJavaStream, toLeft, toLeft, toLinkedMap, toLinkedMap, toLinkedSet, toList, toMap, toMap, toOption, toPriorityQueue, toPriorityQueue, toQueue, toRight, toRight, toSet, toSortedMap, toSortedMap, toSortedMap, toSortedMap, toSortedSet, toSortedSet, toStream, toTree, toTree, toTry, toTry, toValid, toValid, toValidation, toValidation, toVector
public <L2,R2> Either.RightProjection<L2,R2> bimap(java.util.function.Function<? super L,? extends L2> leftMapper, java.util.function.Function<? super R,? extends R2> rightMapper)
public boolean isAsync()
RightProjection
's value is computed synchronously.public boolean isEmpty()
Value
Value
is empty, i.e. if the underlying value is absent.public boolean isLazy()
RightProjection
's value is computed eagerly.public boolean isSingleValued()
RightProjection
is single-valued.isSingleValued
in interface Value<R>
true
public R get()
Right
value or throws.public Either.RightProjection<L,R> orElse(Either.RightProjection<? extends L,? extends R> other)
public Either.RightProjection<L,R> orElse(java.util.function.Supplier<? extends Either.RightProjection<? extends L,? extends R>> supplier)
public R getOrElse(R other)
public R getOrElseGet(java.util.function.Function<? super L,? extends R> other)
// prints 42
System.out.println(Either.right(42).getOrElseGet(l -> 2));
// prints 0
System.out.println(Either.left(42).getOrElseGet(l -> 0));
other
- a function which converts a Left value to an alternative Right valueother
by applying the Left value.public void orElseRun(java.util.function.Consumer<? super L> action)
// nothing is printed
Either.right(42).orElseRun(System.out::println);
// prints "error message"
Either.left("error message").orElseRun(System.out::println);
action
- an action which consumes a Left valuepublic <X extends java.lang.Throwable> R getOrElseThrow(java.util.function.Function<? super L,X> exceptionFunction) throws X extends java.lang.Throwable
// prints "42"
System.out.println(Either.<String, Integer> right(42).getOrElseThrow(s -> new RuntimeException(s)));
// throws RuntimeException("error message")
Either.left("error message").getOrElseThrow(s -> new RuntimeException(s));
X
- a throwable typeexceptionFunction
- a function which creates an exception based on a Left valueexceptionFunction
by applying the Left value.X
- if the projected Either is a LeftX extends java.lang.Throwable
public Either<L,R> toEither()
public Option<Either.RightProjection<L,R>> filter(java.util.function.Predicate<? super R> predicate)
Some
value of type R if this is a right projection of a Right value and the predicate
applies to the underlying value.predicate
- A predicatepublic <U> Either.RightProjection<L,U> flatMap(java.util.function.Function<? super R,? extends Either.RightProjection<L,? extends U>> mapper)
U
- Component type of the mapped right valuemapper
- A mapperRightProjection<L, U>
if a Left is underlying, otherwise a the mapping result of the right value.java.lang.NullPointerException
- if mapper
is nullpublic <U> Either.RightProjection<L,U> map(java.util.function.Function<? super R,? extends U> mapper)
public Either.RightProjection<L,R> peek(java.util.function.Consumer<? super R> action)
public <U> U transform(java.util.function.Function<? super Either.RightProjection<L,R>,? extends U> f)
RightProjection
.U
- Type of transformation resultf
- A transformationU
java.lang.NullPointerException
- if f
is nullpublic Iterator<R> iterator()
Value
io.vavr.collection.Iterator
.public boolean equals(java.lang.Object obj)
Value
public int hashCode()
Value
See Object.hashCode().
public java.lang.String stringPrefix()
Value
stringPrefix
in interface Value<R>
public java.lang.String toString()
Value
See Object.toString().