com.highdeal.currency
Class CurrencyHelper

java.lang.Object
  extended by com.highdeal.currency.CurrencyHelper

public class CurrencyHelper
extends java.lang.Object

This 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.


Method Summary
static java.lang.String getCurrencyISOCodeOrCode(Currency currency)
          Returns the ISO code or the code of a currency whether the currency has an ISO code or not.
static java.lang.String getCurrencyISOCodeOrCode(java.lang.String currencyCode)
          Returns the ISO code or the code of a currency whether the currency has an ISO code or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getCurrencyISOCodeOrCode

public static final java.lang.String getCurrencyISOCodeOrCode(java.lang.String currencyCode)
Returns the ISO code or the code of a currency whether the currency has an ISO code or not.

Example

With the following CurrencyBook:

Currency CodeCurrency ISO Code
EUREUR
USDNUSD
PNTnull
here are some examples which shows the behavior of this method:
currencyCodeMethod Result
EUREUR
USDNUSD
PNTPNT
UNKUNK
nullthrows NullPointerException

Parameters:
currencyCode - The code of the currency for which its ISO code or its code must be returned
Returns:
The ISO code if specified, currencyCode otherwise i.e. if no currency has currencyCode as code or if the currency has no ISO code.
Throws:
java.lang.NullPointerException - if the class currency is not initialized with a CurrencyBook or if currencyCode is null

getCurrencyISOCodeOrCode

public static final java.lang.String getCurrencyISOCodeOrCode(Currency currency)
Returns the ISO code or the code of a currency whether the currency has an ISO code or not.

Parameters:
currency - The currency for which its ISO code or its code must be returned
Returns:
The ISO code of currency if specified, the code of the currency otherwise.
Throws:
java.lang.NullPointerException - if currency is null.

Document Published: October 2015 (SAP CC 4.0 SP10 and Later)