Class Money

  • All Implemented Interfaces:
    java.io.Serializable

    public final class Money
    extends java.lang.Object
    implements java.io.Serializable
    A simple POJO to represent money, an amount associated with a currency.
    This might someday be replaced by an implementation of https://javamoney.github.io/api.html
    Since:
    8.0.1
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      Money​(java.lang.String currency, java.lang.Number amount)  
      Money​(java.lang.String currency, java.math.BigDecimal amount)  
      Money​(java.util.Currency currency, java.lang.Number amount)  
      Money​(java.util.Currency currency, java.math.BigDecimal amount)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.math.BigDecimal getAmount()  
      java.lang.String getCurrency()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Money

        public Money​(java.util.Currency currency,
                     java.math.BigDecimal amount)
        Parameters:
        currency - a not null currency
        amount - the value for the amount, may be null
      • Money

        public Money​(java.lang.String currency,
                     java.math.BigDecimal amount)
        Parameters:
        currency - a not null currency code
        amount - the value for the amount, may be null
      • Money

        public Money​(java.util.Currency currency,
                     java.lang.Number amount)
        Parameters:
        currency - a not null currency
        amount - the value for the amount, may be null
      • Money

        public Money​(java.lang.String currency,
                     java.lang.Number amount)
        Parameters:
        currency - a not null currency code
        amount - the value for the amount, may be null
    • Method Detail

      • getCurrency

        public java.lang.String getCurrency()
      • getAmount

        public java.math.BigDecimal getAmount()