Class HighPrecisionMoneyBuilder

java.lang.Object
com.commercetools.importapi.models.common.HighPrecisionMoneyBuilder
All Implemented Interfaces:
Builder<HighPrecisionMoney>

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

     HighPrecisionMoney highPrecisionMoney = HighPrecisionMoney.builder()
             .centAmount(0.3)
             .currencyCode("{currencyCode}")
             .preciseAmount(0.3)
             .build()
 
  • Constructor Details

    • HighPrecisionMoneyBuilder

      public HighPrecisionMoneyBuilder()
  • Method Details

    • fractionDigits

      public HighPrecisionMoneyBuilder fractionDigits(@Nullable Integer fractionDigits)
      set the value to the fractionDigits
      Parameters:
      fractionDigits - value to be set
      Returns:
      Builder
    • centAmount

      public HighPrecisionMoneyBuilder centAmount(Long centAmount)
      set the value to the centAmount
      Parameters:
      centAmount - value to be set
      Returns:
      Builder
    • currencyCode

      public HighPrecisionMoneyBuilder currencyCode(String currencyCode)

      The currency code compliant to ISO 4217.

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

      public HighPrecisionMoneyBuilder preciseAmount(Long preciseAmount)
      set the value to the preciseAmount
      Parameters:
      preciseAmount - value to be set
      Returns:
      Builder
    • getFractionDigits

      @Nullable public Integer getFractionDigits()
      value of fractionDigits}
      Returns:
      fractionDigits
    • getCentAmount

      public Long getCentAmount()
      value of centAmount}
      Returns:
      centAmount
    • getCurrencyCode

      public String getCurrencyCode()

      The currency code compliant to ISO 4217.

      Returns:
      currencyCode
    • getPreciseAmount

      public Long getPreciseAmount()
      value of preciseAmount}
      Returns:
      preciseAmount
    • build

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

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

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

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