Package io.vavr.control
Class Either.Right<L,R>
- java.lang.Object
-
- io.vavr.control.Either.Right<L,R>
-
- Type Parameters:
L
- left component typeR
- right component type
public static final class Either.Right<L,R> extends java.lang.Object implements Either<L,R>, java.io.Serializable
TheRight
version of anEither
.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.vavr.control.Either
Either.Left<L,R>, Either.LeftProjection<L,R>, Either.Right<L,R>, Either.RightProjection<L,R>
-
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
private R
value
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
Clarifies that values have a proper equals() method implemented.R
get()
Gets the right value if this is aRight
or throws if this is aLeft
.L
getLeft()
Returns the left value.int
hashCode()
Clarifies that values have a proper hashCode() method implemented.boolean
isLeft()
Returns whether this Either is a Left.boolean
isRight()
Returns whether this Either is a Right.java.lang.String
stringPrefix()
Returns the name of this Value type, which is used by toString().java.lang.String
toString()
Clarifies that values have a proper toString() method implemented.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.vavr.control.Either
bimap, filter, filterOrElse, flatMap, fold, getOrElseGet, getOrElseThrow, isAsync, isEmpty, isLazy, isSingleValued, iterator, left, map, mapLeft, orElse, orElse, orElseRun, peek, peekLeft, right, swap, toValidation
-
Methods inherited from interface io.vavr.Value
collect, collect, contains, corresponds, eq, exists, forAll, forEach, getOrElse, getOrElse, getOrElseThrow, getOrElseTry, getOrNull, 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
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
value
private final R value
-
-
Constructor Detail
-
Right
private Right(R value)
Constructs aRight
.- Parameters:
value
- a right value
-
-
Method Detail
-
get
public R get()
Description copied from interface:Either
Gets the right value if this is aRight
or throws if this is aLeft
.
-
isLeft
public boolean isLeft()
Description copied from interface:Either
Returns whether this Either is a Left.
-
isRight
public boolean isRight()
Description copied from interface:Either
Returns whether this Either is a Right.
-
equals
public boolean equals(java.lang.Object obj)
Description copied from interface:Value
Clarifies that values have a proper equals() method implemented.
-
hashCode
public int hashCode()
Description copied from interface:Value
Clarifies that values have a proper hashCode() method implemented.See Object.hashCode().
-
stringPrefix
public java.lang.String stringPrefix()
Description copied from interface:Value
Returns the name of this Value type, which is used by toString().- Specified by:
stringPrefix
in interfaceValue<L>
- Returns:
- This type name.
-
toString
public java.lang.String toString()
Description copied from interface:Value
Clarifies that values have a proper toString() method implemented.See Object.toString().
-
-