Class QuoteRequestDraftBuilder

java.lang.Object
com.commercetools.api.models.quote_request.QuoteRequestDraftBuilder
All Implemented Interfaces:
Builder<QuoteRequestDraft>

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

     QuoteRequestDraft quoteRequestDraft = QuoteRequestDraft.builder()
             .cart(cartBuilder -> cartBuilder)
             .cartVersion(0.3)
             .build()
 
  • Constructor Details

    • QuoteRequestDraftBuilder

      public QuoteRequestDraftBuilder()
  • Method Details

    • cart

      Cart for which a Quote is requested. Anonymous Carts, Carts with Discount Codes, and Carts with Multiple ShippingMode are not supported. The Cart must have a shippingAddress defined, otherwise an InvalidOperation error is returned when creating a Quote Request.

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

      Cart for which a Quote is requested. Anonymous Carts, Carts with Discount Codes, and Carts with Multiple ShippingMode are not supported. The Cart must have a shippingAddress defined, otherwise an InvalidOperation error is returned when creating a Quote Request.

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

      Cart for which a Quote is requested. Anonymous Carts, Carts with Discount Codes, and Carts with Multiple ShippingMode are not supported. The Cart must have a shippingAddress defined, otherwise an InvalidOperation error is returned when creating a Quote Request.

      Parameters:
      cart - value to be set
      Returns:
      Builder
    • cartVersion

      public QuoteRequestDraftBuilder cartVersion(Long cartVersion)

      Current version of the referenced Cart.

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

      User-defined unique identifier for the QuoteRequest.

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

      public QuoteRequestDraftBuilder comment(@Nullable String comment)

      Message from the Buyer included in the Quote Request.

      Parameters:
      comment - value to be set
      Returns:
      Builder
    • custom

      Custom Fields to be added to the Quote Request.

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

      Custom Fields to be added to the Quote Request.

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

      Custom Fields to be added to the Quote Request.

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

      State of the Quote Request. This reference can point to a State in a custom workflow.

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

      State of the Quote Request. This reference can point to a State in a custom workflow.

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

      State of the Quote Request. This reference can point to a State in a custom workflow.

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

      public QuoteRequestDraftBuilder purchaseOrderNumber(@Nullable String purchaseOrderNumber)

      Identifier for a purchase order, usually in a B2B context. The Purchase Order Number is typically entered by the Buyer.

      Parameters:
      purchaseOrderNumber - value to be set
      Returns:
      Builder
    • getCart

      public CartResourceIdentifier getCart()

      Cart for which a Quote is requested. Anonymous Carts, Carts with Discount Codes, and Carts with Multiple ShippingMode are not supported. The Cart must have a shippingAddress defined, otherwise an InvalidOperation error is returned when creating a Quote Request.

      Returns:
      cart
    • getCartVersion

      public Long getCartVersion()

      Current version of the referenced Cart.

      Returns:
      cartVersion
    • getKey

      @Nullable public String getKey()

      User-defined unique identifier for the QuoteRequest.

      Returns:
      key
    • getComment

      @Nullable public String getComment()

      Message from the Buyer included in the Quote Request.

      Returns:
      comment
    • getCustom

      @Nullable public CustomFieldsDraft getCustom()

      Custom Fields to be added to the Quote Request.

      Returns:
      custom
    • getState

      @Nullable public StateReference getState()

      State of the Quote Request. This reference can point to a State in a custom workflow.

      Returns:
      state
    • getPurchaseOrderNumber

      @Nullable public String getPurchaseOrderNumber()

      Identifier for a purchase order, usually in a B2B context. The Purchase Order Number is typically entered by the Buyer.

      Returns:
      purchaseOrderNumber
    • build

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

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

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

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