Record Class Provider
java.lang.Object
java.lang.Record
net.thauvin.erik.frankfurter.models.Provider
@NullMarked
public record Provider(String key, String name, @Nullable String description, @Nullable String dataUrl, @Nullable String termsUrl, @Nullable LocalDate startDate, @Nullable LocalDate endDate, List<String> currencies)
extends Record
Represents a provider entry returned by the Frankfurter
/providers endpoint.
The API supplies metadata for each provider, including its identifier, descriptive information, data source URLs, the date range of available data, and the list of currencies supported by the provider.
All fields except key and name may be null
depending on the provider and the data available from the API.
- Since:
- 1.0
- Author:
- Erik C. Thauvin
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecurrenciesrecord component.@Nullable StringdataUrl()Returns the value of thedataUrlrecord component.@Nullable StringReturns the value of thedescriptionrecord component.@Nullable LocalDateendDate()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.key()Returns the value of thekeyrecord component.name()Returns the value of thenamerecord component.@Nullable LocalDateReturns the value of thestartDaterecord component.@Nullable StringtermsUrl()Returns the value of thetermsUrlrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Provider
public Provider(String key, String name, @Nullable String description, @Nullable String dataUrl, @Nullable String termsUrl, @Nullable LocalDate startDate, @Nullable LocalDate endDate, List<String> currencies) Creates a new provider entry.- Parameters:
key- the provider identifiername- the provider namedescription- the provider description, ornulldataUrl- the data source URL, ornulltermsUrl- the terms-of-use URL, ornullstartDate- the first date for which data is available, ornullendDate- the last date for which data is available, ornullcurrencies- the list of supported currencies- Throws:
IllegalArgumentException- ifkeyornameis blank
-
-
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). -
key
Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
dataUrl
Returns the value of thedataUrlrecord component.- Returns:
- the value of the
dataUrlrecord component
-
termsUrl
Returns the value of thetermsUrlrecord component.- Returns:
- the value of the
termsUrlrecord 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
-
currencies
Returns the value of thecurrenciesrecord component.- Returns:
- the value of the
currenciesrecord component
-