Class BatchResponse.Builder<T>

java.lang.Object
com.helixframework.api.contract.batch.BatchResponse.Builder<T>
Type Parameters:
T - the type of the success items in the response
Enclosing class:
BatchResponse<T>

public static class BatchResponse.Builder<T> extends Object
Builder class for creating BatchResponse objects.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • success

      public BatchResponse.Builder<T> success(T success)
      Adds a success item to the batch response.
      Parameters:
      success - the success item to be added
      Returns:
      the builder object
    • success

      public BatchResponse.Builder<T> success(Collection<T> successes)
      Adds a collection of success items to the batch response builder.
      Parameters:
      successes - the collection of success items to be added
      Returns:
      the builder object
    • failure

      public BatchResponse.Builder<T> failure(BatchFailure failure)
      Adds a failure item to the batch response.
      Parameters:
      failure - the failure item to be added
      Returns:
      the builder object
    • failure

      public BatchResponse.Builder<T> failure(Collection<BatchFailure> failures)
      Adds a collection of failure items to the batch response builder.
      Parameters:
      failures - the collection of failure items to be added
      Returns:
      the builder object
    • build

      public BatchResponse<?> build()
      Builds a new instance of BatchResponse using the success and failure items added to the builder.
      Returns:
      a new instance of BatchResponse