Package io.atlassian.fugue
Class Either.Right<L,R>
- java.lang.Object
-
- io.atlassian.fugue.Either<L,R>
-
- io.atlassian.fugue.Either.Right<L,R>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.atlassian.fugue.Either
Either.AbstractProjection<A,B>, Either.Left<L,R>, Either.LeftProjection, Either.Projection<A,B,L,R>, Either.Right<L,R>, Either.RightProjection
-
-
Field Summary
Fields Modifier and Type Field Description private static longserialVersionUIDprivate Rvalue
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <LL,RR>
Either<LL,RR>bimap(java.util.function.Function<? super L,? extends LL> ifLeft, java.util.function.Function<? super R,? extends RR> ifRight)Map the given functions across the appropriate side.booleanequals(java.lang.Object o)<V> Vfold(java.util.function.Function<? super L,V> ifLeft, java.util.function.Function<? super R,V> ifRight)Applies the function to the wrapped value, applying ifLeft if this is a Left and ifRight if this is a Right.(package private) RgetRight()inthashCode()booleanisLeft()Returnstrueif this either is a left,falseotherwise.booleanisRight()Returnstrueif this either is a right,falseotherwise.Either<R,L>swap()If this is a left, then return the left value in right, or vice versa.java.lang.StringtoString()-
Methods inherited from class io.atlassian.fugue.Either
ap, apply, contains, exists, filter, filterOrElse, flatMap, forall, foreach, forEach, getLeft, getOr, getOrElse, getOrElse, getOrError, getOrNull, getOrThrow, left, left, leftMap, leftOr, map, orElse, orElse, right, right, rightOr, sequence, toOption, toOptional, toStream, valueOr
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
value
private final R value
-
-
Constructor Detail
-
Right
public Right(R value)
-
-
Method Detail
-
isRight
public boolean isRight()
Description copied from class:EitherReturnstrueif this either is a right,falseotherwise.
-
isLeft
public boolean isLeft()
Description copied from class:EitherReturnstrueif this either is a left,falseotherwise.
-
swap
public Either<R,L> swap()
Description copied from class:EitherIf this is a left, then return the left value in right, or vice versa.
-
fold
public <V> V fold(java.util.function.Function<? super L,V> ifLeft, java.util.function.Function<? super R,V> ifRight)
Description copied from class:EitherApplies the function to the wrapped value, applying ifLeft if this is a Left and ifRight if this is a Right.
-
bimap
public <LL,RR> Either<LL,RR> bimap(java.util.function.Function<? super L,? extends LL> ifLeft, java.util.function.Function<? super R,? extends RR> ifRight)
Description copied from class:EitherMap the given functions across the appropriate side.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-