L - The type for the Left side (not used for this class)R - The type for the Right sidepublic final class Right<L,R> extends Object implements Either<L,R>, Serializable
| Constructor and Description |
|---|
Right(R value)
Creates an instance wrapping the provide value.
|
| Modifier and Type | Method and Description |
|---|---|
<T> T |
fold(java.util.function.Function<L,T> func_left,
java.util.function.Function<R,T> func_right)
Applies the provided
func_right to the wrapped value and returns the result. |
boolean |
isRight()
Always returns
true. |
Either<R,L> |
swap()
Returns a
Left containing the value for this instance. |
String |
toString() |
public Right(R value)
value - The value wrapped by this instancepublic <T> T fold(java.util.function.Function<L,T> func_left, java.util.function.Function<R,T> func_right)
func_right to the wrapped value and returns the result.fold in interface Either<L,R>T - The type to return from func_left/func_rightfunc_left - The function to apply in case this is a Leftfunc_right - The function to apply in case this is a Rightpublic boolean isRight()
true.Copyright © 2015. All rights reserved.