Class CurrencyConverters.Chain
java.lang.Object
com.eqixiac.equinix.design.cost.CurrencyConverters.Chain
- All Implemented Interfaces:
CurrencyConverter
- Enclosing class:
CurrencyConverters
First-answer-wins composition that can report fallbacks.
-
Nested Class Summary
Nested classes/interfaces inherited from interface CurrencyConverter
CurrencyConverter.Converted, CurrencyConverter.Kind, CurrencyConverter.RateModifier and TypeInterfaceDescriptionstatic final recordAn amount restated in another currency.static enumWhere a rate came from, in precedence order.static final recordA rate between two currencies. -
Method Summary
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface CurrencyConverter
convertModifier and TypeMethodDescriptiondefault Optional<CurrencyConverter.Converted> convert(BigDecimal amount, String from, String to) Converts an amount.
-
Method Details
-
rate
- Specified by:
ratein interfaceCurrencyConverter- Parameters:
from- ISO 4217 codeto- ISO 4217 code- Returns:
- the rate, or empty when this converter has none for the pair
-
name
- Specified by:
namein interfaceCurrencyConverter- Returns:
- a short name for reasons and diagnostics
-
notes
-
missingReason
-