Skip to content

Commit 19609ae

Browse files
committed
Unified getCurrency/setCurrency method names. Adapted to this change.
1 parent 04945be commit 19609ae

File tree

3 files changed

+22
-18
lines changed

3 files changed

+22
-18
lines changed

src/main/java/javax/money/NumberSupplier.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
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()}.
@@ -31,16 +31,16 @@
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
}

src/main/java/javax/money/RoundingContext.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@
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

src/main/java/javax/money/RoundingQuery.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@
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

0 commit comments

Comments
 (0)