Package com.github.tonivade.purefun.type
Record Class Either.Left<L,R>
java.lang.Object
java.lang.Record
com.github.tonivade.purefun.type.Either.Left<L,R>
- All Implemented Interfaces:
Applicable<Either<L,,?>, R> Bindable<Either<L,,?>, R> Mappable<Either<L,,?>, R> Kind<Either<L,,?>, R> Either<L,,R> EitherOf<L,,R> Serializable
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.github.tonivade.purefun.core.Applicable
Applicable.Map2<F extends Applicable<F,?>, A, B>, Applicable.Map3<F extends Applicable<F, ?>, A, B, C>, Applicable.Map4<F extends Applicable<F, ?>, A, B, C, D>, Applicable.Map5<F extends Applicable<F, ?>, A, B, C, D, E> Nested classes/interfaces inherited from interface com.github.tonivade.purefun.type.Either
Either.Left<L,R>, Either.Right<L, R> -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.getLeft()Returns the left value if available.getRight()Returns the right value if available.final inthashCode()Returns a hash code value for this object.booleanisLeft()booleanisRight()toString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.github.tonivade.purefun.core.Applicable
zip, zipLeft, zipRight, zipWith
-
Field Details
-
value
The field for thevaluerecord component.
-
-
Constructor Details
-
Left
Creates an instance of aLeftrecord class.- Parameters:
value- the value for thevaluerecord component
-
-
Method Details
-
isLeft
public boolean isLeft() -
isRight
public boolean isRight() -
getLeft
Description copied from interface:EitherReturns the left value if available. If not, it throwsNoSuchElementException -
getRight
Description copied from interface:EitherReturns the right value if available. If not, it throwsNoSuchElementException -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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
Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-