Record Class Provider
/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.
Only key and name are guaranteed to be non‑null. All other
fields may be null depending on the provider and the data available
from the API.
The currencies list is normalized to a non‑null, unmodifiable list
to ensure safe iteration and predictable behavior.
- Since:
- 1.0
- Author:
- Erik C. Thauvin
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecurrenciesrecord component.dataUrl()Returns the value of thedataUrlrecord component.Returns the value of thedescriptionrecord component.endDate()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.Returns the value of thestartDaterecord component.termsUrl()Returns the value of thetermsUrlrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Provider
public Provider(@NonNull String key, @NonNull String name, @Nullable String description, @Nullable String dataUrl, @Nullable String termsUrl, @Nullable LocalDate startDate, @Nullable LocalDate endDate, @NonNull List<String> currencies) Validates required fields and normalizes optional values.This compact constructor enforces the non‑blank contract for
keyandname, which are the only required fields in a provider entry. All other fields may benullas supplied by the API.The
currencieslist is defensively normalized to a non‑null, unmodifiable list. When the API omits the field or suppliesnull, it is replaced with an empty list.- Parameters:
key- the provider identifier (must not be blank)name- the provider name (must not be blank)description- 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, ornull- Throws:
IllegalArgumentException- ifkeyornameare blankNullPointerException- ifkeyornamearenull
-
-
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
-