org.golibri.iso
Class CurrencyCode
java.lang.Object
org.golibri.iso.CurrencyCode
- public final class CurrencyCode
- extends java.lang.Object
The CurrencyCode class represents currency codes as specified by the ISO 4217 Standard.
CurrencyCode objects can be created with a String parameter and are immutable.
To create an CurrencyCode object and check whether it exists conform the ISO 4217 Standard one
can use the factory method getCurrencyCode(String) from org.golibri.iso.CurrencyCodes.
The CurrencyCode class is for working specifically with currency codes specified by the ISO 4217 Standard.
The preferred way to represent currencies is with org.golibri.common.finance.Currency.
- See Also:
org.golibri.iso.Currencies,
Currency
|
Constructor Summary |
CurrencyCode(java.lang.String currencyCode)
Constructor. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
CurrencyCode
public CurrencyCode(java.lang.String currencyCode)
- Constructor.
The String parameter should contain a well-formatted currency code.
A well-formatted currency code consists of exactly 3 alphanumeric characters.
- Parameters:
currencyCode - String parameter containing the currency code
- Throws:
java.lang.NullPointerException - If the parameter currencyCode is null
java.lang.IllegalArgumentException - If the parameter currencyCode is not well-formatted
getCurrencyCode
public java.lang.String getCurrencyCode()
- Returns the currency code as String
- Returns:
- The currency code
toString
public java.lang.String toString()
- See Also:
Object.toString()
hashCode
public int hashCode()
- See Also:
Object.hashCode()
equals
public boolean equals(java.lang.Object object)
- See Also:
Object.equals(java.lang.Object)