Class CartDiscountReferenceBuilder

java.lang.Object
com.commercetools.api.models.cart_discount.CartDiscountReferenceBuilder
All Implemented Interfaces:
Builder<CartDiscountReference>

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

     CartDiscountReference cartDiscountReference = CartDiscountReference.builder()
             .id("{id}")
             .build()
 
  • Constructor Details

    • CartDiscountReferenceBuilder

      public CartDiscountReferenceBuilder()
  • Method Details

    • id

      Unique identifier of the referenced CartDiscount.

      Parameters:
      id - value to be set
      Returns:
      Builder
    • obj

      Contains the representation of the expanded CartDiscount. Only present in responses to requests with Reference Expansion for CartDiscounts.

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

      Contains the representation of the expanded CartDiscount. Only present in responses to requests with Reference Expansion for CartDiscounts.

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

      Contains the representation of the expanded CartDiscount. Only present in responses to requests with Reference Expansion for CartDiscounts.

      Parameters:
      obj - value to be set
      Returns:
      Builder
    • getId

      public String getId()

      Unique identifier of the referenced CartDiscount.

      Returns:
      id
    • getObj

      @Nullable public CartDiscount getObj()

      Contains the representation of the expanded CartDiscount. Only present in responses to requests with Reference Expansion for CartDiscounts.

      Returns:
      obj
    • build

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

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

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

      create builder for CartDiscountReference instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder