Interface SetDiscountOnTotalPriceChange

All Superinterfaces:
Change

public interface SetDiscountOnTotalPriceChange extends Change

Change triggered by the Add DiscountCode, Remove DiscountCode, Add LineItem, or Remove LineItem update action.


Example to create an instance using the builder pattern

     SetDiscountOnTotalPriceChange setDiscountOnTotalPriceChange = SetDiscountOnTotalPriceChange.builder()
             .change("{change}")
             .previousValue(previousValueBuilder -> previousValueBuilder)
             .nextValue(nextValueBuilder -> nextValueBuilder)
             .build()
 
  • Field Details

    • SET_DISCOUNT_ON_TOTAL_PRICE_CHANGE

      static final String SET_DISCOUNT_ON_TOTAL_PRICE_CHANGE
      discriminator value for SetDiscountOnTotalPriceChange
      See Also:
  • Method Details

    • getChange

      @NotNull @NotNull String getChange()
      Description copied from interface: Change

      Type of change on a resource that is similar to the update action it relates to, where possible. It is not a unique identifier for the data structure, for example, the setDescription change can occur with a localized and non-localized representation.

      Records can be filtered by this value using the changes query parameter.

      Specified by:
      getChange in interface Change
      Returns:
      change
    • getType

      @NotNull @NotNull String getType()
      Description copied from interface: Change

      Unique discriminator value to reliably deserialize the data type.

      Specified by:
      getType in interface Change
      Returns:
      type
    • getPreviousValue

      @NotNull @Valid @NotNull @Valid DiscountOnTotalPrice getPreviousValue()

      Value before the change.

      Returns:
      previousValue
    • getNextValue

      @NotNull @Valid @NotNull @Valid DiscountOnTotalPrice getNextValue()

      Value after the change.

      Returns:
      nextValue
    • setChange

      void setChange(String change)
      set change
      Specified by:
      setChange in interface Change
      Parameters:
      change - value to be set
    • setPreviousValue

      void setPreviousValue(DiscountOnTotalPrice previousValue)

      Value before the change.

      Parameters:
      previousValue - value to be set
    • setNextValue

      void setNextValue(DiscountOnTotalPrice nextValue)

      Value after the change.

      Parameters:
      nextValue - value to be set
    • of

      factory method
      Returns:
      instance of SetDiscountOnTotalPriceChange
    • of

      factory method to create a shallow copy SetDiscountOnTotalPriceChange
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • copyDeep

      Specified by:
      copyDeep in interface Change
    • deepCopy

      @Nullable static SetDiscountOnTotalPriceChange deepCopy(@Nullable SetDiscountOnTotalPriceChange template)
      factory method to create a deep copy of SetDiscountOnTotalPriceChange
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      builder factory method for SetDiscountOnTotalPriceChange
      Returns:
      builder
    • builder

      create builder for SetDiscountOnTotalPriceChange instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withSetDiscountOnTotalPriceChange

      default <T> T withSetDiscountOnTotalPriceChange(Function<SetDiscountOnTotalPriceChange,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<SetDiscountOnTotalPriceChange> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference