Amount(amount: BigDecimal, currency: T)
Amount(quantity: Long, token: T)
Amount represents a positive quantity of some token (currency, asset, etc.), measured in quantity of the smallest representable units. Note that quantity is not necessarily 1/100ths of a currency unit, but are the actual smallest amount used in whatever underlying thing the amount represents.
Amounts of different tokens
TODO: It may make sense to replace this with convenience extensions over the JSR 354 MonetaryAmount interface, in particular for use during calculations. This may also resolve... TODO: Think about how positive-only vs positive-or-negative amounts can be represented in the type system. TODO: Add either a scaling factor, or a variant for use in calculations.
T
- the type of the token, for example Currency.