Uses of Interface
cloud.opencode.base.functional.monad.Try
Packages that use Try
Package
Description
OpenCode Functional - Functional Programming Utilities for JDK 25+
OpenCode 函数式编程工具库
Async Utilities - Virtual Thread functional utilities
异步工具 - 虚拟线程函数式工具
Function Utilities - Advanced function operations
函数工具 - 高级函数操作
Monad Types - Functional containers for computation
Monad 类型 - 计算的函数式容器
Pipeline - Composable data transformation pipelines
管道 - 可组合的数据转换管道
Record Utilities - Functional utilities for Java Records
Record 工具 - Java Record 的函数式工具
-
Uses of Try in cloud.opencode.base.functional
Methods in cloud.opencode.base.functional that return TryModifier and TypeMethodDescriptionstatic <T> Try<T> OpenFunctional.asyncTimeout(Supplier<T> supplier, Duration timeout) Run async with timeout 带超时异步运行static <T> Try<T> Create a failed Try 创建失败的 Trystatic <T> Try<T> OpenFunctional.success(T value) Create a successful Try 创建成功的 Trystatic <T> Try<T> OpenFunctional.tryOf(CheckedSupplier<T> supplier) Create a Try from a supplier 从供应商创建 TryMethods in cloud.opencode.base.functional that return types with arguments of type TryModifier and TypeMethodDescriptionOpenFunctional.liftTry(CheckedFunction<T, R> f) Lift a checked function to return Try 将可抛异常函数提升为返回 Try -
Uses of Try in cloud.opencode.base.functional.async
Methods in cloud.opencode.base.functional.async that return TryModifier and TypeMethodDescriptionstatic <T> Try<T> AsyncFunctionUtil.asyncWithTimeout(Supplier<T> supplier, Duration timeout) Run a supplier asynchronously with timeout 带超时异步运行供应商Future.await()Await the result, returning a Try.Await the result with timeout, returning a Try.AsyncFunctionUtil.awaitAll(List<CompletableFuture<T>> futures) Wait for all futures to complete 等待所有 Future 完成AsyncFunctionUtil.awaitAll(List<CompletableFuture<T>> futures, Duration timeout) Wait for all futures with timeout 带超时等待所有 FutureGet the result with timeout 带超时获取结果AsyncFunctionUtil.parallelMapTry(List<T> items, Function<T, R> mapper) Map a function over a list in parallel with error handling 并行地将函数映射到列表,带错误处理Future.toTry()Convert to Try.LazyAsync.toTry()Get the result as Try (blocking) 获取结果为 Try(阻塞) -
Uses of Try in cloud.opencode.base.functional.function
Methods in cloud.opencode.base.functional.function that return types with arguments of type TryModifier and TypeMethodDescriptionstatic <T,U, R> BiFunction <T, U, Try<R>> FunctionUtil.liftBiTry(CheckedBiFunction<T, U, R> f) Lift a checked bi-function to return Try instead of throwing 将受检双参函数提升为返回 Try 而非抛出异常FunctionUtil.liftTry(CheckedFunction<T, R> f) Lift a checked function to return Try instead of throwing 将受检函数提升为返回 Try 而非抛出异常 -
Uses of Try in cloud.opencode.base.functional.monad
Classes in cloud.opencode.base.functional.monad that implement TryModifier and TypeClassDescriptionstatic final classTry.Failure<T>Failure - Represents a failed computation Failure - 表示失败的计算static final classTry.Success<T>Success - Represents a successful computation Success - 表示成功的计算Methods in cloud.opencode.base.functional.monad that return TryModifier and TypeMethodDescriptionTry.andFinally(Runnable action) Execute action regardless of success or failure, similar to try-finally semantics.static <T> Try<T> Create a Failure with exception 创建失败结果Filter the value with a predicate 使用谓词过滤值<U> Try<U> <U> Try<U> Transform the value to another Try if Success 如果成功则转换为另一个 Try<U> Try<U> <U> Try<U> <U> Try<U> Transform the value if Success 如果成功则转换值<U> Try<U> Try.Failure.mapFailure(Function<Throwable, ? extends Throwable> mapper) Try.mapFailure(Function<Throwable, ? extends Throwable> mapper) Transform the exception if this is a Failure.static <T> Try<T> Try.of(CheckedSupplier<T> supplier) Execute a computation that may fail 执行可能失败的计算Execute action on failure 失败时执行操作Execute action on success 成功时执行操作Return this or other Try if Failure 返回本 Try 或其他 Try(如果失败)Execute action on the value if Success 如果成功则对值执行操作Recover from Failure with a function 使用函数从失败恢复Try.Failure.recoverWith(Function<Throwable, Try<T>> recovery) Try.recoverWith(Function<Throwable, Try<T>> recovery) Recover from Failure with a function returning Try 使用返回 Try 的函数从失败恢复Try.Success.recoverWith(Function<Throwable, Try<T>> recovery) static <T> Try<T> Try.success(T value) Create a Success with value 创建成功结果Either.Left.toTry()Either.Right.toTry()Either.toTry()Convert to Try: Right becomes Success, Left becomes Failure.Lazy.toTry()Convert to Try 转换为 TryConvert to Try.Trampoline.toTry()Convert to a Try that captures exceptions.Validation.toTry()Convert to Try monad 转换为 Try 单子<R> Try<R> <R> Try<R> For.TryFor2.yield(BiFunction<? super T1, ? super T2, ? extends R> mapper) <R> Try<R> For.TryFor3.yield(For.Function3<? super T1, ? super T2, ? super T3, ? extends R> mapper) <R> Try<R> For.TryFor4.yield(For.Function4<? super T1, ? super T2, ? super T3, ? super T4, ? extends R> mapper) Methods in cloud.opencode.base.functional.monad with parameters of type TryModifier and TypeMethodDescription<T2> For.TryFor2<T1, T2> <T3> For.TryFor3<T1, T2, T3> <T4> For.TryFor4<T1, T2, T3, T4> static <T> For.TryFor1<T> Start a for-comprehension with a Try.Return this or other Try if Failure 返回本 Try 或其他 Try(如果失败)Method parameters in cloud.opencode.base.functional.monad with type arguments of type TryModifier and TypeMethodDescription<T2> For.TryFor2<T1, T2> <U> Try<U> <U> Try<U> Transform the value to another Try if Success 如果成功则转换为另一个 Try<U> Try<U> Try.Failure.recoverWith(Function<Throwable, Try<T>> recovery) Try.recoverWith(Function<Throwable, Try<T>> recovery) Recover from Failure with a function returning Try 使用返回 Try 的函数从失败恢复Try.Success.recoverWith(Function<Throwable, Try<T>> recovery) -
Uses of Try in cloud.opencode.base.functional.pipeline
Methods in cloud.opencode.base.functional.pipeline that return TryModifier and TypeMethodDescriptionApply the pipeline safely, returning Try 安全地应用管道,返回 TryPipeline.TryPipelineBuilder.executeTry()Execute and get the Try result 执行并获取 Try 结果Method parameters in cloud.opencode.base.functional.pipeline with type arguments of type TryModifier and TypeMethodDescription<R> Pipeline.TryPipelineBuilder<R> Transform with another Try-returning function 使用另一个返回 Try 的函数转换 -
Uses of Try in cloud.opencode.base.functional.record
Methods in cloud.opencode.base.functional.record that return TryModifier and TypeMethodDescriptionRecordUtil.fromMapTry(Class<R> recordClass, Map<String, Object> map) Create record from Map as Try 从 Map 创建 record 作为 Trystatic <T> Try<T> RecordUtil.getComponentTry(Record record, String componentName) Get component value as Try 获取组件值为 TryConvert record to Map as Try 将 record 转换为 Map 作为 Try