Class StagedQuoteDraftBuilder

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

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

     StagedQuoteDraft stagedQuoteDraft = StagedQuoteDraft.builder()
             .quoteRequest(quoteRequestBuilder -> quoteRequestBuilder)
             .quoteRequestVersion(0.3)
             .build()
 
  • Constructor Details

    • StagedQuoteDraftBuilder

      public StagedQuoteDraftBuilder()
  • Method Details

    • quoteRequest

      QuoteRequest from which the StagedQuote is created.

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

      QuoteRequest from which the StagedQuote is created.

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

      public StagedQuoteDraftBuilder quoteRequest(QuoteRequestResourceIdentifier quoteRequest)

      QuoteRequest from which the StagedQuote is created.

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

      public StagedQuoteDraftBuilder quoteRequestVersion(Long quoteRequestVersion)

      Current version of the QuoteRequest.

      Parameters:
      quoteRequestVersion - value to be set
      Returns:
      Builder
    • quoteRequestStateToAccepted

      public StagedQuoteDraftBuilder quoteRequestStateToAccepted(@Nullable Boolean quoteRequestStateToAccepted)

      If true, the quoteRequestState of the referenced QuoteRequest will be set to Accepted.

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

      User-defined unique identifier for the StagedQuote.

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

      Custom Fields to be added to the StagedQuote.

      • If specified, the Custom Fields are merged with the Custom Fields on the referenced QuoteRequest and added to the StagedQuote.
      • If empty, the Custom Fields on the referenced QuoteRequest are added to the StagedQuote automatically.
      Parameters:
      builder - function to build the custom value
      Returns:
      Builder
    • withCustom

      Custom Fields to be added to the StagedQuote.

      • If specified, the Custom Fields are merged with the Custom Fields on the referenced QuoteRequest and added to the StagedQuote.
      • If empty, the Custom Fields on the referenced QuoteRequest are added to the StagedQuote automatically.
      Parameters:
      builder - function to build the custom value
      Returns:
      Builder
    • custom

      Custom Fields to be added to the StagedQuote.

      • If specified, the Custom Fields are merged with the Custom Fields on the referenced QuoteRequest and added to the StagedQuote.
      • If empty, the Custom Fields on the referenced QuoteRequest are added to the StagedQuote automatically.
      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

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

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

      public QuoteRequestResourceIdentifier getQuoteRequest()

      QuoteRequest from which the StagedQuote is created.

      Returns:
      quoteRequest
    • getQuoteRequestVersion

      public Long getQuoteRequestVersion()

      Current version of the QuoteRequest.

      Returns:
      quoteRequestVersion
    • getQuoteRequestStateToAccepted

      @Nullable public Boolean getQuoteRequestStateToAccepted()

      If true, the quoteRequestState of the referenced QuoteRequest will be set to Accepted.

      Returns:
      quoteRequestStateToAccepted
    • getKey

      @Nullable public String getKey()

      User-defined unique identifier for the StagedQuote.

      Returns:
      key
    • getCustom

      @Nullable public CustomFieldsDraft getCustom()

      Custom Fields to be added to the StagedQuote.

      • If specified, the Custom Fields are merged with the Custom Fields on the referenced QuoteRequest and added to the StagedQuote.
      • If empty, the Custom Fields on the referenced QuoteRequest are added to the StagedQuote automatically.
      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
    • build

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

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

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

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