File tree Expand file tree Collapse file tree 3 files changed +22
-18
lines changed
src/main/java/javax/money Expand file tree Collapse file tree 3 files changed +22
-18
lines changed Original file line number Diff line number Diff line change 1414/**
1515 * Represents a supplier of {@link NumberValue}-valued results. This is the
1616 * {@link NumberValue}-producing specialization of {@code Supplier} (as in Java 8).
17- *
17+ * <p>
1818 * <p>
1919 * There is no requirement that a distinct result be returned each time the
2020 * supplier is invoked.
21- *
21+ * <p>
2222 * <p>
2323 * This is a <b>functional interface</b> whose
2424 * functional method is {@link #getNumber()}.
3131 * @author Werner Keil
3232 * @author Anatole Tresch
3333 * @version 0.6
34- * @since 0.8
3534 * @see java.util.function.Supplier
35+ * @since 0.8
3636 */
3737@ FunctionalInterface
38- public interface NumberSupplier {
38+ public interface NumberSupplier {
3939
40- /**
41- * Gets the corresponding {@link javax.money.NumberValue}.
42- *
43- * @return the corresponding {@link javax.money.NumberValue}, not null.
44- */
45- NumberValue getNumber ();
40+ /**
41+ * Gets the corresponding {@link javax.money.NumberValue}.
42+ *
43+ * @return the corresponding {@link javax.money.NumberValue}, not null.
44+ */
45+ NumberValue getNumber ();
4646}
Original file line number Diff line number Diff line change 2626 *
2727 * @author Anatole Tresch
2828 */
29- public final class RoundingContext extends AbstractContext implements Serializable {
30-
29+ public final class RoundingContext extends AbstractContext implements Serializable , CurrencySupplier {
30+
3131 private static final long serialVersionUID = -1879443887564347935L ;
32-
33- /** Attribute key used for the rounding name. */
32+
33+ /**
34+ * Attribute key used for the rounding name.
35+ */
3436 static final String KEY_ROUNDING_NAME = "roundingName" ;
3537
3638 /**
@@ -56,7 +58,7 @@ public String getRoundingName(){
5658 *
5759 * @return the target CurrencyUnit, or null.
5860 */
59- public CurrencyUnit getCurrencyUnit (){
61+ public CurrencyUnit getCurrency (){
6062 return get (CurrencyUnit .class , (CurrencyUnit ) null );
6163 }
6264
Original file line number Diff line number Diff line change 2424 * <p>
2525 * This class is immutable, thread-safe and serializable.
2626 */
27- public final class RoundingQuery extends AbstractQuery {
27+ public final class RoundingQuery extends AbstractQuery implements CurrencySupplier {
2828
29- /** Attribute key used for the rounding name attribute. */
29+ /**
30+ * Attribute key used for the rounding name attribute.
31+ */
3032 static final String KEY_QUERY_ROUNDING_NAME = "Query.roundingName" ;
3133
3234 /** Attribute key used for the scale attribute. */
@@ -72,7 +74,7 @@ public Integer getScale(){
7274 *
7375 * @return the CurrencyUnit, or null.
7476 */
75- public CurrencyUnit getCurrencyUnit (){
77+ public CurrencyUnit getCurrency (){
7678 return get (CurrencyUnit .class , (CurrencyUnit ) null );
7779 }
7880
You can’t perform that action at this time.
0 commit comments