Class DiscountCodeInfoBuilder

java.lang.Object
com.commercetools.history.models.common.DiscountCodeInfoBuilder
All Implemented Interfaces:
io.vrap.rmf.base.client.Builder<DiscountCodeInfo>

public class DiscountCodeInfoBuilder extends Object implements io.vrap.rmf.base.client.Builder<DiscountCodeInfo>
DiscountCodeInfoBuilder
Example to create an instance using the builder pattern

     DiscountCodeInfo discountCodeInfo = DiscountCodeInfo.builder()
             .discountCode(discountCodeBuilder -> discountCodeBuilder)
             .state(DiscountCodeState.NOT_ACTIVE)
             .build()
 
  • Constructor Details

    • DiscountCodeInfoBuilder

      public DiscountCodeInfoBuilder()
  • Method Details

    • discountCode

      set the value to the discountCode using the builder function
      Parameters:
      builder - function to build the discountCode value
      Returns:
      Builder
    • withDiscountCode

      public DiscountCodeInfoBuilder withDiscountCode(Function<ReferenceBuilder,Reference> builder)
      set the value to the discountCode using the builder function
      Parameters:
      builder - function to build the discountCode value
      Returns:
      Builder
    • discountCode

      public DiscountCodeInfoBuilder discountCode(Reference discountCode)
      set the value to the discountCode
      Parameters:
      discountCode - value to be set
      Returns:
      Builder
    • state

      set the value to the state
      Parameters:
      state - value to be set
      Returns:
      Builder
    • getDiscountCode

      public Reference getDiscountCode()
      value of discountCode}
      Returns:
      discountCode
    • getState

      public DiscountCodeState getState()
      value of state}
      Returns:
      state
    • build

      public DiscountCodeInfo build()
      builds DiscountCodeInfo with checking for non-null required values
      Specified by:
      build in interface io.vrap.rmf.base.client.Builder<DiscountCodeInfo>
      Returns:
      DiscountCodeInfo
    • buildUnchecked

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

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

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