Class StagedQuoteBuilder

java.lang.Object
com.commercetools.api.models.staged_quote.StagedQuoteBuilder
All Implemented Interfaces:
Builder<StagedQuote>

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

     StagedQuote stagedQuote = StagedQuote.builder()
             .id("{id}")
             .version(0.3)
             .createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .stagedQuoteState(StagedQuoteState.IN_PROGRESS)
             .quoteRequest(quoteRequestBuilder -> quoteRequestBuilder)
             .quotationCart(quotationCartBuilder -> quotationCartBuilder)
             .build()
 
  • Constructor Details

    • StagedQuoteBuilder

      public StagedQuoteBuilder()
  • Method Details

    • id

      public StagedQuoteBuilder id(String id)

      The unique ID of the StagedQuote.

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

      public StagedQuoteBuilder version(Long version)

      Current version of the StagedQuote.

      Parameters:
      version - value to be set
      Returns:
      Builder
    • createdAt

      public StagedQuoteBuilder createdAt(ZonedDateTime createdAt)

      Date and time (UTC) the StagedQuote was initially created.

      Parameters:
      createdAt - value to be set
      Returns:
      Builder
    • lastModifiedAt

      public StagedQuoteBuilder lastModifiedAt(ZonedDateTime lastModifiedAt)

      Date and time (UTC) the StagedQuote was last updated.

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

      public StagedQuoteBuilder key(@Nullable String key)

      User-specific unique identifier of the staged quote.

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

      IDs and references that last modified the StagedQuote.

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

      public StagedQuoteBuilder withLastModifiedBy(Function<LastModifiedByBuilder,LastModifiedBy> builder)

      IDs and references that last modified the StagedQuote.

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

      public StagedQuoteBuilder lastModifiedBy(@Nullable LastModifiedBy lastModifiedBy)

      IDs and references that last modified the StagedQuote.

      Parameters:
      lastModifiedBy - value to be set
      Returns:
      Builder
    • createdBy

      IDs and references that created the StagedQuote.

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

      public StagedQuoteBuilder withCreatedBy(Function<CreatedByBuilder,CreatedBy> builder)

      IDs and references that created the StagedQuote.

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

      public StagedQuoteBuilder createdBy(@Nullable CreatedBy createdBy)

      IDs and references that created the StagedQuote.

      Parameters:
      createdBy - value to be set
      Returns:
      Builder
    • stagedQuoteState

      public StagedQuoteBuilder stagedQuoteState(StagedQuoteState stagedQuoteState)

      Predefined states tracking the status of the Staged Quote.

      Parameters:
      stagedQuoteState - value to be set
      Returns:
      Builder
    • customer

      The Buyer who requested the Quote.

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

      The Buyer who requested the Quote.

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

      public StagedQuoteBuilder customer(@Nullable CustomerReference customer)

      The Buyer who requested the Quote.

      Parameters:
      customer - value to be set
      Returns:
      Builder
    • quoteRequest

      Quote Request related to the Staged Quote.

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

      Quote Request related to the Staged Quote.

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

      public StagedQuoteBuilder quoteRequest(QuoteRequestReference quoteRequest)

      Quote Request related to the Staged Quote.

      Parameters:
      quoteRequest - value to be set
      Returns:
      Builder
    • quotationCart

      Cart containing the offered items. May contain either DirectDiscounts or CartDiscounts.

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

      public StagedQuoteBuilder withQuotationCart(Function<CartReferenceBuilder,CartReference> builder)

      Cart containing the offered items. May contain either DirectDiscounts or CartDiscounts.

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

      public StagedQuoteBuilder quotationCart(CartReference quotationCart)

      Cart containing the offered items. May contain either DirectDiscounts or CartDiscounts.

      Parameters:
      quotationCart - value to be set
      Returns:
      Builder
    • validTo

      public StagedQuoteBuilder validTo(@Nullable ZonedDateTime validTo)

      Expiration date for the Quote. Once a Quote expires, it cannot be ordered.

      Parameters:
      validTo - value to be set
      Returns:
      Builder
    • sellerComment

      public StagedQuoteBuilder sellerComment(@Nullable String sellerComment)

      Message from the Seller included in the offer.

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

      Custom Fields of the Staged Quote.

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

      Custom Fields of the Staged Quote.

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

      public StagedQuoteBuilder custom(@Nullable CustomFields custom)

      Custom Fields of the Staged Quote.

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

      State of the Staged Quote. 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 Staged Quote. This reference can point to a State in a custom workflow.

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

      public StagedQuoteBuilder state(@Nullable StateReference state)

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

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

      public StagedQuoteBuilder purchaseOrderNumber(@Nullable String purchaseOrderNumber)

      The Purchase Order Number is typically set by the Buyer on a QuoteRequest to track the purchase order during the quote and order flow.

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

      The BusinessUnit for the Staged Quote. Only available for B2B-enabled Projects.

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

      The BusinessUnit for the Staged Quote. Only available for B2B-enabled Projects.

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

      public StagedQuoteBuilder businessUnit(@Nullable BusinessUnitKeyReference businessUnit)

      The BusinessUnit for the Staged Quote. Only available for B2B-enabled Projects.

      Parameters:
      businessUnit - value to be set
      Returns:
      Builder
    • store

      The Store to which the Buyer belongs.

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

      The Store to which the Buyer belongs.

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

      public StagedQuoteBuilder store(@Nullable StoreKeyReference store)

      The Store to which the Buyer belongs.

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

      public String getId()

      The unique ID of the StagedQuote.

      Returns:
      id
    • getVersion

      public Long getVersion()

      Current version of the StagedQuote.

      Returns:
      version
    • getCreatedAt

      public ZonedDateTime getCreatedAt()

      Date and time (UTC) the StagedQuote was initially created.

      Returns:
      createdAt
    • getLastModifiedAt

      public ZonedDateTime getLastModifiedAt()

      Date and time (UTC) the StagedQuote was last updated.

      Returns:
      lastModifiedAt
    • getKey

      @Nullable public String getKey()

      User-specific unique identifier of the staged quote.

      Returns:
      key
    • getLastModifiedBy

      @Nullable public LastModifiedBy getLastModifiedBy()

      IDs and references that last modified the StagedQuote.

      Returns:
      lastModifiedBy
    • getCreatedBy

      @Nullable public CreatedBy getCreatedBy()

      IDs and references that created the StagedQuote.

      Returns:
      createdBy
    • getStagedQuoteState

      public StagedQuoteState getStagedQuoteState()

      Predefined states tracking the status of the Staged Quote.

      Returns:
      stagedQuoteState
    • getCustomer

      @Nullable public CustomerReference getCustomer()

      The Buyer who requested the Quote.

      Returns:
      customer
    • getQuoteRequest

      public QuoteRequestReference getQuoteRequest()

      Quote Request related to the Staged Quote.

      Returns:
      quoteRequest
    • getQuotationCart

      public CartReference getQuotationCart()

      Cart containing the offered items. May contain either DirectDiscounts or CartDiscounts.

      Returns:
      quotationCart
    • getValidTo

      @Nullable public ZonedDateTime getValidTo()

      Expiration date for the Quote. Once a Quote expires, it cannot be ordered.

      Returns:
      validTo
    • getSellerComment

      @Nullable public String getSellerComment()

      Message from the Seller included in the offer.

      Returns:
      sellerComment
    • getCustom

      @Nullable public CustomFields getCustom()

      Custom Fields of the Staged Quote.

      Returns:
      custom
    • getState

      @Nullable public StateReference getState()

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

      Returns:
      state
    • getPurchaseOrderNumber

      @Nullable public String getPurchaseOrderNumber()

      The Purchase Order Number is typically set by the Buyer on a QuoteRequest to track the purchase order during the quote and order flow.

      Returns:
      purchaseOrderNumber
    • getBusinessUnit

      @Nullable public BusinessUnitKeyReference getBusinessUnit()

      The BusinessUnit for the Staged Quote. Only available for B2B-enabled Projects.

      Returns:
      businessUnit
    • getStore

      @Nullable public StoreKeyReference getStore()

      The Store to which the Buyer belongs.

      Returns:
      store
    • build

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

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

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

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