public interface CurrencyStrategy
| Modifier and Type | Method and Description | 
|---|---|
Amount | 
convert(Amount amt,
       String toCurrency)
Convert an Amount from one currency to another 
 | 
<O extends Order> | 
convert(O order,
       String toCurrency)
Convert an  
Order from one currency to another. | 
<U extends User,CONTEXT> | 
getDefaultToCurrency(U user,
                    CONTEXT context)
During the conversion process, if the application wants to imply a default without any context to the final currrency
 all amounts will be converted to. 
 | 
Double | 
getRate(String fromCurrency,
       String toCurrency)
Provide the rate defined by double value. 
 | 
<U extends User,CONTEXT> | 
isSupported(String currency,
           U user,
           CONTEXT context)
Check if the currency specified is supported by the application for the given CONTEXT (or null). 
 | 
<U extends User,CONTEXT> String getDefaultToCurrency(U user, CONTEXT context)
user - as User (optional)CONTEXT - (optional)<U extends User,CONTEXT> boolean isSupported(String currency, U user, CONTEXT context)
currency - as stringuser - as User (optional)CONTEXT - , as an additional context param. @nullable trueDouble getRate(String fromCurrency, String toCurrency)
fromCurrency - as StringtoCurrency - as StringAmount convert(Amount amt, String toCurrency)
<O extends Order> O convert(O order, String toCurrency)
Order from one currency to another.order - as OrdertoCurrency - as String, to the currency to convert to.ConvertedCurrencyOrderCopyright © 2018. All rights reserved.