Record Class CurrencyConverter.Rate

java.lang.Object
java.lang.Record
com.eqixiac.equinix.design.spi.CurrencyConverter.Rate
Record Components:
from - ISO 4217 code converted from
to - ISO 4217 code converted to
rate - units of to per one unit of from
kind - where it came from
source - a statement of the source (publisher, table, feed)
asOf - the date the rate was observed
bandPercent - the widening, either side, to apply to converted ranges (0 for an exact pinned rate)
Enclosing interface:
CurrencyConverter

public static record CurrencyConverter.Rate(String from, String to, BigDecimal rate, CurrencyConverter.Kind kind, String source, String asOf, double bandPercent) extends Record
A rate between two currencies.
  • Constructor Details

  • Method Details

    • apply

      public BigDecimal apply(BigDecimal amount)
      Parameters:
      amount - an amount in from
      Returns:
      the amount in to, rounded half-up to cents
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • from

      public String from()
      Returns the value of the from record component.
      Returns:
      the value of the from record component
    • to

      public String to()
      Returns the value of the to record component.
      Returns:
      the value of the to record component
    • rate

      public BigDecimal rate()
      Returns the value of the rate record component.
      Returns:
      the value of the rate record component
    • kind

      public CurrencyConverter.Kind kind()
      Returns the value of the kind record component.
      Returns:
      the value of the kind record component
    • source

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

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

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