Record Class CommercialTerms.ExchangeRates
java.lang.Object
java.lang.Record
com.eqixiac.equinix.design.spec.CommercialTerms.ExchangeRates
- Record Components:
rates- units of the spec's currency per ONE unit of each keyed currency ({"GBP": 1.27}with currency USD: 1 GBP = 1.27 USD); keys are ISO 4217 codes, values positiveasOf- when the rates were observed (free text, for example"2026-11-12"); requiredsource- where they came from (for example a treasury rate sheet); requiredbandPercent- half-width of an FX allowance applied to lines converted at these rates, 0 to 50;nullmeans 0.0 (pinned rates are exact)
- Enclosing class:
CommercialTerms
public static record CommercialTerms.ExchangeRates(Map<String, BigDecimal> rates, String asOf, String source, Double bandPercent)
extends Record
Exchange rates pinned in the spec: they take precedence over every other rate source (a caller's
converter, the live ECB rates, the bundled table) and are part of the spec's fingerprint, so a run can be
reproduced exactly. The live Fabric price search quotes London in GBP and Frankfurt in EUR (observed
2026-11-12) while the provider fees are in USD; a converted line keeps its original amount and currency
and records the rate,
asOf and source. A pinned rate is taken as exact: the range is
widened only by bandPercent when one is stated.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleThe FX allowance used whenbandPercentis not set: none, a pinned rate is exact. -
Constructor Summary
ConstructorsConstructorDescriptionExchangeRates(Map<String, BigDecimal> rates, String asOf, String source, Double bandPercent) Validates the rates and sorts them by currency code. -
Method Summary
Modifier and TypeMethodDescriptionasOf()Returns the value of theasOfrecord component.Returns the value of thebandPercentrecord component.doublefinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.rates()Returns the value of theratesrecord component.source()Returns the value of thesourcerecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
DEFAULT_BAND_PERCENT
public static final double DEFAULT_BAND_PERCENTThe FX allowance used whenbandPercentis not set: none, a pinned rate is exact.- See Also:
-
-
Constructor Details
-
ExchangeRates
-
-
Method Details
-
rate
- Parameters:
currency- an ISO 4217 code- Returns:
- units of the spec currency per one unit of
currency, or empty when not supplied
-
bandPercentOrDefault
public double bandPercentOrDefault()- Returns:
- the FX allowance in percent either side
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
rates
-
asOf
-
source
-
bandPercent
Returns the value of thebandPercentrecord component.- Returns:
- the value of the
bandPercentrecord component
-