java.lang.Object
java.lang.Record
info.jab.util.either.Left<L,R>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.<T> T
Applies either the leftMapper function to the value if this is a Left, or the rightMapper function if this is a Right.get()
Returns the value if this is a Right, otherwise throws an exception.final int
hashCode()
Returns a hash code value for this object.boolean
isLeft()
Checks if this is an instance of Left.boolean
isRight()
Checks if this is an instance of Right.final String
toString()
Returns a string representation of this record class.value()
Returns the value of thevalue
record component.
-
Constructor Details
-
Left
Constructs a newLeft
with the given value.- Parameters:
value
- the value to be contained in thisLeft
- Throws:
NullPointerException
- ifvalue
isnull
-
-
Method Details
-
fold
-
isLeft
-
isRight
-
get
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
value
-