Class ExchangeRates

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

public class ExchangeRates extends Object
Represents the latest exchange rates for a base currency.
  • Method Details

    • getAmount

      public Double getAmount()
      Retrieves the amount of the base currency.
      Returns:
      the amount of the base currency
    • getBase

      public String getBase()
      Retrieves the base currency.
      Returns:
      the base currency
    • getDate

      public LocalDate getDate()
      Retrieves the date of the exchange rates.
      Returns:
      the date of the exchange rates
    • getRateFor

      public Double getRateFor(String symbol)
      Retrieves the exchange rate for the specified currency symbol.
      Parameters:
      symbol - The currency symbol
    • getRates

      public Map<String,Double> getRates()
      Retrieves the exchange rates for various currencies.
      Returns:
      a map where the keys are currency symbols (e.g., "USD", "EUR") and the values are the corresponding exchange rates against the base currency.
    • getSymbols

      public Set<String> getSymbols()
      Retrieves the set of all currency symbols available in the exchange rates.
      Returns:
      a set of strings representing the currency symbols
    • hasRateFor

      public boolean hasRateFor(String symbol)
      Checks if the exchange rates contain the specified currency symbol.
      Parameters:
      symbol - The currency symbol to check for
      Returns:
      true if the exchange rates contain the symbol, false otherwise
    • toString

      public String toString()
      Overrides:
      toString in class Object