Record Class Currency
java.lang.Object
java.lang.Record
net.thauvin.erik.frankfurter.models.Currency
- All Implemented Interfaces:
CurrencyResult
public record Currency(String isoCode, String isoNumeric, String name, String symbol, LocalDate startDate, LocalDate endDate)
extends Record
implements CurrencyResult
Represents a currency entry returned by the Frankfurter
/currencies endpoint.
The API provides metadata for each currency, including its ISO codes, display name, symbol, and the date range for which data is available.
All fields except isoCode and name may be null
depending on the currency and the data available from the API.
Values are stored exactly as returned by the API. No normalization is performed, as the API is considered authoritative. Validation only ensures non-null/blank for fields required to identify a currency.
- Since:
- 1.0
- Author:
- Erik C. Thauvin
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionendDate()Returns the value of theendDaterecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.isoCode()Returns the value of theisoCoderecord component.Returns the value of theisoNumericrecord component.name()Returns the value of thenamerecord component.Returns the value of thestartDaterecord component.symbol()Returns the value of thesymbolrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Currency
public Currency(String isoCode, @Nullable String isoNumeric, String name, @Nullable String symbol, @Nullable LocalDate startDate, @Nullable LocalDate endDate) Creates a new currency entry.- Parameters:
isoCode- the ISO 4217 alphabetic currency codeisoNumeric- the ISO 4217 numeric currency code, ornullname- the currency namesymbol- the currency symbol, ornullstartDate- the first date for which data is available, ornullendDate- the last date for which data is available, ornull- Throws:
IllegalArgumentException- ifisoCodeornameare blankNullPointerException- ifisoCodeornamearenull
-
-
Method Details
-
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. -
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. -
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). -
isoCode
Returns the value of theisoCoderecord component.- Returns:
- the value of the
isoCoderecord component
-
isoNumeric
Returns the value of theisoNumericrecord component.- Returns:
- the value of the
isoNumericrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
symbol
Returns the value of thesymbolrecord component.- Returns:
- the value of the
symbolrecord component
-
startDate
Returns the value of thestartDaterecord component.- Returns:
- the value of the
startDaterecord component
-
endDate
Returns the value of theendDaterecord component.- Returns:
- the value of the
endDaterecord component
-