L
- left component typeR
- right component type@Deprecated public static final class Either.Right<L,R> extends Either<L,R> implements java.io.Serializable
Right
version of an Either
.Either.Left<L,R>, Either.LeftProjection<L,R>, Either.Right<L,R>, Either.RightProjection<L,R>
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Deprecated.
Clarifies that values have a proper equals() method implemented.
|
R |
get()
Deprecated.
Gets the right value if this is a
Right or throws if this is a Left . |
L |
getLeft()
Deprecated.
Returns the left value.
|
int |
hashCode()
Deprecated.
Clarifies that values have a proper hashCode() method implemented.
|
boolean |
isLeft()
Deprecated.
Returns whether this Either is a Left.
|
boolean |
isRight()
Deprecated.
Returns whether this Either is a Right.
|
java.lang.String |
stringPrefix()
Deprecated.
Returns the name of this Value type, which is used by toString().
|
java.lang.String |
toString()
Deprecated.
Clarifies that values have a proper toString() method implemented.
|
bimap, filter, filterNot, filterOrElse, flatMap, fold, getOrElseGet, getOrElseThrow, isAsync, isEmpty, isLazy, isSingleValued, iterator, left, left, map, mapLeft, narrow, orElse, orElse, orElseRun, peek, peek, peekLeft, recover, recoverWith, right, right, sequence, sequenceRight, swap, toValidation, transform, traverse, traverseRight
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
collect, collect, contains, corresponds, eq, exists, forAll, forEach, getOrElse, 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 R get()
Either
Right
or throws if this is a Left
.public L getLeft()
Either
// prints "error"
System.out.println(Either.left("error").getLeft());
// throws NoSuchElementException
System.out.println(Either.right(42).getLeft());
public boolean isLeft()
Either
// prints "true"
System.out.println(Either.left("error").isLeft());
// prints "false"
System.out.println(Either.right(42).isLeft());
public boolean isRight()
Either
// prints "true"
System.out.println(Either.right(42).isRight());
// prints "false"
System.out.println(Either.left("error").isRight());
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().