Class RateConfig
java.lang.Object
net.thauvin.erik.frankfurter.config.RateConfig
Immutable configuration for constructing Frankfurter
/rate queries.
Use new RateConfig.Builder() to create instances. Only the quote currency is required.
If base is omitted, the API defaults to EUR.
- Since:
- 1.0
- Author:
- Erik C. Thauvin
- API Note:
- This class is thread-safe. All state is immutable.
-
Nested Class Summary
Nested Classes -
Method Summary
-
Method Details
-
hashCode
public int hashCode()Returns a hash code value for this configuration.The hash code is computed from the base currency, quote currency, date, and providers. It is consistent with
equals(Object): equal objects have equal hash codes. -
equals
Compares this configuration to the specified object for equality.Two
RateConfiginstances are equal if they have the same base currency, quote currency, date, and providers. The comparison is order-sensitive for providers and case-sensitive for currency codes. -
toString
Returns a string representation of this configuration. -
applyTo
Applies this configuration to the given base URI.Constructs a URI for the
/rate/{base}/{quote}endpoint with optional query parameters fordateandproviders.- Parameters:
baseUri- the base URI, e.g.https://api.frankfurter.app/- Returns:
- the fully constructed URI for the rate query
- Throws:
NullPointerException- ifbaseUriisnullIllegalArgumentException- if the resulting URI is invalid
-