Class DiscountCodeInfoBuilder

java.lang.Object
com.commercetools.importapi.models.orders.DiscountCodeInfoBuilder
All Implemented Interfaces:
Builder<DiscountCodeInfo>

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

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

    • DiscountCodeInfoBuilder

      public DiscountCodeInfoBuilder()
  • Method Details

    • discountCode

      References a DiscountCode by key. If the referenced DiscountCode does not exist, the state of the ImportOperation will be set to unresolved until the referenced DiscountCode is created.

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

      References a DiscountCode by key. If the referenced DiscountCode does not exist, the state of the ImportOperation will be set to unresolved until the referenced DiscountCode is created.

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

      public DiscountCodeInfoBuilder discountCode(DiscountCodeKeyReference discountCode)

      References a DiscountCode by key. If the referenced DiscountCode does not exist, the state of the ImportOperation will be set to unresolved until the referenced DiscountCode is created.

      Parameters:
      discountCode - value to be set
      Returns:
      Builder
    • state

      public DiscountCodeInfoBuilder state(@Nullable DiscountCodeState state)

      Maps to DiscountCodeInfo.state

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

      public DiscountCodeKeyReference getDiscountCode()

      References a DiscountCode by key. If the referenced DiscountCode does not exist, the state of the ImportOperation will be set to unresolved until the referenced DiscountCode is created.

      Returns:
      discountCode
    • getState

      @Nullable public DiscountCodeState getState()

      Maps to DiscountCodeInfo.state

      Returns:
      state
    • build

      public DiscountCodeInfo build()
      builds DiscountCodeInfo with checking for non-null required values
      Specified by:
      build in interface 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