Class CartReferenceBuilder

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

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

     CartReference cartReference = CartReference.builder()
             .id("{id}")
             .build()
 
  • Constructor Details

    • CartReferenceBuilder

      public CartReferenceBuilder()
  • Method Details

    • id

      public CartReferenceBuilder id(String id)

      Unique identifier of the referenced Cart.

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

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

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

      public CartReferenceBuilder withObj(Function<CartBuilder,Cart> builder)

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

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

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

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

      public String getId()

      Unique identifier of the referenced Cart.

      Returns:
      id
    • getObj

      @Nullable public Cart getObj()

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

      Returns:
      obj
    • build

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

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

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

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