Class ConversionUtils.ConversionResponse<T>

java.lang.Object
com.broadleafcommerce.common.dataimport.util.ConversionUtils.ConversionResponse<T>
Enclosing class:
ConversionUtils

public static final class ConversionUtils.ConversionResponse<T> extends Object
A response indicating the results of attempting to convert a BatchRecord to a target type.
  • Constructor Details

    • ConversionResponse

      public ConversionResponse(boolean successful, @Nullable T converted, @Nullable String errorMessage)
    • ConversionResponse

      public ConversionResponse(boolean successful, @Nullable T converted, @Nullable String errorMessage, @Nullable com.broadleafcommerce.data.tracking.core.type.OperationType operationType)
  • Method Details

    • success

      public static <T> ConversionUtils.ConversionResponse<T> success(T converted)
    • success

      public static <T> ConversionUtils.ConversionResponse<T> success(T converted, com.broadleafcommerce.data.tracking.core.type.OperationType operation)
    • error

      public static <T> ConversionUtils.ConversionResponse<T> error(String errorMessage)
    • isSuccessful

      public boolean isSuccessful()
      True if the conversion happened successfully, false otherwise.
    • getConverted

      @Nullable public T getConverted()
      If successful is true, this field will hold the successfully converted value. If successful is false, this value will be null.
    • getErrorMessage

      @Nullable public String getErrorMessage()
      If successful is false, this field will hold the error message describing the problem. If successful is true, this value will be null.
    • getOperationType

      @Nullable public com.broadleafcommerce.data.tracking.core.type.OperationType getOperationType()
      In many cases, the converter itself may be responsible for determining the OperationType that needs to be performed for the given entity in the import. This field allows converters to pass this information back to the caller.
    • 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