Class RelativeAllocationBuilder

java.lang.Object
com.commercetools.api.models.cart.RelativeAllocationBuilder
All Implemented Interfaces:
Builder<RelativeAllocation>

public class RelativeAllocationBuilder extends Object implements Builder<RelativeAllocation>
RelativeAllocationBuilder
Example to create an instance using the builder pattern

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

    • RelativeAllocationBuilder

      public RelativeAllocationBuilder()
  • Method Details

    • percentage

      public RelativeAllocationBuilder percentage(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
      Returns:
      Builder
    • getPercentage

      public Integer getPercentage()

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

      Returns:
      percentage
    • build

      public RelativeAllocation build()
      builds RelativeAllocation with checking for non-null required values
      Specified by:
      build in interface Builder<RelativeAllocation>
      Returns:
      RelativeAllocation
    • buildUnchecked

      public RelativeAllocation buildUnchecked()
      builds RelativeAllocation without checking for non-null required values
      Returns:
      RelativeAllocation
    • of

      public static RelativeAllocationBuilder of()
      factory method for an instance of RelativeAllocationBuilder
      Returns:
      builder
    • of

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