Class ExchangeRates
java.lang.Object
net.thauvin.erik.frankfurter.models.ExchangeRates
Represents the latest exchange rates for a base currency.
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves the amount of the base currency.getBase()
Retrieves the base currency.getDate()
Retrieves the date of the exchange rates.getRateFor
(String symbol) Retrieves the exchange rate for the specified currency symbol.getRates()
Retrieves the exchange rates for various currencies.Retrieves the set of all currency symbols available in the exchange rates.boolean
hasRateFor
(String symbol) Checks if the exchange rates contain the specified currency symbol.toString()
-
Method Details
-
getAmount
Retrieves the amount of the base currency.- Returns:
- the amount of the base currency
-
getBase
Retrieves the base currency.- Returns:
- the base currency
-
getDate
Retrieves the date of the exchange rates.- Returns:
- the date of the exchange rates
-
getRateFor
Retrieves the exchange rate for the specified currency symbol.- Parameters:
symbol
- The currency symbol
-
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
Retrieves the set of all currency symbols available in the exchange rates.- Returns:
- a set of strings representing the currency symbols
-
hasRateFor
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
-