Class CartResourceIdentifierBuilder

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

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

     CartResourceIdentifier cartResourceIdentifier = CartResourceIdentifier.builder()
             .build()
 
  • Constructor Details

    • CartResourceIdentifierBuilder

      public CartResourceIdentifierBuilder()
  • Method Details

    • id

      Unique identifier of the referenced Cart. Required if key is absent.

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

      User-defined unique identifier of the referenced Cart. Required if id is absent.

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

      @Nullable public String getId()

      Unique identifier of the referenced Cart. Required if key is absent.

      Returns:
      id
    • getKey

      @Nullable public String getKey()

      User-defined unique identifier of the referenced Cart. Required if id is absent.

      Returns:
      key
    • build

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

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

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

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