Class SeriesRates
java.lang.Object
net.thauvin.erik.frankfurter.models.SeriesRates
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves the amount of the time series.getBase()
Retrieves the base currency of the time series.getDates()
Retrieves the set of dates for which exchange rates are available in the time series.Retrieves the end date of the time series.getRateFor
(LocalDate date, String currencySymbol) Retrieves the exchange rate for a specific date and currency symbol from the time series.getRates()
Retrieves the exchange rates mapped by date and currency symbol.getRatesFor
(LocalDate date) Retrieves the exchange rates for all currencies on the specified date.Retrieves the start date of the time series.boolean
hasRatesFor
(LocalDate date) Checks if exchange rates are available for the specified date.boolean
hasSymbolFor
(LocalDate date, String symbol) Checks if a symbol is available for a specified date in the exchange rate time series.toString()
-
Method Details
-
getAmount
Retrieves the amount of the time series.- Returns:
- the amount
-
getBase
Retrieves the base currency of the time series.- Returns:
- the base currency
-
getDates
Retrieves the set of dates for which exchange rates are available in the time series.- Returns:
- the set of dates
-
getEndDate
Retrieves the end date of the time series.- Returns:
- the end date
-
getRateFor
Retrieves the exchange rate for a specific date and currency symbol from the time series.- Parameters:
date
- The date for which the exchange rate is to be retrieved, formatted as a stringcurrencySymbol
- The currency symbol for which the exchange rate is to be retrieved- Returns:
- The exchange rate for the specified date and currency symbol, or null if no rate is available
-
getRates
Retrieves the exchange rates mapped by date and currency symbol.- Returns:
- A map where the keys are
LocalDate
objects representing the dates, and the values are maps with currency symbols as keys and exchange rates as double values.
-
getRatesFor
Retrieves the exchange rates for all currencies on the specified date.- Parameters:
date
- The date for which the exchange rates are to be retrieved as aLocalDate
- Returns:
- A map of currency symbols to their respective exchange rates on the specified date, or null if no rates are available for the date
-
getStartDate
Retrieves the start date of the time series.- Returns:
- the start date
-
hasRatesFor
Checks if exchange rates are available for the specified date.- Parameters:
date
- The date for which to check the availability of exchange rates- Returns:
true
if exchange rates are available for the specified date,false
otherwise
-
hasSymbolFor
Checks if a symbol is available for a specified date in the exchange rate time series.- Parameters:
date
- TheLocalDate
for which to check the availability of the symbolsymbol
- The currency symbol to check for availability- Returns:
true
if the symbol is available for the specified date,false
otherwise
-
toString
-