Class CentPrecisionMoneyDraftBuilder

java.lang.Object
com.commercetools.api.models.common.CentPrecisionMoneyDraftBuilder
All Implemented Interfaces:
io.vrap.rmf.base.client.Builder<CentPrecisionMoneyDraft>

public class CentPrecisionMoneyDraftBuilder extends Object implements io.vrap.rmf.base.client.Builder<CentPrecisionMoneyDraft>
CentPrecisionMoneyDraftBuilder
Example to create an instance using the builder pattern

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

  • Method Details

    • centAmount

      Amount in the smallest indivisible unit of a currency, such as:

      • Cents for EUR and USD, pence for GBP, or centime for CHF (5 CHF is specified as 500).
      • The value in the major unit for currencies without minor units, like JPY (5 JPY is specified as 5).
      Parameters:
      centAmount - value to be set
      Returns:
      Builder
    • currencyCode

      Currency code compliant to ISO 4217.

      Parameters:
      currencyCode - value to be set
      Returns:
      Builder
    • 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

      public Long getCentAmount()

      Amount in the smallest indivisible unit of a currency, such as:

      • Cents for EUR and USD, pence for GBP, or centime for CHF (5 CHF is specified as 500).
      • The value in the major unit for currencies without minor units, like JPY (5 JPY is specified as 5).
      Returns:
      centAmount
    • getCurrencyCode

      Currency code compliant to ISO 4217.

      Returns:
      currencyCode
    • 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

      builds CentPrecisionMoneyDraft with checking for non-null required values
      Specified by:
      build in interface io.vrap.rmf.base.client.Builder<CentPrecisionMoneyDraft>
      Returns:
      CentPrecisionMoneyDraft
    • buildUnchecked

      builds CentPrecisionMoneyDraft without checking for non-null required values
      Returns:
      CentPrecisionMoneyDraft
    • 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