public class CurrencyHelper extends Object
Java class is a tool to work with currencies.
For some of its methods, it is expected as prerequisite that the class
Currency is initialized with a CurrencyBook.| Modifier and Type | Method and Description |
|---|---|
static String |
getCurrencyISOCodeOrCode(Currency currency)
Returns the ISO code or the code of a currency whether the currency has an ISO code or not.
|
static String |
getCurrencyISOCodeOrCode(String currencyCode)
Returns the ISO code or the code of a currency whether the currency has an ISO code or not.
|
public static final String getCurrencyISOCodeOrCode(String currencyCode)
Example
With the following CurrencyBook:
| Currency Code | Currency ISO Code |
|---|---|
| EUR | EUR |
| USDN | USD |
| PNT | null |
currencyCode | Method Result |
|---|---|
| EUR | EUR |
| USDN | USD |
| PNT | PNT |
| UNK | UNK |
null | throws NullPointerException |
currencyCode - The code of the currency for which its ISO code or its code must be returnedcurrencyCode otherwise i.e. if no currency has currencyCode as code or if the currency has no ISO code.NullPointerException - if the class currency is not initialized with a CurrencyBook
or if currencyCode is nullpublic static final String getCurrencyISOCodeOrCode(Currency currency)
currency - The currency for which its ISO code or its code must be returnedcurrency if specified, the code of the currency otherwise.NullPointerException - if currency is null.