Class SeriesRates

java.lang.Object
net.thauvin.erik.frankfurter.models.SeriesRates

public class SeriesRates extends Object
  • Method Details

    • getAmount

      public Double getAmount()
      Retrieves the amount of the time series.
      Returns:
      the amount
    • getBase

      public String getBase()
      Retrieves the base currency of the time series.
      Returns:
      the base currency
    • getDates

      public Set<LocalDate> getDates()
      Retrieves the set of dates for which exchange rates are available in the time series.
      Returns:
      the set of dates
    • getEndDate

      public LocalDate getEndDate()
      Retrieves the end date of the time series.
      Returns:
      the end date
    • getRateFor

      public Double getRateFor(LocalDate date, String currencySymbol)
      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 string
      currencySymbol - 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

      public Map<LocalDate,Map<String,Double>> 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

      public Map<String,Double> getRatesFor(LocalDate date)
      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 a LocalDate
      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

      public LocalDate getStartDate()
      Retrieves the start date of the time series.
      Returns:
      the start date
    • hasRatesFor

      public boolean hasRatesFor(LocalDate date)
      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

      public boolean hasSymbolFor(LocalDate date, String symbol)
      Checks if a symbol is available for a specified date in the exchange rate time series.
      Parameters:
      date - The LocalDate for which to check the availability of the symbol
      symbol - The currency symbol to check for availability
      Returns:
      true if the symbol is available for the specified date, false otherwise
    • toString

      public String toString()
      Overrides:
      toString in class Object