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
TheRightversion 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 longserialVersionUIDprivate Rvalue
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)Clarifies that values have a proper equals() method implemented.Rget()Gets the right value if this is aRightor throws if this is aLeft.LgetLeft()Returns the left value.inthashCode()Clarifies that values have a proper hashCode() method implemented.booleanisLeft()Returns whether this Either is a Left.booleanisRight()Returns whether this Either is a Right.java.lang.StringstringPrefix()Returns the name of this Value type, which is used by toString().java.lang.StringtoString()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:EitherGets the right value if this is aRightor throws if this is aLeft.
-
isLeft
public boolean isLeft()
Description copied from interface:EitherReturns whether this Either is a Left.
-
isRight
public boolean isRight()
Description copied from interface:EitherReturns whether this Either is a Right.
-
equals
public boolean equals(java.lang.Object obj)
Description copied from interface:ValueClarifies that values have a proper equals() method implemented.
-
hashCode
public int hashCode()
Description copied from interface:ValueClarifies that values have a proper hashCode() method implemented.See Object.hashCode().
-
stringPrefix
public java.lang.String stringPrefix()
Description copied from interface:ValueReturns the name of this Value type, which is used by toString().- Specified by:
stringPrefixin interfaceValue<L>- Returns:
- This type name.
-
toString
public java.lang.String toString()
Description copied from interface:ValueClarifies that values have a proper toString() method implemented.See Object.toString().
-
-