Class ReadRecordsResponse<P>

java.lang.Object
com.broadleafcommerce.common.dataexport.service.ReadRecordsResponse<P>
Type Parameters:
P - the type of the records that will be read

public final class ReadRecordsResponse<P> extends Object
A response returned by ExportProcessor.readRecordsToProcess(Export) indicating the results of attempting to read all of the records to process in an export.
Author:
Samarth Dhruva (samarthd)
See Also:
  • Method Details

    • success

      public static <P> ReadRecordsResponse<P> success(Stream<P> records)
    • failure

      public static <P> ReadRecordsResponse<P> failure(String errorMessage)
    • isSuccessful

      public boolean isSuccessful()
      True if the records were read successfully, false otherwise.
    • getRecords

      public Stream<P> getRecords()
      If successful is true, then this should contain all of the records in the data store that should be processed in the update, as described by ExportProcessor.readRecordsToProcess(Export).
    • getErrorMessage

      public String getErrorMessage()
      If successful is false, then this should contain a description of the error encountered when attempting to read the records. This will be used by ExportManager and set on the corresponding Export.
    • equals

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

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

      public String toString()
      Overrides:
      toString in class Object