Class SubRateBuilder

java.lang.Object
com.commercetools.importapi.models.prices.SubRateBuilder
All Implemented Interfaces:
Builder<SubRate>

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

     SubRate subRate = SubRate.builder()
             .name("{name}")
             .amount(0.3)
             .build()
 
  • Constructor Details

    • SubRateBuilder

      public SubRateBuilder()
  • Method Details

    • name

      public SubRateBuilder name(String name)
      set the value to the name
      Parameters:
      name - value to be set
      Returns:
      Builder
    • amount

      public SubRateBuilder amount(Double amount)
      set the value to the amount
      Parameters:
      amount - value to be set
      Returns:
      Builder
    • getName

      public String getName()
      value of name}
      Returns:
      name
    • getAmount

      public Double getAmount()
      value of amount}
      Returns:
      amount
    • build

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

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

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

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