1010 */
1111package javax .money .convert ;
1212
13+ import javax .money .CurrencySupplier ;
1314import javax .money .CurrencyUnit ;
1415import javax .money .NumberValue ;
1516import java .io .Serializable ;
7374 * <h3>Implementation Specification</h3>
7475 * <p>Implementations of this interface
7576 * <ul>
76- * <li>must be Comparable(with {@code ExchangeRate})</li>
77- * <li>must implement equals/hashCode considering #getBase, #getTerm, #getFactor and #getConversionContext.</li>
78- * <li>should be thread-safe</li>
79- * <li>should be serializable</li>
80- * <li>should provide a fluent builder API for constructing new rate instances easily.</li>
77+ * <li>must be Comparable(with {@code ExchangeRate})</li>
78+ * <li>must implement equals/hashCode considering #getBaseCurrency, #getCurrency,
79+ * #getFactor and #getConversionContext.</li>
80+ * <li>should be thread-safe</li>
81+ * <li>should be serializable</li>
82+ * <li>should provide a fluent builder API for constructing new rate instances easily.</li>
8183 * </ul>
8284 * </ul></p>
85+ *
8386 * @author Werner Keil
8487 * @author Anatole Tresch
8588 * @see <a
8689 * href="https://en.wikipedia.org/wiki/Exchange_rate#Quotations">Wikipedia:
8790 * Exchange Rate (Quotations)</a>
8891 */
89- public interface ExchangeRate {
92+ public interface ExchangeRate extends CurrencySupplier {
9093
9194 /**
9295 * Access the {@link ConversionContext} of {@link ExchangeRate}.
@@ -100,14 +103,15 @@ public interface ExchangeRate{
100103 *
101104 * @return the base {@link CurrencyUnit}.
102105 */
103- CurrencyUnit getBase ();
106+ CurrencyUnit getBaseCurrency ();
104107
105108 /**
106109 * Get the term (target) {@link CurrencyUnit}.
107110 *
108111 * @return the term {@link CurrencyUnit}.
109112 */
110- CurrencyUnit getTerm ();
113+ @ Override
114+ CurrencyUnit getCurrency ();
111115
112116 /**
113117 * Access the rate's bid factor.
@@ -130,14 +134,14 @@ public interface ExchangeRate{
130134 * Derived exchange rates are defined by an ordered list of subconversions
131135 * with intermediate steps, whereas a direct conversion is possible in one
132136 * steps.
133- * <p/ >
137+ * <p>
134138 * This method always returns {@code true}, if the chain contains more than
135139 * one rate. Direct rates, have also a chain, but with exact one rate.
136140 *
137141 * @return true, if the exchange rate is derived.
138142 */
139143 default boolean isDerived (){
140- return getExchangeRateChain ().size ()> 1 ;
144+ return getExchangeRateChain ().size () > 1 ;
141145 }
142146
143147}
0 commit comments