Class BatchResult.Builder

java.lang.Object
cloud.opencode.base.io.batch.BatchResult.Builder
Enclosing class:
BatchResult

public static class BatchResult.Builder extends Object
BatchResult Builder 批量结果构建器
Since:
JDK 25, opencode-base-io V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Constructor Details

    • Builder

      public Builder(String operation)
  • Method Details

    • success

      public BatchResult.Builder success()
      Record a success 记录成功
      Returns:
      this builder | 构建器
    • failure

      public BatchResult.Builder failure(Path path, Throwable error)
      Record a failure 记录失败
      Parameters:
      path - the failed path | 失败路径
      error - the exception | 异常
      Returns:
      this builder | 构建器
    • skipped

      public BatchResult.Builder skipped()
      Record a skip 记录跳过
      Returns:
      this builder | 构建器
    • incrementSuccess

      public void incrementSuccess()
      Increment success count atomically 原子递增成功计数
    • recordFailure

      public void recordFailure(Path path, Throwable error)
      Record failure atomically 原子记录失败
      Parameters:
      path - the failed path | 失败路径
      error - the exception | 异常
    • incrementSkipped

      public void incrementSkipped()
      Increment skip count atomically 原子递增跳过计数
    • build

      public BatchResult build()
      Build the result 构建结果
      Returns:
      batch result | 批量结果