Package de.marcely.bedwars.tools
Interface Either<L,R> 
- Type Parameters:
- L- Left type
- R- Right type
- All Known Implementing Classes:
- Either.Left,- Either.Right
public interface Either<L,R> 
The Either type represents a value of one of two possible types (a disjoint union).
 The data constructors; Left and Right represent the two possible values.
- 
Nested Class SummaryNested ClassesModifier and TypeInterfaceDescriptionstatic classstatic class
- 
Method SummaryModifier and TypeMethodDescriptionbooleanhasLeft()Returns if something has been set to the left field.booleanhasRight()Returns if something has been set to the right field.left()Retrieve the left value.static <L,R> Either <L, R> left(L left) Creates a new Either with something set to the left value.right()Retrieve the right value.static <L,R> Either <L, R> right(R right) Creates a new Either with something set to the right value.
- 
Method Details- 
hasLeftboolean hasLeft()Returns if something has been set to the left field.hasRight()will returnfalseif this method returnstrue- Returns:
- true if this is a left value, false if this is a right value
 
- 
hasRightboolean hasRight()Returns if something has been set to the right field.hasLeft()will returnfalseif this method returnstrue- Returns:
- true if this is a right value, false if this is a left value
 
- 
leftRetrieve the left value.May return nulleven whenhasLeft()returns true. Also returnsnullif this is a right value.- Returns:
- The set left value
 
- 
rightRetrieve the right value.May return nulleven whenhasRight()returns true. Also returnsnullif this is a left value.- Returns:
- The set right value
 
- 
leftCreates a new Either with something set to the left value.- Type Parameters:
- L- The type for left
- R- The type for right
- Parameters:
- left- The value that shall be set
- Returns:
- The created Either instance
 
- 
rightCreates a new Either with something set to the right value.- Type Parameters:
- L- The type for left
- R- The type for right
- Parameters:
- right- The value that shall be set
- Returns:
- The created Either instance
 
 
-