Module java.money
Package javax.money

Class DefaultMonetaryRoundingsSingletonSpi.DefaultCurrencyRounding

java.lang.Object
javax.money.DefaultMonetaryRoundingsSingletonSpi.DefaultCurrencyRounding
All Implemented Interfaces:
Serializable, MonetaryOperator, MonetaryRounding
Enclosing class:
DefaultMonetaryRoundingsSingletonSpi

private static final class DefaultMonetaryRoundingsSingletonSpi.DefaultCurrencyRounding extends Object implements MonetaryRounding, Serializable
Default Rounding that rounds a MonetaryAmount based on the amount's CurrencyUnit.
  • Field Details

  • Constructor Details

    • DefaultCurrencyRounding

      private DefaultCurrencyRounding()
  • Method Details

    • apply

      public MonetaryAmount apply(MonetaryAmount amount)
      Description copied from interface: MonetaryOperator
      Applies the operator on the given amount.
      Specified by:
      apply in interface MonetaryOperator
      Parameters:
      amount - the amount to be operated on.
      Returns:
      the applied amount.
    • getRoundingContext

      public RoundingContext getRoundingContext()
      Description copied from interface: MonetaryRounding
      Access the rounding's context, which gives more details of the rounding instances such as
      • The rounding's name (required)
      • Its provider (required)
      • Its base currency
      • its scale and rounding mode
      • any other attributes useful to describe the rounding
      Specified by:
      getRoundingContext in interface MonetaryRounding
      Returns:
      the rounding's context, never null.