Class BatchItems<T>

java.lang.Object
com.helixframework.api.contract.batch.BatchItems<T>
Type Parameters:
T - the type of items in the batch

public class BatchItems<T> extends Object
Represents a batch of items, containing a list of successful items and a list of failed items.
  • Constructor Details

    • BatchItems

      public BatchItems(List<T> success, List<BatchFailure> failure)
      Initializes a new instance of the BatchItems class with the specified lists of successful items and failed items.
      Parameters:
      success - a list of successful items
      failure - a list of failed items
  • Method Details

    • addSuccess

      public void addSuccess(T value)
      Adds a successful item to the batch.
      Parameters:
      value - the item to add
    • addSuccess

      public void addSuccess(Collection<T> values)
      Adds a collection of successful items to the batch.
      Parameters:
      values - the collection of successful items to add
    • addFailure

      public void addFailure(BatchFailure value)
      Adds a failure to the list of failed items in the batch.
      Parameters:
      value - the BatchFailure object representing the failure to be added
    • addFailure

      public void addFailure(Collection<BatchFailure> value)
      Adds a collection of failures to the batch.
      Parameters:
      value - the collection of failures to add
    • getSuccesses

      public List<T> getSuccesses()
      Retrieves a list of successful items from the batch.
      Returns:
      a list of successful items
    • getFailures

      public List<BatchFailure> getFailures()
      Retrieves a list of failed items from the batch.
      Returns:
      a list of failed items
    • getTotal

      public long getTotal()
      Returns the total count of items in the batch response. The getTotal method calculates the total count of items in the batch response by summing the number of successful items and the number of failed items. It does not
    • getSuccessTotal

      public long getSuccessTotal()
      Retrieves the total number of successful items in the batch.
      Returns:
      the total number of successful items
    • getFailureTotal

      public long getFailureTotal()
      Returns the total number of failed items in the batch.
      Returns:
      the total number of failed items