Class BatchCompletionRecordUtils

java.lang.Object
com.broadleafcommerce.common.dataimport.util.BatchCompletionRecordUtils

public final class BatchCompletionRecordUtils extends Object
Author:
Phillip Verheyden (phillipuniverse)
  • Method Details

    • allSuccess

      public static List<BatchCompletionRecord> allSuccess(List<BatchRecord> from)
      Converts all of the given BatchRecords and dependents to successful completions
      Parameters:
      from - records to convert from
      Returns:
      flattened set of completions for the records and all their dependents
    • allErrored

      public static List<BatchCompletionRecord> allErrored(List<BatchRecord> from, String errorMessage)
      Converts all of the given BatchRecords and dependents to errorred completions
      Parameters:
      from - records to convert from
      errorMessage - the errorMessage to give to all of the completions
      Returns:
      flattened set of completions for the records and all their dependents
    • success

      public static BatchCompletionRecord success(BatchRecord original)
      Creates a successful completion from the original record. Does not do anything with the dependents
      Parameters:
      original - record to convert to a completion
      Returns:
      the successful completion
    • error

      public static BatchCompletionRecord error(BatchRecord original, String errorMessage)
      Creates a successful completion from the original record. Does not do anything with the dependents
      Parameters:
      original - record to convert to a completion
      errorMessage - erroMessage to give to the errored completion
      Returns:
      the errored completion