L
- The type for the Left
sideR
- The type for the Right
side (not used for this class)public final class Left<L,R> extends Object implements Either<L,R>, Serializable
Constructor and Description |
---|
Left(L 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_left to the wrapped value and returns the result. |
boolean |
isRight()
Always returns
false . |
Either<R,L> |
swap()
Returns a
Right containing the value for this instance. |
String |
toString()
Returns a String representation of the instance.
|
public Left(L 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_left
to the wrapped value and returns the result.fold
in interface Either<L,R>
T
- The type to return from func_left/func_right
func_left
- The function to apply in case this is a Left
func_right
- The function to apply in case this is a Right
public boolean isRight()
false
.Copyright © 2016, Peter Nerg Apache License v2.0