Modifier and Type | Method and Description |
---|---|
<L2,R2> Either.RightProjection<L2,R2> |
bimap(Function<? super L,? extends L2> leftMapper,
Function<? super R,? extends R2> rightMapper) |
boolean |
equals(Object obj)
Clarifies that values have a proper equals() method implemented.
|
Option<Either.RightProjection<L,R>> |
filter(Predicate<? super R> predicate)
Returns
Some value of type R if this is a right projection of a Right value and the predicate
applies to the underlying value. |
<U> Either.RightProjection<L,U> |
flatMap(Function<? super R,? extends Either.RightProjection<L,? extends U>> mapper)
FlatMaps this RightProjection.
|
R |
get()
Gets the Right value or throws.
|
R |
getOrElse(R other)
Gets the Right value or an alternate value, if the projected Either is a Left.
|
R |
getOrElseGet(Function<? super L,? extends R> other)
Gets the Right value or an alternate value, if the projected Either is a Left.
|
<X extends Throwable> |
getOrElseThrow(Function<? super L,X> exceptionFunction)
Gets the Right value or throws, if the projected Either is a Left.
|
int |
hashCode()
Clarifies that values have a proper hashCode() method implemented.
|
boolean |
isEmpty()
Checks, this
Value is empty, i.e. |
boolean |
isSingleValued()
A
RightProjection is single-valued. |
Iterator<R> |
iterator()
Returns a rich
javaslang.collection.Iterator . |
<U> Either.RightProjection<L,U> |
map(Function<? super R,? extends U> mapper)
Maps the right value if the projected Either is a Right.
|
Either.RightProjection<L,R> |
orElse(Either.RightProjection<? extends L,? extends R> other) |
Either.RightProjection<L,R> |
orElse(Supplier<? extends Either.RightProjection<? extends L,? extends R>> supplier) |
void |
orElseRun(Consumer<? super L> action)
Runs an action in the case this is a projection on a Left value.
|
Either.RightProjection<L,R> |
peek(Consumer<? super R> action)
Applies the given action to the value if the projected either is a Right.
|
String |
stringPrefix()
Returns the name of this Value type, which is used by toString().
|
Either<L,R> |
toEither()
Returns the underlying either of this projection.
|
String |
toString()
Clarifies that values have a proper toString() method implemented.
|
<U> U |
transform(Function<? super Either.RightProjection<L,R>,? extends U> f)
Transforms this
RightProjection . |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
contains, corresponds, eq, exists, forAll, forEach, getOption, getOrElse, getOrElseThrow, getOrElseTry, narrow, out, out, stderr, stdout, toArray, toCharSeq, toJavaArray, toJavaArray, toJavaCollection, toJavaList, toJavaList, toJavaMap, toJavaMap, toJavaOptional, toJavaSet, toJavaSet, toJavaStream, toLeft, toLeft, toList, toMap, toOption, toQueue, toRight, toRight, toSet, toStack, toStream, toTree, toTry, toTry, toVector
spliterator
public <L2,R2> Either.RightProjection<L2,R2> bimap(Function<? super L,? extends L2> leftMapper, Function<? super R,? extends R2> rightMapper)
public boolean isEmpty()
Value
Value
is empty, i.e. if the underlying value is absent.public boolean isSingleValued()
RightProjection
is single-valued.isSingleValued
in interface Value<R>
true
public R get()
get
in interface Value<R>
NoSuchElementException
- if the underlying either of this RightProjection is a Leftpublic Either.RightProjection<L,R> orElse(Either.RightProjection<? extends L,? extends R> other)
public Either.RightProjection<L,R> orElse(Supplier<? extends Either.RightProjection<? extends L,? extends R>> supplier)
public R getOrElse(R other)
getOrElse
in interface Value<R>
other
- an alternative valueother
NoSuchElementException
- if the underlying either of this RightProjection is a Leftpublic R getOrElseGet(Function<? super L,? extends R> other)
other
- a function which converts a Left value to an alternative Right valueother
by applying the Left value.public void orElseRun(Consumer<? super L> action)
action
- an action which consumes a Left valuepublic <X extends Throwable> R getOrElseThrow(Function<? super L,X> exceptionFunction) throws X extends Throwable
X
- a throwable typeexceptionFunction
- a function which creates an exception based on a Left valueexceptionFunction
by applying the Left value.X
- if the projected Either is a LeftX extends Throwable
public Either<L,R> toEither()
public Option<Either.RightProjection<L,R>> filter(Predicate<? super R> predicate)
Some
value of type R if this is a right projection of a Right value and the predicate
applies to the underlying value.predicate
- A predicatepublic <U> Either.RightProjection<L,U> flatMap(Function<? super R,? extends Either.RightProjection<L,? extends U>> mapper)
U
- Component type of the mapped right valuemapper
- A mapperRightProjection<L, U>
if a Left is underlying, otherwise a the mapping result of the right value.NullPointerException
- if mapper
is nullpublic <U> Either.RightProjection<L,U> map(Function<? super R,? extends U> mapper)
public Either.RightProjection<L,R> peek(Consumer<? super R> action)
public <U> U transform(Function<? super Either.RightProjection<L,R>,? extends U> f)
RightProjection
.U
- Type of transformation resultf
- A transformationU
NullPointerException
- if f
is nullpublic Iterator<R> iterator()
Value
javaslang.collection.Iterator
.public boolean equals(Object obj)
Value
public int hashCode()
Value
See Object.hashCode().
public String stringPrefix()
Value
stringPrefix
in interface Value<R>
Copyright © 2017. All Rights Reserved.