Class CentPrecisionMoneyDraftBuilder

java.lang.Object
com.commercetools.api.models.common.CentPrecisionMoneyDraftBuilder
All Implemented Interfaces:
Builder<CentPrecisionMoneyDraft>

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

     CentPrecisionMoneyDraft centPrecisionMoneyDraft = CentPrecisionMoneyDraft.builder()
             .currencyCode("{currencyCode}")
             .build()
 
  • Constructor Details

    • CentPrecisionMoneyDraftBuilder

      public CentPrecisionMoneyDraftBuilder()
  • Method Details

    • centAmount

      public CentPrecisionMoneyDraftBuilder centAmount(@Nullable Long centAmount)

      Amount in the smallest indivisible unit of a currency.

      Parameters:
      centAmount - value to be set
      Returns:
      Builder
    • currencyCode

      public CentPrecisionMoneyDraftBuilder currencyCode(String currencyCode)

      Currency code compliant to ISO 4217.

      Parameters:
      currencyCode - value to be set
      Returns:
      Builder
    • fractionDigits

      public CentPrecisionMoneyDraftBuilder fractionDigits(@Nullable Integer fractionDigits)

      This field is optional for cent precision. If provided, it must be equal to the default number of fraction digits for the specified currency.

      Parameters:
      fractionDigits - value to be set
      Returns:
      Builder
    • getCentAmount

      @Nullable public Long getCentAmount()

      Amount in the smallest indivisible unit of a currency.

      Returns:
      centAmount
    • getCurrencyCode

      public String getCurrencyCode()

      Currency code compliant to ISO 4217.

      Returns:
      currencyCode
    • getFractionDigits

      @Nullable public Integer getFractionDigits()

      This field is optional for cent precision. If provided, it must be equal to the default number of fraction digits for the specified currency.

      Returns:
      fractionDigits
    • build

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

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

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

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