Interface CentPrecisionMoney

All Superinterfaces:
Comparable<javax.money.MonetaryAmount>, javax.money.CurrencySupplier, javax.money.MonetaryAmount, MonetaryAmountConvertable, Money, javax.money.NumberSupplier, TypedMoney
All Known Implementing Classes:
CentPrecisionMoneyImpl

public interface CentPrecisionMoney extends TypedMoney

Object that stores cent amounts in a specific currency.


Example to create an instance using the builder pattern

     CentPrecisionMoney centPrecisionMoney = CentPrecisionMoney.builder()
             .centAmount(0.3)
             .currencyCode("{currencyCode}")
             .fractionDigits(0.3)
             .build()
 
  • Field Details

  • Method Details

    • getFractionDigits

      @NotNull @NotNull Integer getFractionDigits()

      The number of default fraction digits for the given currency, like 2 for EUR or 0 for JPY.

      Specified by:
      getFractionDigits in interface TypedMoney
      Returns:
      fractionDigits
    • setFractionDigits

      void setFractionDigits(Integer fractionDigits)

      The number of default fraction digits for the given currency, like 2 for EUR or 0 for JPY.

      Specified by:
      setFractionDigits in interface TypedMoney
      Parameters:
      fractionDigits - value to be set
    • of

      static CentPrecisionMoney of()
      factory method
      Returns:
      instance of CentPrecisionMoney
    • of

      static CentPrecisionMoney of(CentPrecisionMoney template)
      factory method to create a shallow copy CentPrecisionMoney
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      factory method to create a deep copy of CentPrecisionMoney
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static CentPrecisionMoneyBuilder builder()
      builder factory method for CentPrecisionMoney
      Returns:
      builder
    • builder

      static CentPrecisionMoneyBuilder builder(CentPrecisionMoney template)
      create builder for CentPrecisionMoney instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withCentPrecisionMoney

      default <T> T withCentPrecisionMoney(Function<CentPrecisionMoney,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • of

      static CentPrecisionMoney of(javax.money.MonetaryAmount monetaryAmount)
    • toDraft

      default CentPrecisionMoneyDraft toDraft()
      Specified by:
      toDraft in interface Money
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<CentPrecisionMoney> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference