Uses of Interface
cloud.opencode.base.core.result.Result
Packages that use Result
Package
Description
Concurrency primitives and synchronization utilities.
Result and response wrapper types for operation outcomes.
-
Uses of Result in cloud.opencode.base.core.concurrent
Methods in cloud.opencode.base.core.concurrent that return types with arguments of type ResultModifier and TypeMethodDescriptionVirtualTasks.invokeAllSettled(List<Callable<T>> tasks) Execute all tasks and collect every result asResult.success(Object)orResult.failure(Throwable).VirtualTasks.invokeAllSettled(List<Callable<T>> tasks, Duration timeout) Execute all tasks with a timeout and collect every result asResult. -
Uses of Result in cloud.opencode.base.core.result
Classes in cloud.opencode.base.core.result that implement ResultModifier and TypeClassDescriptionstatic final recordFailure - Represents a failed computation result Failure - 表示失败的计算结果static final recordSuccess - Represents a successful computation result Success - 表示成功的计算结果Methods in cloud.opencode.base.core.result that return ResultModifier and TypeMethodDescriptionstatic <T> Result<T> Create a failed Result with the given cause 创建包含给定原因的失败 Result<U> Result<U> <U> Result<U> Transform the success value to another Result.<U> Result<U> <U> Result<U> <U> Result<U> Transform the success value.<U> Result<U> static <T> Result<T> Result.of(CheckedSupplier<T> supplier) Create a Result by executing a CheckedSupplier, catching any exception as Failure 通过执行 CheckedSupplier 创建 Result,捕获任何异常为 FailureExecute action on Success value 对成功值执行操作Result.Failure.peekFailure(Consumer<? super Throwable> action) Result.peekFailure(Consumer<? super Throwable> action) Execute action on Failure cause 对失败原因执行操作Result.Success.peekFailure(Consumer<? super Throwable> action) Recover from a Failure by applying a function to the cause 通过对原因应用函数来从 Failure 恢复Result.Failure.recoverWith(Function<? super Throwable, Result<T>> recoverer) Result.recoverWith(Function<? super Throwable, Result<T>> recoverer) Recover from a Failure by applying a function that returns a Result 通过应用返回 Result 的函数来从 Failure 恢复Result.Success.recoverWith(Function<? super Throwable, Result<T>> recoverer) static <T> Result<T> Result.success(T value) Create a successful Result with the given value 创建包含给定值的成功 ResultResult.successVoid()Create a successful Result<Void> with null value, for side-effect-only operations 创建值为 null 的成功 Result<Void>,用于仅副作用操作Either.Left.toResult()Either.Right.toResult()Either.toResult()Convert to Result.Convert to Result with a type-safe left-to-throwable conversion function.Method parameters in cloud.opencode.base.core.result with type arguments of type ResultModifier and TypeMethodDescription<U> Result<U> <U> Result<U> Transform the success value to another Result.<U> Result<U> Result.Failure.recoverWith(Function<? super Throwable, Result<T>> recoverer) Result.recoverWith(Function<? super Throwable, Result<T>> recoverer) Recover from a Failure by applying a function that returns a Result 通过应用返回 Result 的函数来从 Failure 恢复Result.Success.recoverWith(Function<? super Throwable, Result<T>> recoverer)