Class Either.Right<L,R>
java.lang.Object
com.github.darksoulq.abyssallib.common.util.Either<L,R>
com.github.darksoulq.abyssallib.common.util.Either.Right<L,R>
- Type Parameters:
L- The Left type.R- The Right type.
Represents the Right side of the
Either.-
Nested Class Summary
Nested classes/interfaces inherited from class com.github.darksoulq.abyssallib.common.util.Either
Either.Left<L,R>, Either.Right<L, R> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> TReduces the Either to a single value by applying the matching function.voidExecutes the consumer if this is a Left.voidExecutes the consumer if this is a Right.left()leftOrElse(L def) Returns the Left value if present, otherwise returns the provided default.Returns the Left value or throws an exception if this is a Right.Transforms the Left value using the provided function.Transforms the Right value using the provided function.right()rightOrElse(R def) Returns the Right value if present, otherwise returns the provided default.Returns the Right value or throws an exception if this is a Left.toString()value()
-
Constructor Details
-
Right
- Parameters:
value- The non-null value to wrap.
-
-
Method Details
-
value
- Returns:
- The wrapped value.
-
left
-
right
-
leftOrElse
Description copied from class:EitherReturns the Left value if present, otherwise returns the provided default.- Specified by:
leftOrElsein classEither<L,R> - Parameters:
def- The default value.- Returns:
- The Left value or the default.
-
rightOrElse
Description copied from class:EitherReturns the Right value if present, otherwise returns the provided default.- Specified by:
rightOrElsein classEither<L,R> - Parameters:
def- The default value.- Returns:
- The Right value or the default.
-
leftOrThrow
Description copied from class:EitherReturns the Left value or throws an exception if this is a Right.- Specified by:
leftOrThrowin classEither<L,R> - Returns:
- The Left value.
-
rightOrThrow
Description copied from class:EitherReturns the Right value or throws an exception if this is a Left.- Specified by:
rightOrThrowin classEither<L,R> - Returns:
- The Right value.
-
mapLeft
Description copied from class:EitherTransforms the Left value using the provided function. -
mapRight
Description copied from class:EitherTransforms the Right value using the provided function. -
ifLeft
Description copied from class:EitherExecutes the consumer if this is a Left. -
ifRight
Description copied from class:EitherExecutes the consumer if this is a Right. -
fold
Description copied from class:EitherReduces the Either to a single value by applying the matching function. -
toString
-