Uses of Interface
ru.progrm_jarvis.javacommons.object.Result
Packages that use Result
Package
Description
Abstractions around lazy evaluation paradigm.
Helpers and sum-types for
most generic purposes.Various helpers related to Java's primitive types.
Utilities whose behaviour may be unsafe when used not wisely.
-
Uses of Result in ru.progrm_jarvis.javacommons.lazy
Methods in ru.progrm_jarvis.javacommons.lazy that return ResultModifier and TypeMethodDescriptionLazy.DoubleCheckedLazy.getAsResult()Lazy.getAsResult()Gets the wrapped value wrapped inResultif it is already initialized or anullError()otherwise.Lazy.LockingWeakLazy.getAsResult()Lazy.SimpleLazy.getAsResult()Lazy.SimpleWeakLazy.getAsResult()Lazy.ThreadLocalLazy.getAsResult() -
Uses of Result in ru.progrm_jarvis.javacommons.object
Classes in ru.progrm_jarvis.javacommons.object that implement ResultModifier and TypeClassDescriptionstatic final classResult.Error<T,E> static final classResult.Success<T,E> Representation of asuccessfulresult.Methods in ru.progrm_jarvis.javacommons.object that return ResultModifier and TypeMethodDescriptionReturns the given result if this is asuccessful resultotherwise keeping theerror result.ValueContainer.asResult()Converts this value container into anull-error result.Converts this value container into aResult.ValueContainer.Containing.asResult()ValueContainer.Empty.asResult()ValueContainer.OfNull.asResult()ValueContainer.Supplying.asResult()static <T,E> @NotNull Result<T, E> Result.error(E error) Creates a new error result.Also known asandThen.static <T,E> @NotNull Result<T, @Nullable E> Converts the givenOptionalinto anull-error result.static <T,E> @NotNull Result<T, E> Converts the givenOptionalinto anerror result.Maps the result if it issuccessfulreturning a new result with the result of mapping otherwise keeping theerror result.Maps the result if it is anerror resultreturning a new result with the result of mapping otherwise keeping theerror result.static <T,E extends R, R>
@NotNull Result<T,R> Result.Extensions.mapErrorIf(@NonNull Result<? extends T, ? extends E> result, @NonNull Predicate<? super E> predicate, @NonNull Function<? super E, ? extends R> mappingFunction) Conditionally maps theerror valueotherwise applying no changes.static <T,E extends R, R>
@NotNull Result<T,R> Result.Extensions.mapErrorIfNot(@NonNull Result<? extends T, ? extends E> result, @NonNull Predicate<? super E> predicate, @NonNull Function<? super E, ? extends R> mappingFunction) Conditionally maps theerror valueotherwise applying no changes.static <T extends R,E, R>
@NotNull Result<R,E> Result.Extensions.mapIf(@NonNull Result<? extends T, ? extends E> result, @NonNull Predicate<? super T> predicate, @NonNull Function<? super T, ? extends R> mappingFunction) Conditionally maps thesuccessful valueotherwise applying no changes.static <T extends R,E, R>
@NotNull Result<R,E> Result.Extensions.mapIfNot(@NonNull Result<? extends T, ? extends E> result, @NonNull Predicate<? super T> predicate, @NonNull Function<? super T, ? extends R> mappingFunction) Conditionally maps thesuccessful valueotherwise applying no changes.Result.nonNullError(@Any E error) Creates a newerror resultif the value is notnull.Result.nonNullSuccess(T value) Creates a newsuccessful resultif the value is notnull.static <T,E> @NotNull Result<T, @Nullable E> Result.nullError()Creates a newvoid-error result.static <T,E> @NotNull Result<@Nullable T, E> Result.nullSuccess()Creates a new successful result withnullvalue.Returns this result if this is asuccessful resultotherwise returning the given result.Maps the result if this is anerror resultreturning the result of mapping otherwise keeping thesuccessful result.Consumes the result if it issuccessfulreturning the same result.Consumes the result if it is anerror resultreturning the same result.static <T,E> @NotNull Result<T, E> Result.success(T value) Creates a new successful result.Result.Error.swap()Result.Success.swap()Result.swap()Swaps this result making anerror resultfrom asuccessful resultand asuccessful resultfrom anerror result.Creates a result by calling the specified callable.Deprecated.Result.tryGet(@NonNull ThrowingSupplier<? extends T, ? extends X> supplier, @NonNull Class<? super X> throwableType) Creates a result by getting the value of the specified supplier.Result.tryGet(@NonNull ThrowingSupplier<? extends T, ? extends X> supplier, @Nullable X @NonNull ... throwableTypeHint) Creates a result by getting the value of the specified supplier.Result.tryGetCatchAny(@NonNull ThrowingSupplier<? extends T, Throwable> supplier) Creates a result by getting the value of the specified supplier.Result.tryRun(@NonNull ThrowingRunnable<? extends X> runnable, @NonNull Class<? super X> throwableType) Creates a result by running the specified runnable.Result.tryRun(@NonNull ThrowingRunnable<? extends X> runnable, @Nullable X @NonNull ... throwableTypeHint) Creates a result by running the specified runnable.Result.tryRunCatchAny(@NonNull ThrowingRunnable<? extends Throwable> runnable) Creates a result by running the specified runnable.Converts the result to another result whose types are super-types of its current types.Methods in ru.progrm_jarvis.javacommons.object with parameters of type ResultModifier and TypeMethodDescriptionReturns the given result if this is asuccessful resultotherwise keeping theerror result.static <T> TEither returns the successful result's value ot the error result's value depending on what is present.static <T,E extends R, R>
@NotNull Result<T,R> Result.Extensions.mapErrorIf(@NonNull Result<? extends T, ? extends E> result, @NonNull Predicate<? super E> predicate, @NonNull Function<? super E, ? extends R> mappingFunction) Conditionally maps theerror valueotherwise applying no changes.static <T,E extends R, R>
@NotNull Result<T,R> Result.Extensions.mapErrorIfNot(@NonNull Result<? extends T, ? extends E> result, @NonNull Predicate<? super E> predicate, @NonNull Function<? super E, ? extends R> mappingFunction) Conditionally maps theerror valueotherwise applying no changes.static <T extends R,E, R>
@NotNull Result<R,E> Result.Extensions.mapIf(@NonNull Result<? extends T, ? extends E> result, @NonNull Predicate<? super T> predicate, @NonNull Function<? super T, ? extends R> mappingFunction) Conditionally maps thesuccessful valueotherwise applying no changes.static <T extends R,E, R>
@NotNull Result<R,E> Result.Extensions.mapIfNot(@NonNull Result<? extends T, ? extends E> result, @NonNull Predicate<? super T> predicate, @NonNull Function<? super T, ? extends R> mappingFunction) Conditionally maps thesuccessful valueotherwise applying no changes.Returns this result if this is asuccessful resultotherwise returning the given result.static <T,X extends Throwable>
TRethrows the exception if it is anerror result.Converts the result to another result whose types are super-types of its current types.Method parameters in ru.progrm_jarvis.javacommons.object with type arguments of type ResultModifier and TypeMethodDescriptionAlso known asandThen.Maps the result if this is anerror resultreturning the result of mapping otherwise keeping thesuccessful result. -
Uses of Result in ru.progrm_jarvis.javacommons.primitive
Methods in ru.progrm_jarvis.javacommons.primitive that return ResultModifier and TypeMethodDescriptionstatic @NotNull Result<@NotNull Integer,@NotNull IntegerParseError> NumberUtil.parseIntResult(@NonNull CharSequence possibleInteger) Parses a decimalintnumber.static @NotNull Result<@NotNull Integer,@NotNull IntegerParseError> NumberUtil.parseIntResult(@NonNull CharSequence possibleInteger, int radix) Parses anintnumber.static @NotNull Result<@NotNull Long,@NotNull IntegerParseError> NumberUtil.parseLongResult(@NonNull CharSequence possibleLong) Parses a decimallongnumber.static @NotNull Result<@NotNull Long,@NotNull IntegerParseError> NumberUtil.parseLongResult(@NonNull CharSequence possibleLong, int radix) Parses alongnumber. -
Uses of Result in ru.progrm_jarvis.javacommons.unsafe
Methods in ru.progrm_jarvis.javacommons.unsafe that return ResultModifier and TypeMethodDescriptionUnsafeInternals.staticFieldValue(@NonNull Field field) Gets the value of the static field usingUnsafeif it is possible. -
Uses of Result in ru.progrm_jarvis.javacommons.util.concurrent
Methods in ru.progrm_jarvis.javacommons.util.concurrent that return types with arguments of type ResultModifier and TypeMethodDescriptionstatic <F,S> @NotNull CompletableFuture<@NotNull Result<F, S>> CompletableFutures.eitherOf(@NonNull CompletableFuture<F> successFuture, @NonNull CompletableFuture<S> errorFuture) Returns the completable future whose result is the result of either the first or the second future wrapped in either asuccessful resultor anerror resultrespectively.
tryCall(Callable)