Class PinnedExchangeRates
java.lang.Object
com.eqixiac.equinix.design.cost.PinnedExchangeRates
- All Implemented Interfaces:
CurrencyConverter
The rates pinned in a spec's
commercial.exchangeRates: units of the spec currency per one unit of
each keyed currency. They are part of the spec's fingerprint, so a pinned run is reproducible. They are
applied as given: a converted range is widened only by the spec's own bandPercent (default 0).-
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. -
Constructor Summary
Constructors -
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.
-
Constructor Details
-
PinnedExchangeRates
- Parameters:
rates- the pinned ratestarget- the spec currency they convert to
-
-
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
-