Top Description Inners Fields Methods
io.vavr.control

public Interface Try<T>

Additional top-level class in compilation unit: TryModule.

extends Value<T>, Serializable
Known Direct Implementers
io.vavr.control.Try.Success, io.vavr.control.Try.Failure
Type Parameters
<T>
Value type in the case of success.
Imports
io.vavr.*, io.vavr.collection.Seq, .Iterator, .Vector, java.io.Serializable, java.util.Arrays, .NoSuchElementException, .Objects, java.util.concurrent.Callable, java.util.function.Consumer, .Function, .Predicate, .Supplier

The Try control gives us the ability write safe code without focusing on try-catch blocks in the presence of exceptions.

The following exceptions are considered to be fatal/non-recoverable:

Important Note

Try may re-throw (undeclared) exceptions, e.g. on get(). From within a dynamic proxy java.lang.reflect.InvocationHandler this will lead to an java.lang.reflect.UndeclaredThrowableException. For more information, please read Dynamic Proxy Classes.

Author
Daniel Dietrich

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
Try.Failure<
component type of this Failure
T
>

A failed Try.

public static class
Try.Success<
component type of this Success
T
>

A succeeded Try.

public static class
Try.WithResources1<
Type of the 1st resource.
T1 extends AutoCloseable
>

A Try-with-resources builder that operates on one AutoCloseable resource.

public static class
Try.WithResources2<
Type of the 1st resource.
T1 extends AutoCloseable
,
Type of the 2nd resource.
T2 extends AutoCloseable
>

A Try-with-resources builder that operates on two AutoCloseable resources.

public static class
Try.WithResources3<
Type of the 1st resource.
T1 extends AutoCloseable
,
Type of the 2nd resource.
T2 extends AutoCloseable
,
Type of the 3rd resource.
T3 extends AutoCloseable
>

A Try-with-resources builder that operates on three AutoCloseable resources.

public static class
Try.WithResources4<
Type of the 1st resource.
T1 extends AutoCloseable
,
Type of the 2nd resource.
T2 extends AutoCloseable
,
Type of the 3rd resource.
T3 extends AutoCloseable
,
Type of the 4th resource.
T4 extends AutoCloseable
>

A Try-with-resources builder that operates on four AutoCloseable resources.

public static class
Try.WithResources5<
Type of the 1st resource.
T1 extends AutoCloseable
,
Type of the 2nd resource.
T2 extends AutoCloseable
,
Type of the 3rd resource.
T3 extends AutoCloseable
,
Type of the 4th resource.
T4 extends AutoCloseable
,
Type of the 5th resource.
T5 extends AutoCloseable
>

A Try-with-resources builder that operates on five AutoCloseable resources.

public static class
Try.WithResources6<
Type of the 1st resource.
T1 extends AutoCloseable
,
Type of the 2nd resource.
T2 extends AutoCloseable
,
Type of the 3rd resource.
T3 extends AutoCloseable
,
Type of the 4th resource.
T4 extends AutoCloseable
,
Type of the 5th resource.
T5 extends AutoCloseable
,
Type of the 6th resource.
T6 extends AutoCloseable
>

A Try-with-resources builder that operates on six AutoCloseable resources.

public static class
Try.WithResources7<
Type of the 1st resource.
T1 extends AutoCloseable
,
Type of the 2nd resource.
T2 extends AutoCloseable
,
Type of the 3rd resource.
T3 extends AutoCloseable
,
Type of the 4th resource.
T4 extends AutoCloseable
,
Type of the 5th resource.
T5 extends AutoCloseable
,
Type of the 6th resource.
T6 extends AutoCloseable
,
Type of the 7th resource.
T7 extends AutoCloseable
>

A Try-with-resources builder that operates on seven AutoCloseable resources.

public static class
Try.WithResources8<
Type of the 1st resource.
T1 extends AutoCloseable
,
Type of the 2nd resource.
T2 extends AutoCloseable
,
Type of the 3rd resource.
T3 extends AutoCloseable
,
Type of the 4th resource.
T4 extends AutoCloseable
,
Type of the 5th resource.
T5 extends AutoCloseable
,
Type of the 6th resource.
T6 extends AutoCloseable
,
Type of the 7th resource.
T7 extends AutoCloseable
,
Type of the 8th resource.
T8 extends AutoCloseable
>

A Try-with-resources builder that operates on eight AutoCloseable resources.

Field Summary

Modifier and TypeField and Description
public static final long

Method Summary

Modifier and TypeMethod and Description
public default Try<T>

Returns:

this Try.
andFinally
(Runnable
A runnable
runnable
)

Provides try's finally behavior no matter what the result of the operation is.

public default Try<T>

Returns:

this Try.
andFinallyTry
(CheckedRunnable
A runnable
runnable
)

Provides try's finally behavior no matter what the result of the operation is.

public default Try<T>

Returns:

this Try if this is a Failure or the consumer succeeded, otherwise the Failure of the consumption.
andThen
(Consumer<? super T>
A consumer
consumer
)

Shortcut for andThenTry(consumer::accept), see andThenTry(CheckedConsumer).

public default Try<T>

Returns:

this Try if this is a Failure or the runnable succeeded, otherwise the Failure of the run.
andThen
(Runnable
A runnable
runnable
)

Shortcut for andThenTry(runnable::run), see andThenTry(CheckedRunnable).

public default Try<T>

Returns:

this Try if this is a Failure or the consumer succeeded, otherwise the Failure of the consumption.
andThenTry
(CheckedConsumer<? super T>
A checked consumer
consumer
)

Passes the result to the given consumer if this is a Success.

public default Try<T>

Returns:

this Try if this is a Failure or the runnable succeeded, otherwise the Failure of the run.
andThenTry
(CheckedRunnable
A checked runnable
runnable
)

Runs the given runnable if this is a Success, otherwise returns this Failure.

public default <
The new value type
R
>
Try<R>

Returns:

A new Try instance containing value of type R
collect
(PartialFunction<? super T, ? extends R>
A function that is not necessarily defined on value of this try.
partialFunction
)

Collects value that is in the domain of the given partialFunction by mapping the value to type R.

public boolean
equals(Object
An object
o
)

Redeclares io.vavr.Value.equals.

Clarifies that values have a proper equals() method implemented.

public default Try<Throwable>

Returns:

a new Try
failed
()

Returns Success(throwable) if this is a Failure(throwable), otherwise a Failure(new NoSuchElementException("Success.failed()")) if this is a Success.

public static <
Component type of the Try.
T
>
Try<T>

Returns:

A new Failure.
failure
(Throwable
An exception.
exception
)

Creates a Failure that contains the given exception.

public default Try<T>

Returns:

a Try instance
filter
(Predicate<? super T>
A predicate
predicate
,
Supplier<? extends Throwable>
A supplier of a throwable
throwableSupplier
)

Shortcut for filterTry(predicate::test, throwableSupplier), see filterTry(CheckedPredicate, Supplier)}.

public default Try<T>

Returns:

a Try instance
filter
(Predicate<? super T>
A predicate
predicate
,
Function<? super T, ? extends Throwable>
A function that provides some kind of Throwable for T
errorProvider
)

Shortcut for filterTry(predicate::test, errorProvider::apply), see filterTry(CheckedPredicate, CheckedFunction1)}.

public default Try<T>

Returns:

a Try instance
filter
(Predicate<? super T>
A predicate
predicate
)

Shortcut for filterTry(predicate::test), see filterTry(CheckedPredicate)}.

public default Try<T>

Returns:

a Try instance
filterTry
(CheckedPredicate<? super T>
A checked predicate
predicate
,
Supplier<? extends Throwable>
A supplier of a throwable
throwableSupplier
)

Returns this if this is a Failure or this is a Success and the value satisfies the predicate.

public default Try<T>

Returns:

a Try instance
filterTry
(CheckedPredicate<? super T>
A checked predicate
predicate
,
CheckedFunction1<? super T, ? extends Throwable>
A provider of a throwable
errorProvider
)

Returns this if this is a Failure or this is a Success and the value satisfies the predicate.

public default Try<T>

Returns:

a Try instance
filterTry
(CheckedPredicate<? super T>
A checked predicate
predicate
)

Returns this if this is a Failure or this is a Success and the value satisfies the predicate.

public default <
The new component type
U
>
Try<U>

Returns:

a Try
flatMap
(Function<? super T, ? extends Try<? extends U>>
A mapper
mapper
)

Shortcut for flatMapTry(mapper::apply), see flatMapTry(CheckedFunction1).

public default <
The new component type
U
>
Try<U>

Returns:

a Try
flatMapTry
(CheckedFunction1<? super T, ? extends Try<? extends U>>
A mapper
mapper
)

FlatMaps the value of a Success or returns a Failure.

public default <
type of the folded value
X
>
X

Returns:

A value of type X
fold
(Function<? super Throwable, ? extends X>
maps the left value if this is a Failure
ifFail
,
Function<? super T, ? extends X>
maps the value if this is a Success
f
)

Folds either the Failure or the Success side of the Try value.

public T

Returns:

The result of this Try.
get
()

Redeclares io.vavr.Value.get.

Gets the result of this Try if this is a Success or throws if this is a Failure.

public Throwable

Returns:

The cause if this is a Failure
getCause
()

Gets the cause if this is a Failure or throws if this is a Success.

public default T
getOrElseGet(Function<? super Throwable, ? extends T> other)

public default <X extends Throwable> T
getOrElseThrow(Function<? super Throwable, X> exceptionProvider)

public int
hashCode()

Redeclares io.vavr.Value.hashCode.

Clarifies that values have a proper hashCode() method implemented.

public default boolean

Returns:

false
isAsync
()

Implements io.vavr.Value.isAsync.

A Try's value is computed synchronously.

public boolean

Returns:

true if this is a Failure, returns false if this is a Success.
isEmpty
()

Redeclares io.vavr.Value.isEmpty.

Checks whether this Try has no result, i.e. is a Failure.

public boolean

Returns:

true, if this is a Failure, otherwise false, if this is a Success
isFailure
()

Checks if this is a Failure.

public default boolean

Returns:

false
isLazy
()

Implements io.vavr.Value.isLazy.

A Try's value is computed eagerly.

public default boolean

Returns:

true
isSingleValued
()

Implements io.vavr.Value.isSingleValued.

A Try is a single-valued.

public boolean

Returns:

true, if this is a Success, otherwise false, if this is a Failure
isSuccess
()

Checks if this is a Success.

public default Iterator<T>
iterator()

Implements io.vavr.Value.iterator.

Returns a rich io.vavr.collection.Iterator.

public default <
The new component type
U
>
Try<U>

Returns:

a Try
map
(Function<? super T, ? extends U>
A checked function
mapper
)

Implements io.vavr.Value.map.

Shortcut for mapTry(mapper::apply), see mapTry(CheckedFunction1).

public default Try<T>

Returns:

A new Try if this is a Failure, otherwise this.
mapFailure
(API.Match.Case<? extends Throwable, ? extends Throwable>...
A not necessarily exhaustive sequence of cases that will be matched against a cause.
cases
)

Maps the cause to a new exception if this is a Failure or returns this instance if this is a Success.

public default <
The new component type
U
>
Try<U>

Returns:

a Try
mapTry
(CheckedFunction1<? super T, ? extends U>
A checked function
mapper
)

Runs the given checked function if this is a Try.Success, passing the result of the current expression to it.

public static <
Component type of the Try.
T
>
Try<T>

Returns:

the given t instance as narrowed type Try<T>.
narrow
(Try<? extends T>
A Try.
t
)

Narrows a widened Try<?

public static <
Component type
T
>
Try<T>

Returns:

Success(supplier.apply()) if no exception occurs, otherwise Failure(throwable) if an exception occurs calling supplier.apply().
of
(CheckedFunction0<? extends T>
A checked supplier
supplier
)

Creates a Try of a CheckedFunction0.

public static <
Component type
T
>
Try<T>

Returns:

Success(callable.call()) if no exception occurs, otherwise Failure(throwable) if an exception occurs calling callable.call().
ofCallable
(Callable<? extends T>
A callable
callable
)

Creates a Try of a Callable.

public static <
Component type
T
>
Try<T>

Returns:

Success(supplier.get()) if no exception occurs, otherwise Failure(throwable) if an exception occurs calling supplier.get().
ofSupplier
(Supplier<? extends T>
A supplier
supplier
)

Creates a Try of a Supplier.

public default Try<T>

Returns:

this
onFailure
(Consumer<? super Throwable>
An exception consumer
action
)

Consumes the cause if this is a Try.Failure.

public default <
the exception type that should be handled
X extends Throwable
>
Try<T>

Returns:

this
onFailure
(Class<X>
the exception type that is handled
exceptionType
,
Consumer<? super X>
an excpetion consumer
action
)

Consumes the cause if this is a Try.Failure and the cause is instance of X.

public default Try<T>

Returns:

this
onSuccess
(Consumer<? super T>
A value consumer
action
)

Consumes the value if this is a Try.Success.

public default Try<T>
orElse(Try<? extends T> other)

public default Try<T>
orElse(Supplier<? extends Try<? extends T>> supplier)

public default void
orElseRun(Consumer<? super Throwable> action)

public default Try<T>

Returns:

this Try
peek
(Consumer<? super T>
A Consumer
action
)

Implements io.vavr.Value.peek.

Applies the action to the value of a Success or does nothing in the case of a Failure.

public default <
Exception type
X extends Throwable
>
Try<T>

Returns:

a Try
recover
(Class<X>
The specific exception type that should be handled
exceptionType
,
Function<? super X, ? extends T>
A recovery function taking an exception of type X
f
)

Returns this, if this is a Success or this is a Failure and the cause is not assignable from cause.getClass().

public default <
Exception type
X extends Throwable
>
Try<T>

Returns:

a Try
recover
(Class<X>
The specific exception type that should be handled
exceptionType
,
T
A value that is used in case of a recovery
value
)

Returns this, if this is a Try.Success or this is a Failure and the cause is not assignable from cause.getClass().

public default Try<T>

Returns:

a Try
recover
(Function<? super Throwable, ? extends T>
A recovery function taking a Throwable
f
)

Returns this, if this is a Success, otherwise tries to recover the exception of the failure with f, i.e. calling Try.of(() -> f.apply(throwable)).

public default <
Exception type
X extends Throwable
>
Try<T>

Returns:

a Try
recoverWith
(Class<X>
The specific exception type that should be handled
exceptionType
,
Function<? super X, Try<? extends T>>
A recovery function taking an exception of type X and returning Try as a result of recovery. If Try is Try#isSuccess() then recovery ends up successfully. Otherwise the function was not able to recover.
f
)

Returns this, if this is a Success or this is a Failure and the cause is not assignable from cause.getClass().

public default <
type of the exception that should be recovered
X extends Throwable
>
Try<T>

Returns:

the given recovered if this is a Try.Failure and the cause is of type X, else this
recoverWith
(Class<X>
the exception type that is recovered
exceptionType
,
Try<? extends T>
the substitute for a matching Failure
recovered
)

Recovers this Try with the given recovered, if this is a Try.Failure and the given exceptionType is assignable to the underlying cause type.

public default Try<T>

Returns:

a Try
recoverWith
(Function<? super Throwable, ? extends Try<? extends T>>
A recovery function taking a Throwable
f
)

Returns this, if this is a Success, otherwise tries to recover the exception of the failure with f, i.e. calling f.apply(cause.getCause()).

public static Try<Void>

Returns:

Success(null) if no exception occurs, otherwise Failure(throwable) if an exception occurs calling runnable.run().
run
(CheckedRunnable
A checked runnable
runnable
)

Creates a Try of a CheckedRunnable.

public static Try<Void>

Returns:

Success(null) if no exception occurs, otherwise Failure(throwable) if an exception occurs calling runnable.run().
runRunnable
(Runnable
A runnable
runnable
)

Creates a Try of a Runnable.

public static <
type of the Trys
T
>
Try<Seq<T>>

Returns:

A Try of a Seq of results
sequence
(Iterable<? extends Try<? extends T>>
An Iterable of Trys
values
)

Reduces many Trys into a single Try by transforming an Iterable<Try<?

public static <
Type of the given value.
T
>
Try<T>

Returns:

A new Success.
success
(T
A value.
value
)

Creates a Success that contains the given value.

public default Either<Throwable, T>

Returns:

A new Either
toEither
()

Converts this Try to an Either.

public String
toString()

Redeclares io.vavr.Value.toString.

Clarifies that values have a proper toString() method implemented.

public default Validation<Throwable, T>

Returns:

A new Validation
toValidation
()

Converts this Try to a Validation.

public default <
result type of the throwable mapper
U
>
Validation<U, T>

Returns:

A new Validation
toValidation
(Function<? super Throwable, ? extends U>
A transformation from throwable to desired invalid type of new Validation
throwableMapper
)

Overrides default io.vavr.Value.toValidation.

Converts this Try to a Validation, converting the Throwable (if present) to another object using passed Function.

public default <
Type of transformation result
U
>
U

Returns:

An instance of type U
transform
(Function<? super Try<T>, ? extends U>
A transformation
f
)

Transforms this Try.

public static <
The type of the given values.
T
,
The mapped value type.
U
>
Try<Seq<U>>

Returns:

A Try of a Seq of results.
traverse
(Iterable<? extends T>
An Iterable of values.
values
,
Function<? super T, ? extends Try<? extends U>>
A mapper of values to Trys
mapper
)

Maps the values of an iterable to a sequence of mapped values into a single Try by transforming an Iterable<?

public static <
Type of the 1st resource.
T1 extends AutoCloseable
>
Try.WithResources1<T1>

Returns:

a new WithResources1 instance.
withResources
(CheckedFunction0<? extends T1>
The supplier of the first resource.
t1Supplier
)

Creates a Try-with-resources builder that operates on one AutoCloseable resource.

public static <
Type of the 1st resource.
T1 extends AutoCloseable
,
Type of the 2nd resource.
T2 extends AutoCloseable
>
Try.WithResources2<T1, T2>

Returns:

a new WithResources2 instance.
withResources
(CheckedFunction0<? extends T1>
The supplier of the 1st resource.
t1Supplier
,
CheckedFunction0<? extends T2>
The supplier of the 2nd resource.
t2Supplier
)

Creates a Try-with-resources builder that operates on two AutoCloseable resources.

public static <
Type of the 1st resource.
T1 extends AutoCloseable
,
Type of the 2nd resource.
T2 extends AutoCloseable
,
Type of the 3rd resource.
T3 extends AutoCloseable
>
Try.WithResources3<T1, T2, T3>

Returns:

a new WithResources3 instance.
withResources
(CheckedFunction0<? extends T1>
The supplier of the 1st resource.
t1Supplier
,
CheckedFunction0<? extends T2>
The supplier of the 2nd resource.
t2Supplier
,
CheckedFunction0<? extends T3>
The supplier of the 3rd resource.
t3Supplier
)

Creates a Try-with-resources builder that operates on three AutoCloseable resources.

public static <
Type of the 1st resource.
T1 extends AutoCloseable
,
Type of the 2nd resource.
T2 extends AutoCloseable
,
Type of the 3rd resource.
T3 extends AutoCloseable
,
Type of the 4th resource.
T4 extends AutoCloseable
>
Try.WithResources4<T1, T2, T3, T4>

Returns:

a new WithResources4 instance.
withResources
(CheckedFunction0<? extends T1>
The supplier of the 1st resource.
t1Supplier
,
CheckedFunction0<? extends T2>
The supplier of the 2nd resource.
t2Supplier
,
CheckedFunction0<? extends T3>
The supplier of the 3rd resource.
t3Supplier
,
CheckedFunction0<? extends T4>
The supplier of the 4th resource.
t4Supplier
)

Creates a Try-with-resources builder that operates on four AutoCloseable resources.

public static <
Type of the 1st resource.
T1 extends AutoCloseable
,
Type of the 2nd resource.
T2 extends AutoCloseable
,
Type of the 3rd resource.
T3 extends AutoCloseable
,
Type of the 4th resource.
T4 extends AutoCloseable
,
Type of the 5th resource.
T5 extends AutoCloseable
>
Try.WithResources5<T1, T2, T3, T4, T5>

Returns:

a new WithResources5 instance.
withResources
(CheckedFunction0<? extends T1>
The supplier of the 1st resource.
t1Supplier
,
CheckedFunction0<? extends T2>
The supplier of the 2nd resource.
t2Supplier
,
CheckedFunction0<? extends T3>
The supplier of the 3rd resource.
t3Supplier
,
CheckedFunction0<? extends T4>
The supplier of the 4th resource.
t4Supplier
,
CheckedFunction0<? extends T5>
The supplier of the 5th resource.
t5Supplier
)

Creates a Try-with-resources builder that operates on five AutoCloseable resources.

public static <
Type of the 1st resource.
T1 extends AutoCloseable
,
Type of the 2nd resource.
T2 extends AutoCloseable
,
Type of the 3rd resource.
T3 extends AutoCloseable
,
Type of the 4th resource.
T4 extends AutoCloseable
,
Type of the 5th resource.
T5 extends AutoCloseable
,
Type of the 6th resource.
T6 extends AutoCloseable
>
Try.WithResources6<T1, T2, T3, T4, T5, T6>

Returns:

a new WithResources6 instance.
withResources
(CheckedFunction0<? extends T1>
The supplier of the 1st resource.
t1Supplier
,
CheckedFunction0<? extends T2>
The supplier of the 2nd resource.
t2Supplier
,
CheckedFunction0<? extends T3>
The supplier of the 3rd resource.
t3Supplier
,
CheckedFunction0<? extends T4>
The supplier of the 4th resource.
t4Supplier
,
CheckedFunction0<? extends T5>
The supplier of the 5th resource.
t5Supplier
,
CheckedFunction0<? extends T6>
The supplier of the 6th resource.
t6Supplier
)

Creates a Try-with-resources builder that operates on six AutoCloseable resources.

public static <
Type of the 1st resource.
T1 extends AutoCloseable
,
Type of the 2nd resource.
T2 extends AutoCloseable
,
Type of the 3rd resource.
T3 extends AutoCloseable
,
Type of the 4th resource.
T4 extends AutoCloseable
,
Type of the 5th resource.
T5 extends AutoCloseable
,
Type of the 6th resource.
T6 extends AutoCloseable
,
Type of the 7th resource.
T7 extends AutoCloseable
>
Try.WithResources7<T1, T2, T3, T4, T5, T6, T7>

Returns:

a new WithResources7 instance.
withResources
(CheckedFunction0<? extends T1>
The supplier of the 1st resource.
t1Supplier
,
CheckedFunction0<? extends T2>
The supplier of the 2nd resource.
t2Supplier
,
CheckedFunction0<? extends T3>
The supplier of the 3rd resource.
t3Supplier
,
CheckedFunction0<? extends T4>
The supplier of the 4th resource.
t4Supplier
,
CheckedFunction0<? extends T5>
The supplier of the 5th resource.
t5Supplier
,
CheckedFunction0<? extends T6>
The supplier of the 6th resource.
t6Supplier
,
CheckedFunction0<? extends T7>
The supplier of the 7th resource.
t7Supplier
)

Creates a Try-with-resources builder that operates on seven AutoCloseable resources.

public static <
Type of the 1st resource.
T1 extends AutoCloseable
,
Type of the 2nd resource.
T2 extends AutoCloseable
,
Type of the 3rd resource.
T3 extends AutoCloseable
,
Type of the 4th resource.
T4 extends AutoCloseable
,
Type of the 5th resource.
T5 extends AutoCloseable
,
Type of the 6th resource.
T6 extends AutoCloseable
,
Type of the 7th resource.
T7 extends AutoCloseable
,
Type of the 8th resource.
T8 extends AutoCloseable
>
Try.WithResources8<T1, T2, T3, T4, T5, T6, T7, T8>

Returns:

a new WithResources8 instance.
withResources
(CheckedFunction0<? extends T1>
The supplier of the 1st resource.
t1Supplier
,
CheckedFunction0<? extends T2>
The supplier of the 2nd resource.
t2Supplier
,
CheckedFunction0<? extends T3>
The supplier of the 3rd resource.
t3Supplier
,
CheckedFunction0<? extends T4>
The supplier of the 4th resource.
t4Supplier
,
CheckedFunction0<? extends T5>
The supplier of the 5th resource.
t5Supplier
,
CheckedFunction0<? extends T6>
The supplier of the 6th resource.
t6Supplier
,
CheckedFunction0<? extends T7>
The supplier of the 7th resource.
t7Supplier
,
CheckedFunction0<? extends T8>
The supplier of the 8th resource.
t8Supplier
)

Creates a Try-with-resources builder that operates on eight AutoCloseable resources.

Inherited from io.vavr.Value:
collectcollectcontainscorrespondseqexistsforAllforEachgetOrElsegetOrElsegetOrElseThrowgetOrElseTrygetOrNullnarrowoutoutspliteratorstderrstdoutstringPrefixtoArraytoCharSeqtoCompletableFuturetoEithertoEithertoInvalidtoInvalidtoJavaArraytoJavaArraytoJavaArraytoJavaCollectiontoJavaListtoJavaListtoJavaMaptoJavaMaptoJavaMaptoJavaOptionaltoJavaParallelStreamtoJavaSettoJavaSettoJavaStreamtoLefttoLefttoLinkedMaptoLinkedMaptoLinkedSettoListtoMaptoMaptoOptiontoPriorityQueuetoPriorityQueuetoQueuetoRighttoRighttoSettoSortedMaptoSortedMaptoSortedMaptoSortedMaptoSortedSettoSortedSettoStreamtoTreetoTreetoTrytoTrytoValidtoValidtoValidationtoVector