Class Either.Left<L,R>
java.lang.Object
com.github.darksoulq.abyssallib.common.util.Either<L,R>
com.github.darksoulq.abyssallib.common.util.Either.Left<L,R>
- Type Parameters:
L- The Left type.R- The Right type.
-
Nested Class Summary
Nested classes/interfaces inherited from class 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
-
Left
- Parameters:
value- The non-null value to wrap.
-
-
Method Details
-
value
- Returns:
- The wrapped value.
-
left
-
right
-
leftOrElse
-
rightOrElse
-
leftOrThrow
-
rightOrThrow
-
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
-
ifRight
-
fold
Description copied from class:EitherReduces the Either to a single value by applying the matching function. -
toString
-