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 positive
asOf - when the rates were observed (free text, for example "2026-11-12"); required
source - where they came from (for example a treasury rate sheet); required
bandPercent - half-width of an FX allowance applied to lines converted at these rates, 0 to 50; null means 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 Details

    • DEFAULT_BAND_PERCENT

      public static final double DEFAULT_BAND_PERCENT
      The FX allowance used when bandPercent is not set: none, a pinned rate is exact.
      See Also:
  • Constructor Details

  • Method Details

    • rate

      public Optional<BigDecimal> rate(String currency)
      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

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • rates

      public Map<String, BigDecimal> rates()
      Returns the value of the rates record component.
      Returns:
      the value of the rates record component
    • asOf

      public String asOf()
      Returns the value of the asOf record component.
      Returns:
      the value of the asOf record component
    • source

      public String source()
      Returns the value of the source record component.
      Returns:
      the value of the source record component
    • bandPercent

      public Double bandPercent()
      Returns the value of the bandPercent record component.
      Returns:
      the value of the bandPercent record component