Record Class CurrencyConverter.Rate
java.lang.Object
java.lang.Record
com.eqixiac.equinix.design.spi.CurrencyConverter.Rate
- Record Components:
from- ISO 4217 code converted fromto- ISO 4217 code converted torate- units oftoper one unit offromkind- where it came fromsource- a statement of the source (publisher, table, feed)asOf- the date the rate was observedbandPercent- 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 Summary
ConstructorsConstructorDescriptionRate(String from, String to, BigDecimal rate, CurrencyConverter.Kind kind, String source, String asOf, double bandPercent) Requires a positive rate and the provenance fields. -
Method Summary
Modifier and TypeMethodDescriptionapply(BigDecimal amount) asOf()Returns the value of theasOfrecord component.doubleReturns the value of thebandPercentrecord component.final booleanIndicates whether some other object is "equal to" this one.from()Returns the value of thefromrecord component.final inthashCode()Returns a hash code value for this object.kind()Returns the value of thekindrecord component.rate()Returns the value of theraterecord component.source()Returns the value of thesourcerecord component.to()Returns the value of thetorecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Rate
public Rate(String from, String to, BigDecimal rate, CurrencyConverter.Kind kind, String source, String asOf, double bandPercent) Requires a positive rate and the provenance fields.
-
-
Method Details
-
apply
- Parameters:
amount- an amount infrom- Returns:
- the amount in
to, rounded half-up to cents
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
from
-
to
-
rate
-
kind
-
source
-
asOf
-
bandPercent
public double bandPercent()Returns the value of thebandPercentrecord component.- Returns:
- the value of the
bandPercentrecord component
-