Package io.vavr.control
Class Either.LeftProjection<L,R>
- java.lang.Object
-
- io.vavr.control.Either.LeftProjection<L,R>
-
- Type Parameters:
L
- The type of the Left value of an Either.R
- The type of the Right value of an Either.
- All Implemented Interfaces:
Value<L>
,java.lang.Iterable<L>
@Deprecated public static final class Either.LeftProjection<L,R> extends java.lang.Object implements Value<L>
Deprecated.Either is right-biased. UseEither.swap()
instead of projections.A left projection of an Either.
-
-
Constructor Summary
Constructors Modifier Constructor Description private
LeftProjection(Either<L,R> either)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description <L2,R2>
Either.LeftProjection<L2,R2>bimap(java.util.function.Function<? super L,? extends L2> leftMapper, java.util.function.Function<? super R,? extends R2> rightMapper)
Deprecated.boolean
equals(java.lang.Object obj)
Deprecated.Clarifies that values have a proper equals() method implemented.Option<Either.LeftProjection<L,R>>
filter(java.util.function.Predicate<? super L> predicate)
Deprecated.ReturnsSome
value of type L if this is a left projection of a Left value and the predicate applies to the underlying value.<U> Either.LeftProjection<U,R>
flatMap(java.util.function.Function<? super L,? extends Either.LeftProjection<? extends U,R>> mapper)
Deprecated.FlatMaps this LeftProjection.L
get()
Deprecated.Gets theLeft
value or throws.L
getOrElse(L other)
Deprecated.Gets the Left value or an alternate value, if the projected Either is a Right.L
getOrElseGet(java.util.function.Function<? super R,? extends L> other)
Deprecated.Gets the Left value or an alternate value, if the projected Either is a Right.<X extends java.lang.Throwable>
LgetOrElseThrow(java.util.function.Function<? super R,X> exceptionFunction)
Deprecated.Gets the Left value or throws, if the projected Either is a Right.int
hashCode()
Deprecated.Clarifies that values have a proper hashCode() method implemented.boolean
isAsync()
Deprecated.ALeftProjection
's value is computed synchronously.boolean
isEmpty()
Deprecated.Checks, thisValue
is empty, i.e.boolean
isLazy()
Deprecated.ALeftProjection
's value is computed eagerly.boolean
isSingleValued()
Deprecated.ALeftProjection
is single-valued.Iterator<L>
iterator()
Deprecated.Returns a richio.vavr.collection.Iterator
.<U> Either.LeftProjection<U,R>
map(java.util.function.Function<? super L,? extends U> mapper)
Deprecated.Maps the left value if the projected Either is a Left.Either.LeftProjection<L,R>
orElse(Either.LeftProjection<? extends L,? extends R> other)
Deprecated.Either.LeftProjection<L,R>
orElse(java.util.function.Supplier<? extends Either.LeftProjection<? extends L,? extends R>> supplier)
Deprecated.void
orElseRun(java.util.function.Consumer<? super R> action)
Deprecated.Runs an action in the case this is a projection on a Right value.Either.LeftProjection<L,R>
peek(java.util.function.Consumer<? super L> action)
Deprecated.Applies the given action to the value if the projected either is a Left.java.lang.String
stringPrefix()
Deprecated.Returns the name of this Value type, which is used by toString().Either<L,R>
toEither()
Deprecated.Returns the underlying either of this projection.java.lang.String
toString()
Deprecated.Clarifies that values have a proper toString() method implemented.<U> U
transform(java.util.function.Function<? super Either.LeftProjection<L,R>,? extends U> f)
Deprecated.Transforms thisLeftProjection
.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.vavr.Value
collect, collect, contains, corresponds, eq, exists, forAll, forEach, getOrElse, getOrElseThrow, getOrElseTry, getOrNull, out, out, spliterator, stderr, stdout, toArray, toCharSeq, toCompletableFuture, toEither, toEither, toInvalid, toInvalid, toJavaArray, toJavaArray, toJavaArray, toJavaCollection, toJavaList, toJavaList, toJavaMap, toJavaMap, toJavaMap, toJavaOptional, toJavaParallelStream, toJavaSet, toJavaSet, toJavaStream, toLeft, toLeft, toLinkedMap, toLinkedMap, toLinkedSet, toList, toMap, toMap, toOption, toPriorityQueue, toPriorityQueue, toQueue, toRight, toRight, toSet, toSortedMap, toSortedMap, toSortedMap, toSortedMap, toSortedSet, toSortedSet, toStream, toTree, toTree, toTry, toTry, toValid, toValid, toValidation, toValidation, toVector
-
-
-
-
Method Detail
-
bimap
public <L2,R2> Either.LeftProjection<L2,R2> bimap(java.util.function.Function<? super L,? extends L2> leftMapper, java.util.function.Function<? super R,? extends R2> rightMapper)
Deprecated.
-
isAsync
public boolean isAsync()
Deprecated.ALeftProjection
's value is computed synchronously.
-
isEmpty
public boolean isEmpty()
Deprecated.Description copied from interface:Value
Checks, thisValue
is empty, i.e. if the underlying value is absent.
-
isLazy
public boolean isLazy()
Deprecated.ALeftProjection
's value is computed eagerly.
-
isSingleValued
public boolean isSingleValued()
Deprecated.ALeftProjection
is single-valued.- Specified by:
isSingleValued
in interfaceValue<L>
- Returns:
true
-
get
public L get()
Deprecated.Gets theLeft
value or throws.
-
orElse
public Either.LeftProjection<L,R> orElse(Either.LeftProjection<? extends L,? extends R> other)
Deprecated.
-
orElse
public Either.LeftProjection<L,R> orElse(java.util.function.Supplier<? extends Either.LeftProjection<? extends L,? extends R>> supplier)
Deprecated.
-
getOrElse
public L getOrElse(L other)
Deprecated.Gets the Left value or an alternate value, if the projected Either is a Right.
-
getOrElseGet
public L getOrElseGet(java.util.function.Function<? super R,? extends L> other)
Deprecated.Gets the Left value or an alternate value, if the projected Either is a Right.- Parameters:
other
- a function which converts a Right value to an alternative Left value- Returns:
- the left value, if the underlying Either is a Left or else the alternative Left value provided by
other
by applying the Right value.
-
orElseRun
public void orElseRun(java.util.function.Consumer<? super R> action)
Deprecated.Runs an action in the case this is a projection on a Right value.- Parameters:
action
- an action which consumes a Right value
-
getOrElseThrow
public <X extends java.lang.Throwable> L getOrElseThrow(java.util.function.Function<? super R,X> exceptionFunction) throws X extends java.lang.Throwable
Deprecated.Gets the Left value or throws, if the projected Either is a Right.- Type Parameters:
X
- a throwable type- Parameters:
exceptionFunction
- a function which creates an exception based on a Right value- Returns:
- the left value, if the underlying Either is a Left or else throws the exception provided by
exceptionFunction
by applying the Right value. - Throws:
X
- if the projected Either is a RightX extends java.lang.Throwable
-
toEither
public Either<L,R> toEither()
Deprecated.Returns the underlying either of this projection.- Returns:
- the underlying either
-
filter
public Option<Either.LeftProjection<L,R>> filter(java.util.function.Predicate<? super L> predicate)
Deprecated.ReturnsSome
value of type L if this is a left projection of a Left value and the predicate applies to the underlying value.- Parameters:
predicate
- A predicate- Returns:
- A new Option
-
flatMap
public <U> Either.LeftProjection<U,R> flatMap(java.util.function.Function<? super L,? extends Either.LeftProjection<? extends U,R>> mapper)
Deprecated.FlatMaps this LeftProjection.- Type Parameters:
U
- Component type of the mapped left value- Parameters:
mapper
- A mapper- Returns:
- this as
LeftProjection<L, U>
if a Right is underlying, otherwise a the mapping result of the left value. - Throws:
java.lang.NullPointerException
- ifmapper
is null
-
map
public <U> Either.LeftProjection<U,R> map(java.util.function.Function<? super L,? extends U> mapper)
Deprecated.Maps the left value if the projected Either is a Left.
-
peek
public Either.LeftProjection<L,R> peek(java.util.function.Consumer<? super L> action)
Deprecated.Applies the given action to the value if the projected either is a Left. Otherwise nothing happens.
-
transform
public <U> U transform(java.util.function.Function<? super Either.LeftProjection<L,R>,? extends U> f)
Deprecated.Transforms thisLeftProjection
.- Type Parameters:
U
- Type of transformation result- Parameters:
f
- A transformation- Returns:
- An instance of type
U
- Throws:
java.lang.NullPointerException
- iff
is null
-
iterator
public Iterator<L> iterator()
Deprecated.Description copied from interface:Value
Returns a richio.vavr.collection.Iterator
.
-
equals
public boolean equals(java.lang.Object obj)
Deprecated.Description copied from interface:Value
Clarifies that values have a proper equals() method implemented.
-
hashCode
public int hashCode()
Deprecated.Description copied from interface:Value
Clarifies that values have a proper hashCode() method implemented.See Object.hashCode().
-
stringPrefix
public java.lang.String stringPrefix()
Deprecated.Description copied from interface:Value
Returns the name of this Value type, which is used by toString().- Specified by:
stringPrefix
in interfaceValue<L>
- Returns:
- This type name.
-
toString
public java.lang.String toString()
Deprecated.Description copied from interface:Value
Clarifies that values have a proper toString() method implemented.See Object.toString().
-
-