Uses of Interface
io.vavr.control.Try
Packages that use Try
Package
Description
Beside
API the io.vavr package contains core types like (Checked)Functions and Tuples.This package contains basic building blocks for creating fast, asynchronous, non-blocking parallel code.
-
Uses of Try in io.vavr
Modifier and TypeFieldDescriptionAPI.For1Try.ts1API.For2Try.ts1API.For3Try.ts1API.For4Try.ts1API.For5Try.ts1API.For6Try.ts1API.For7Try.ts1API.For8Try.ts1API.For2Try.ts2API.For3Try.ts2API.For4Try.ts2API.For5Try.ts2API.For6Try.ts2API.For7Try.ts2API.For8Try.ts2API.For3Try.ts3API.For4Try.ts3API.For5Try.ts3API.For6Try.ts3API.For7Try.ts3API.For8Try.ts3API.For4Try.ts4API.For5Try.ts4API.For6Try.ts4API.For7Try.ts4API.For8Try.ts4API.For5Try.ts5API.For6Try.ts5API.For7Try.ts5API.For8Try.ts5API.For6Try.ts6API.For7Try.ts6API.For8Try.ts6API.For7Try.ts7API.For8Try.ts7API.For8Try.ts8Modifier and TypeMethodDescriptionstatic <T, _1 extends Option<Try<T>>>
API.Match.Pattern1<Future<T>, _1> Patterns.$Future(API.Match.Pattern<_1, ?> p1) Modifier and TypeMethodDescriptionValue.toTry()Converts this to aTry.Converts this to aTry.static <T> Try<T> API.Try(CheckedFunction0<? extends T> supplier) Alias forTry.of(CheckedFunction0)API.For1Try.yield()A shortcut foryield(Function.identity()).<R> Try<R> Yields a result for elements of the cross product of the underlying Try.<R> Try<R> API.For2Try.yield(BiFunction<? super T1, ? super T2, ? extends R> f) Yields a result for elements of the cross product of the underlying Trys.<R> Try<R> Yields a result for elements of the cross product of the underlying Trys.<R> Try<R> Yields a result for elements of the cross product of the underlying Trys.<R> Try<R> API.For5Try.yield(Function5<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? extends R> f) Yields a result for elements of the cross product of the underlying Trys.<R> Try<R> API.For6Try.yield(Function6<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? extends R> f) Yields a result for elements of the cross product of the underlying Trys.<R> Try<R> API.For7Try.yield(Function7<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? extends R> f) Yields a result for elements of the cross product of the underlying Trys.<R> Try<R> API.For8Try.yield(Function8<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? extends R> f) Yields a result for elements of the cross product of the underlying Trys.Modifier and TypeMethodDescriptionCheckedFunction0.liftTry(CheckedFunction0<? extends R> partialFunction) Lifts the givenpartialFunctioninto a total function that returns anTryresult.CheckedFunction1.liftTry(CheckedFunction1<? super T1, ? extends R> partialFunction) Lifts the givenpartialFunctioninto a total function that returns anTryresult.CheckedFunction2.liftTry(CheckedFunction2<? super T1, ? super T2, ? extends R> partialFunction) Lifts the givenpartialFunctioninto a total function that returns anTryresult.CheckedFunction3.liftTry(CheckedFunction3<? super T1, ? super T2, ? super T3, ? extends R> partialFunction) Lifts the givenpartialFunctioninto a total function that returns anTryresult.CheckedFunction4.liftTry(CheckedFunction4<? super T1, ? super T2, ? super T3, ? super T4, ? extends R> partialFunction) Lifts the givenpartialFunctioninto a total function that returns anTryresult.CheckedFunction5.liftTry(CheckedFunction5<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? extends R> partialFunction) Lifts the givenpartialFunctioninto a total function that returns anTryresult.CheckedFunction6.liftTry(CheckedFunction6<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? extends R> partialFunction) Lifts the givenpartialFunctioninto a total function that returns anTryresult.CheckedFunction7.liftTry(CheckedFunction7<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? extends R> partialFunction) Lifts the givenpartialFunctioninto a total function that returns anTryresult.CheckedFunction8.liftTry(CheckedFunction8<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? extends R> partialFunction) Lifts the givenpartialFunctioninto a total function that returns anTryresult.Lifts the givenpartialFunctioninto a total function that returns anTryresult.Lifts the givenpartialFunctioninto a total function that returns anTryresult.Function2.liftTry(BiFunction<? super T1, ? super T2, ? extends R> partialFunction) Lifts the givenpartialFunctioninto a total function that returns anTryresult.Lifts the givenpartialFunctioninto a total function that returns anTryresult.Function4.liftTry(Function4<? super T1, ? super T2, ? super T3, ? super T4, ? extends R> partialFunction) Lifts the givenpartialFunctioninto a total function that returns anTryresult.Function5.liftTry(Function5<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? extends R> partialFunction) Lifts the givenpartialFunctioninto a total function that returns anTryresult.Function6.liftTry(Function6<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? extends R> partialFunction) Lifts the givenpartialFunctioninto a total function that returns anTryresult.Function7.liftTry(Function7<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? extends R> partialFunction) Lifts the givenpartialFunctioninto a total function that returns anTryresult.Function8.liftTry(Function8<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? extends R> partialFunction) Lifts the givenpartialFunctioninto a total function that returns anTryresult.Modifier and TypeMethodDescriptionstatic <T1> API.For1Try<T1> Creates aFor-comprehension of one Try.static <T1,T2> API.For2Try <T1, T2> Creates aFor-comprehension of two Trys.static <T1,T2, T3> API.For3Try <T1, T2, T3> Creates aFor-comprehension of three Trys.static <T1,T2, T3, T4>
API.For4Try<T1, T2, T3, T4> Creates aFor-comprehension of 4 Trys.static <T1,T2, T3, T4, T5>
API.For5Try<T1, T2, T3, T4, T5> Creates aFor-comprehension of 5 Trys.static <T1,T2, T3, T4, T5, T6>
API.For6Try<T1, T2, T3, T4, T5, T6> Creates aFor-comprehension of 6 Trys.static <T1,T2, T3, T4, T5, T6, T7>
API.For7Try<T1, T2, T3, T4, T5, T6, T7> Creates aFor-comprehension of 7 Trys.static <T1,T2, T3, T4, T5, T6, T7, T8>
API.For8Try<T1, T2, T3, T4, T5, T6, T7, T8> API.For(Try<T1> ts1, Try<T2> ts2, Try<T3> ts3, Try<T4> ts4, Try<T5> ts5, Try<T6> ts6, Try<T7> ts7, Try<T8> ts8) Creates aFor-comprehension of 8 Trys. -
Uses of Try in io.vavr.concurrent
Fields in io.vavr.concurrent with type parameters of type TryModifier and TypeFieldDescriptionFutureImpl.actionsThe queue of actions is filled when calling onComplete() before the Future is completed or cancelled.FutureImpl.valueOnce the Future is completed, the value is defined.Methods in io.vavr.concurrent that return types with arguments of type TryModifier and TypeMethodDescriptionFuture.getValue()Returns the value of the Future.FutureImpl.getValue()Methods in io.vavr.concurrent with parameters of type TryModifier and TypeMethodDescriptionCompletes thisPromisewith the givenvalue.static <T> Future<T> static <T> Future<T> static <T> Promise<T> static <T> Promise<T> (package private) static <T> FutureImpl<T> Creates aFutureImplthat is immediately completed with the given value.(package private) booleanFutureImpl.tryComplete(Try<? extends T> value) INTERNAL METHOD, SHOULD BE USED BY THE CONSTRUCTOR, ONLY.booleanPromise.tryComplete(Try<? extends T> value) Attempts to completes thisPromisewith the givenvalue.booleanPromiseImpl.tryComplete(Try<? extends T> value) booleanA function that takes aTry(success or failure) and returns the state of completion.Method parameters in io.vavr.concurrent with type arguments of type TryModifier and TypeMethodDescriptionSupport for chaining of callbacks that are guaranteed to be executed in a specific order.Future.onComplete(Consumer<? super Try<T>> action) Performs the action once the Future is complete.FutureImpl.onComplete(Consumer<? super Try<T>> action) private voiddefault <U> Future<U> Future.transformValue(Function<? super Try<T>, ? extends Try<? extends U>> f) Transforms the value of thisFuture, whether it is a success or a failure.default <U> Future<U> Future.transformValue(Function<? super Try<T>, ? extends Try<? extends U>> f) Transforms the value of thisFuture, whether it is a success or a failure.Constructor parameters in io.vavr.concurrent with type arguments of type TryModifierConstructorDescriptionprivateFutureImpl(Executor executor, Option<Try<T>> value, Queue<Consumer<Try<T>>> actions, Queue<Thread> waiters, FutureImpl.Computation<T> computation) privateFutureImpl(Executor executor, Option<Try<T>> value, Queue<Consumer<Try<T>>> actions, Queue<Thread> waiters, FutureImpl.Computation<T> computation) -
Uses of Try in io.vavr.control
Classes in io.vavr.control that implement TryModifier and TypeClassDescriptionstatic final classTry.Failure<T>A failed Try.static final classTry.Success<T>A succeeded Try.Methods in io.vavr.control that return TryModifier and TypeMethodDescriptionTry.andFinally(Runnable runnable) Provides try's finally behavior no matter what the result of the operation is.Try.andFinallyTry(CheckedRunnable runnable) Provides try's finally behavior no matter what the result of the operation is.Shortcut forandThenTry(runnable::run), seeTry.andThenTry(CheckedRunnable).Shortcut forandThenTry(consumer::accept), seeTry.andThenTry(CheckedConsumer).Try.andThenTry(CheckedConsumer<? super T> consumer) Passes the result to the givenconsumerif this is aSuccess.Try.andThenTry(CheckedRunnable runnable) Runs the given runnable if this is aSuccess, otherwise returns thisFailure.default <R> Try<R> Try.collect(PartialFunction<? super T, ? extends R> partialFunction) Collects value that is in the domain of the givenpartialFunctionby mapping the value to typeR.Try.failed()ReturnsSuccess(throwable)if this is aFailure(throwable), otherwise aFailure(new NoSuchElementException("Success.failed()"))if this is a Success.static <T> Try<T> Creates aTry.Failurethat contains the givenexception.Shortcut forfilterTry(predicate::test), seeTry.filterTry(CheckedPredicate)}.Shortcut forfilterTry(predicate::test, errorProvider::apply), seeTry.filterTry(CheckedPredicate, CheckedFunction1)}.Shortcut forfilterTry(predicate::test, throwableSupplier), seeTry.filterTry(CheckedPredicate, Supplier)}.Try.filterTry(CheckedPredicate<? super T> predicate) Returnsthisif this is a Failure or this is a Success and the value satisfies the predicate.Try.filterTry(CheckedPredicate<? super T> predicate, CheckedFunction1<? super T, ? extends Throwable> errorProvider) Returnsthisif this is a Failure or this is a Success and the value satisfies the predicate.Try.filterTry(CheckedPredicate<? super T> predicate, Supplier<? extends Throwable> throwableSupplier) Returnsthisif this is a Failure or this is a Success and the value satisfies the predicate.default <U> Try<U> Shortcut forflatMapTry(mapper::apply), seeTry.flatMapTry(CheckedFunction1).default <U> Try<U> Try.flatMapTry(CheckedFunction1<? super T, ? extends Try<? extends U>> mapper) FlatMaps the value of a Success or returns a Failure.default <U> Try<U> Shortcut formapTry(mapper::apply), seeTry.mapTry(CheckedFunction1).Try.mapFailure(API.Match.Case<? extends Throwable, ? extends Throwable>... cases) Maps the cause to a new exception if this is aFailureor returns this instance if this is aSuccess.default <U> Try<U> Try.mapTry(CheckedFunction1<? super T, ? extends U> mapper) Runs the given checked function if this is aTry.Success, passing the result of the current expression to it.static <T> Try<T> Narrows a widenedTry<? extends T>toTry<T>by performing a type-safe cast.static <T> Try<T> Try.of(CheckedFunction0<? extends T> supplier) Creates a Try of a CheckedFunction0.<R> Try<R> Try.WithResources1.of(CheckedFunction1<? super T1, ? extends R> f) Wraps the result of a computation that may fail in aTry.<R> Try<R> Try.WithResources2.of(CheckedFunction2<? super T1, ? super T2, ? extends R> f) Wraps the result of a computation that may fail in aTry.<R> Try<R> Try.WithResources3.of(CheckedFunction3<? super T1, ? super T2, ? super T3, ? extends R> f) Wraps the result of a computation that may fail in aTry.<R> Try<R> Try.WithResources4.of(CheckedFunction4<? super T1, ? super T2, ? super T3, ? super T4, ? extends R> f) Wraps the result of a computation that may fail in aTry.<R> Try<R> Try.WithResources5.of(CheckedFunction5<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? extends R> f) Wraps the result of a computation that may fail in aTry.<R> Try<R> Try.WithResources6.of(CheckedFunction6<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? extends R> f) Wraps the result of a computation that may fail in aTry.<R> Try<R> Try.WithResources7.of(CheckedFunction7<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? extends R> f) Wraps the result of a computation that may fail in aTry.<R> Try<R> Try.WithResources8.of(CheckedFunction8<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? extends R> f) Wraps the result of a computation that may fail in aTry.static <T> Try<T> Try.ofCallable(Callable<? extends T> callable) Creates a Try of a Callable.static <T> Try<T> Try.ofSupplier(Supplier<? extends T> supplier) Creates a Try of a Supplier.Consumes the cause if this is aTry.Failureand the cause is instance ofX.Consumes the cause if this is aTry.Failure.Consumes the value if this is aTry.Success.Applies the action to the value of a Success or does nothing in the case of a Failure.Returnsthis, if this is aSuccessor this is aFailureand the cause is not assignable fromcause.getClass().Returnsthis, if this is aTry.Successor this is aFailureand the cause is not assignable fromcause.getClass().Returnsthis, if this is aSuccess, otherwise tries to recover the exception of the failure withf, i.e.Try.recoverWith(Class<X> exceptionType, Try<? extends T> recovered) Recovers thisTrywith the givenrecovered, if this is aTry.Failureand the givenexceptionTypeis assignable to the underlying cause type.Try.recoverWith(Class<X> exceptionType, Function<? super X, Try<? extends T>> f) Returnsthis, if this is aSuccessor this is aFailureand the cause is not assignable fromcause.getClass().Try.recoverWith(Function<? super Throwable, ? extends Try<? extends T>> f) Returnsthis, if this is a Success, otherwise tries to recover the exception of the failure withf, i.e.Try.run(CheckedRunnable runnable) Creates a Try of a CheckedRunnable.Try.runRunnable(Runnable runnable) Creates a Try of a Runnable.Reduces manyTrys into a singleTryby transforming anIterable<Try<? extends T>>into aTry<Seq<T>>.static <T> Try<T> Try.success(T value) Creates aTry.Successthat contains the givenvalue.Maps the values of an iterable to a sequence of mapped values into a singleTryby transforming anIterable<? extends T>into aTry<Seq<U>>.Methods in io.vavr.control with parameters of type TryModifier and TypeMethodDescriptionstatic <T> Validation<Throwable, T> Creates aValidationof anTry.static <T> Try<T> Narrows a widenedTry<? extends T>toTry<T>by performing a type-safe cast.Try.recoverWith(Class<X> exceptionType, Try<? extends T> recovered) Recovers thisTrywith the givenrecovered, if this is aTry.Failureand the givenexceptionTypeis assignable to the underlying cause type.Method parameters in io.vavr.control with type arguments of type TryModifier and TypeMethodDescriptiondefault <U> Try<U> Shortcut forflatMapTry(mapper::apply), seeTry.flatMapTry(CheckedFunction1).default <U> Try<U> Try.flatMapTry(CheckedFunction1<? super T, ? extends Try<? extends U>> mapper) FlatMaps the value of a Success or returns a Failure.Try.recoverWith(Class<X> exceptionType, Function<? super X, Try<? extends T>> f) Returnsthis, if this is aSuccessor this is aFailureand the cause is not assignable fromcause.getClass().Try.recoverWith(Function<? super Throwable, ? extends Try<? extends T>> f) Returnsthis, if this is a Success, otherwise tries to recover the exception of the failure withf, i.e.Reduces manyTrys into a singleTryby transforming anIterable<Try<? extends T>>into aTry<Seq<T>>.default <U> UTransforms thisTry.Maps the values of an iterable to a sequence of mapped values into a singleTryby transforming anIterable<? extends T>into aTry<Seq<U>>.