Package com.comphenix.protocol.wrappers
Class Either<L,R>
java.lang.Object
com.comphenix.protocol.wrappers.Either<L,R>
- Type Parameters:
L- left data typeR- right data type
- Direct Known Subclasses:
Either.Left,Either.Right
Represents a datatype where either left or right is present. The values are available with a xor semantic. So at
most and at least one value will be available.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Either
public Either()
-
-
Method Details
-
map
- Type Parameters:
T- result data type of both transformers- Parameters:
leftConsumer- transformer if the left value is presentrightConsumer- transformer if the right value is present- Returns:
- result of applying the given functions to the left or right side
-
left
- Returns:
- left value if present
-
right
- Returns:
- right value if present
-
left
- Type Parameters:
L- data type of the containing valueR- right data type- Parameters:
value- containing value- Returns:
- either containing a left value
-
right
- Type Parameters:
L- left data typeR- data type of the containing value- Parameters:
value- containing value- Returns:
- either containing a right value
-