Class QuoteDraftBuilder

java.lang.Object
com.commercetools.api.models.quote.QuoteDraftBuilder
All Implemented Interfaces:
Builder<QuoteDraft>

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

     QuoteDraft quoteDraft = QuoteDraft.builder()
             .stagedQuote(stagedQuoteBuilder -> stagedQuoteBuilder)
             .stagedQuoteVersion(0.3)
             .build()
 
  • Constructor Details

    • QuoteDraftBuilder

      public QuoteDraftBuilder()
  • Method Details

    • key

      User-defined unique identifier for the Quote.

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

      StagedQuote from which the Quote is created.

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

      StagedQuote from which the Quote is created.

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

      public QuoteDraftBuilder stagedQuote(StagedQuoteResourceIdentifier stagedQuote)

      StagedQuote from which the Quote is created.

      Parameters:
      stagedQuote - value to be set
      Returns:
      Builder
    • stagedQuoteVersion

      public QuoteDraftBuilder stagedQuoteVersion(Long stagedQuoteVersion)

      Current version of the StagedQuote.

      Parameters:
      stagedQuoteVersion - value to be set
      Returns:
      Builder
    • stagedQuoteStateToSent

      public QuoteDraftBuilder stagedQuoteStateToSent(@Nullable Boolean stagedQuoteStateToSent)

      If true, the stagedQuoteState of the referenced StagedQuote will be set to Sent.

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

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

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

      Custom Fields to be added to the Quote.

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

      Custom Fields to be added to the Quote.

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

      Custom Fields to be added to the Quote.

      • If specified, the Custom Fields are merged with the Custom Fields on the referenced StagedQuote and added to the Quote.
      • If empty, the Custom Fields on the referenced StagedQuote are added to the Quote automatically.
      Parameters:
      custom - value to be set
      Returns:
      Builder
    • getKey

      @Nullable public String getKey()

      User-defined unique identifier for the Quote.

      Returns:
      key
    • getStagedQuote

      public StagedQuoteResourceIdentifier getStagedQuote()

      StagedQuote from which the Quote is created.

      Returns:
      stagedQuote
    • getStagedQuoteVersion

      public Long getStagedQuoteVersion()

      Current version of the StagedQuote.

      Returns:
      stagedQuoteVersion
    • getStagedQuoteStateToSent

      @Nullable public Boolean getStagedQuoteStateToSent()

      If true, the stagedQuoteState of the referenced StagedQuote will be set to Sent.

      Returns:
      stagedQuoteStateToSent
    • getState

      @Nullable public StateReference getState()

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

      Returns:
      state
    • getCustom

      @Nullable public CustomFieldsDraft getCustom()

      Custom Fields to be added to the Quote.

      • If specified, the Custom Fields are merged with the Custom Fields on the referenced StagedQuote and added to the Quote.
      • If empty, the Custom Fields on the referenced StagedQuote are added to the Quote automatically.
      Returns:
      custom
    • build

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

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

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

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