Interface RelativeAllocation

All Superinterfaces:
Allocation

public interface RelativeAllocation extends Allocation

Allocates a percentage of the Order total to a Payment Method.


Example to create an instance using the builder pattern

     RelativeAllocation relativeAllocation = RelativeAllocation.builder()
             .percentage(0.3)
             .build()
 
  • Field Details

  • Method Details

    • getPercentage

      @NotNull @NotNull Integer getPercentage()

      Percentage of the Order total allocated to the Payment Method. For example, 100 allocates the entire Order total.

      Returns:
      percentage
    • setPercentage

      void setPercentage(Integer percentage)

      Percentage of the Order total allocated to the Payment Method. For example, 100 allocates the entire Order total.

      Parameters:
      percentage - value to be set
    • of

      static RelativeAllocation of()
      factory method
      Returns:
      instance of RelativeAllocation
    • of

      static RelativeAllocation of(RelativeAllocation template)
      factory method to create a shallow copy RelativeAllocation
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • copyDeep

      RelativeAllocation copyDeep()
      Specified by:
      copyDeep in interface Allocation
    • deepCopy

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

      static RelativeAllocationBuilder builder()
      builder factory method for RelativeAllocation
      Returns:
      builder
    • builder

      static RelativeAllocationBuilder builder(RelativeAllocation template)
      create builder for RelativeAllocation instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withRelativeAllocation

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

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