Uses of Class
com.dudko.tools.safejavastreams.core.Either
Packages that use Either
Package
Description
-
Uses of Either in com.dudko.tools.safejavastreams.adapter
Methods in com.dudko.tools.safejavastreams.adapter that return types with arguments of type EitherModifier and TypeMethodDescriptionCheckedAdapters.safeFunctionEither(ThrowingFunction<T, R> function) Converts a ThrowingFunction into one that returnsEither<Exception, R>. -
Uses of Either in com.dudko.tools.safejavastreams.core
Subclasses of Either in com.dudko.tools.safejavastreams.coreModifier and TypeClassDescriptionprivate static final classEither.Left<L,R> private static final classEither.Right<L,R> Methods in com.dudko.tools.safejavastreams.core that return EitherModifier and TypeMethodDescriptionApplies a function that returns another Either to Right value.Executes action if this is Left.Executes action if this is Right.static <L,R> Either<L, R> Either.left(L value) Creates a Left instance.Maps Right value to another type if present.Allows observing the value (for logging, debugging, etc.).Converts Left into Right using a recovery function.Converts Left into another Either using a recovery function.static <L,R> Either<L, R> Either.right(R value) Creates a Right instance.Result.toEither()Converts this Result to an Either.Method parameters in com.dudko.tools.safejavastreams.core with type arguments of type EitherModifier and TypeMethodDescriptionApplies a function that returns another Either to Right value.Allows observing the value (for logging, debugging, etc.).Converts Left into another Either using a recovery function. -
Uses of Either in com.dudko.tools.safejavastreams.extensions
Methods in com.dudko.tools.safejavastreams.extensions that return EitherModifier and TypeMethodDescriptionstatic <L,R> Either<L, R> EitherExtensions.fromChecked(Supplier<R> supplier, Function<Throwable, ? extends L> errorMapper) static <L,R> Either<L, R> EitherExtensions.fromFuture(CompletableFuture<R> future, Function<Throwable, ? extends L> errorMapper) Converts aCompletableFutureto anEither.static <L,R> Either<L, R> EitherExtensions.fromOptional(Optional<R> optional, Supplier<? extends L> leftSupplier) static <L,R> Either<L, R> EitherExtensions.fromSupplier(Supplier<R> supplier, Function<Throwable, ? extends L> errorMapper) Wraps a supplier that may throw, producing anEither.