public interface CurrencyUnit
This interface represents a unit of currency such as the British Pound, Euro, US Dollar, Bitcoin or other. It is mainly defined to provide interoperability between different implementations.
Currencies can be distinguished by separate getCurrencyCode()
codes,
similar to Currency
.
equals/hashCode
considering the
concrete implementation type and currency code.
Modifier and Type | Method and Description |
---|---|
String |
getCurrencyCode()
Gets the unique currency code, the effective code depends on the
currency.
|
String getCurrencyCode()
Since each currency is identified by this code, the currency code is
required to be defined for every CurrencyUnit
and not
null
or empty.
For ISO codes the 3-letter ISO code should be returned. For non ISO currencies no constraints are defined.
null
. For ISO-4217 this this
will be the three letter ISO-4217 code. However, alternate
currencies can have different codes. Also there is no constraint
about the formatting of alternate codes, despite they fact that
the currency codes must be unique.Copyright © 2012–2013 JSR 354 - Expert Group. All rights reserved.