Class Either.RightProjection
java.lang.Object
Either<L,R>.io.atlassian.fugue.Either.AbstractProjection<R,L>
io.atlassian.fugue.Either.RightProjection
- All Implemented Interfaces:
Effect.Applicant<R>, Either.Projection<R,L, L, R>, Maybe<R>, Iterable<R>
public final class Either.RightProjection
extends Either<L,R>.AbstractProjection<R,L>
implements Either.Projection<R,L,L,R>
A right projection of an either value.
- Since:
- 1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionFunction application on this projection's value.Deprecated.since 3.0 see apas()Coerces our left type as X.ReturnsNoneif this projection has no value or if the given predicatepdoes not hold for the value, otherwise, returns a right inSome.filterOrElse(Predicate<? super R> p, Supplier<? extends L> orElseSupplier) Return aRightif this is aRightand the contained values satisfies the given predicate.Binds the given function across this projection's value if it has one.get()Get the value if defined.booleanIf the type contains a value return true.Map the given function across this projection's value if it has one.The value of this projection or the result of the given function on the opposing projection's value.Anonymous bind through this projection.(package private) <X> Either.Left<L, X> toLeft()Methods inherited from class Either.AbstractProjection
contains, either, exists, forall, foreach, forEach, getOr, getOrElse, getOrElse, getOrError, getOrNull, getOrThrow, isEmpty, iterator, toOption, toOptional, toStreamMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Effect.Applicant
foreachMethods inherited from interface Either.Projection
either, toOption, toOptional, toStreamMethods inherited from interface Iterable
forEach, spliterator
-
Constructor Details
-
RightProjection
private RightProjection()
-
-
Method Details
-
get
-
isDefined
-
on
Description copied from interface:Either.ProjectionThe value of this projection or the result of the given function on the opposing projection's value. -
map
-
flatMap
Binds the given function across this projection's value if it has one.- Type Parameters:
X- the RHS typeLL- The existing LHS or a subtype- Parameters:
f- The function to bind across this projection.- Returns:
- A new either value after binding.
-
toLeft
-
sequence
-
filter
ReturnsNoneif this projection has no value or if the given predicatepdoes not hold for the value, otherwise, returns a right inSome.- Type Parameters:
X- the LHS type- Parameters:
f- The predicate function to test on this projection's value.- Returns:
Noneif this projection has no value or if the given predicatepdoes not hold for the value, otherwise, returns a right inSome.
-
filterOrElse
Return aRightif this is aRightand the contained values satisfies the given predicate. If this is aRightbut the predicate is not satisfied, return aLeftwith the value provided by the orElseSupplier. Return aLeftif this aLeftwith the contained value.- Parameters:
p- The predicate function to test on the right contained value.orElseSupplier- The supplier to execute when is a right, and predicate is unsatisfied- Returns:
- a new Either that will be either the existing left/right or a left with result of orElseSupplier
- Since:
- 4.7.0
-
ap
-
apply
Deprecated.since 3.0 see apFunction application on this projection's value.- Type Parameters:
X- the RHS type- Parameters:
either- The either of the function to apply on this projection's value.- Returns:
- The result of function application within either.
-
as
-