java.lang.Object
com.broadleafcommerce.common.dataimport.messaging.BatchRecord

public class BatchRecord extends Object
A logical record from the a flat file. This could have spanned multiple records from the flat file if the logical "parent" record has dependents located within.
Author:
Phillip Verheyden (phillipuniverse)
  • Constructor Details

  • Method Details

    • addDependent

      public BatchRecord addDependent(BatchRecord dependent)
      Adds a new dependent to this record
      Parameters:
      dependent - record that is a dependent of this one
      Returns:
      this parent record
    • getLineNumber

      public long getLineNumber()
      The line number in the original data file that this item appears in. The numbering does not exclude any header lines at the start of the file. For instance, this generally means that all items in a CSV import will have a line number greater than or equal to 2, since line number 1 is the header line.
    • getCorrelationId

      public String getCorrelationId()
      Identifier that allows the resource tier to map back responses to a record within the batch
    • getRecordType

      public String getRecordType()
      In a multi-typed record file this holds the specific information of what was parsed out from the line in the file. For example in a product import there are PRODUCT, VARIANT, INCLUDED_PRODUCT
    • getOperation

      public OperationType getOperation()
      What operation should be performed on this record. If this is an OperationType.CREATE then consult resourceTierIdentifier for what should be assigned to this record at the resource tier
    • getResourceTierIdentifier

      @Nullable public String getResourceTierIdentifier()
      The identifier for this record at the resource tier In the case of an OperationType.UPDATE or OperationType.DELETE then this is supplied up front within the original upload. In the case of OperationType.CREATE then this is a generated id, or something that was mapped in via transformation from a correlation id
    • getRow

      public Map<String,String> getRow()
      The row of data parsed out from the flat file. Other pieces of the row in the file (such as record type and correlationId) are parsed out of this row and into other properties of this record
    • getDependents

      public List<BatchRecord> getDependents()
      Items that should be conceptually linked to the parent record that represents this item
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object