Uses of Class
com.dudko.tools.safejavastreams.core.Try
Packages that use Try
-
Uses of Try in com.dudko.tools.safejavastreams.core
Subclasses of Try in com.dudko.tools.safejavastreams.coreModifier and TypeClassDescriptionstatic final class
Try.Failure<T>
Represents a failed computation.static final class
Try.Success<T>
Represents a successful computation.Methods in com.dudko.tools.safejavastreams.core that return TryModifier and TypeMethodDescriptionstatic <T> Try<T>
Creates a Failure instance.Applies a predicate to value if Success.<U> Try<U>
abstract <U> Try<U>
Applies a function that returns Try if Success, otherwise propagates the Failure.<U> Try<U>
<U> Try<U>
abstract <U> Try<U>
Applies a function to the value if Success, otherwise propagates the Failure.<U> Try<U>
static <T> Try<T>
Try.of
(ThrowingSupplier<T> supplier) Executes given code block and wraps result in Try.Executes an action if Failure.Executes an action if Success.Performs side-effecting operation on Success.Try.Failure.peekFailure
(Consumer<? super Throwable> action) Try.peekFailure
(Consumer<? super Throwable> action) Performs side-effecting operation on Failure.Try.Success.peekFailure
(Consumer<? super Throwable> action) Applies a recovery function if this is a Failure.Try.Failure.recoverWith
(Function<? super Throwable, Try<T>> recovery) Try.recoverWith
(Function<? super Throwable, Try<T>> recovery) Applies a recovery function that returns Try if this is a Failure.Try.Success.recoverWith
(Function<? super Throwable, Try<T>> recovery) static <T> Try<T>
Try.success
(T value) Creates a Success instance.Method parameters in com.dudko.tools.safejavastreams.core with type arguments of type TryModifier and TypeMethodDescription<U> Try<U>
abstract <U> Try<U>
Applies a function that returns Try if Success, otherwise propagates the Failure.<U> Try<U>
Try.Failure.recoverWith
(Function<? super Throwable, Try<T>> recovery) Try.recoverWith
(Function<? super Throwable, Try<T>> recovery) Applies a recovery function that returns Try if this is a Failure.Try.Success.recoverWith
(Function<? super Throwable, Try<T>> recovery) -
Uses of Try in com.dudko.tools.safejavastreams.extensions
Methods in com.dudko.tools.safejavastreams.extensions that return TryModifier and TypeMethodDescriptionstatic <T> Try<T>
TryExtensions.from
(ThrowingSupplier<T> supplier) Wraps a ThrowingSupplier into Try.static <T> Try<T>
TryExtensions.fromFuture
(CompletableFuture<T> future) Converts a CompletableFuture into Try synchronously.static <T> Try<T>
TryExtensions.fromOptional
(Optional<T> optional, Supplier<? extends Throwable> ifEmpty) Converts an Optional to Try.