Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

Commit 58d81f3

Browse files
author
Otavio
committed
put Deprecated the construtor in RoundedMoney
1 parent 651b590 commit 58d81f3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/main/java/org/javamoney/moneta/RoundedMoney.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,12 @@ public final class RoundedMoney implements MonetaryAmount, Comparable<MonetaryAm
9191
* @param currency the currency, not null.
9292
* @param number the amount, not null.
9393
*/
94+
@Deprecated
9495
public RoundedMoney(Number number, CurrencyUnit currency, MonetaryOperator rounding) {
9596
this(number, currency, null, rounding);
9697
}
9798

99+
@Deprecated
98100
public RoundedMoney(Number number, CurrencyUnit currency, MathContext mathContext) {
99101
Objects.requireNonNull(currency, "Currency is required.");
100102
this.currency = currency;
@@ -107,6 +109,7 @@ public RoundedMoney(Number number, CurrencyUnit currency, MathContext mathContex
107109
this.number = MoneyUtils.getBigDecimal(number, monetaryContext);
108110
}
109111

112+
@Deprecated
110113
public RoundedMoney(Number number, CurrencyUnit currency, MonetaryContext context, MonetaryOperator rounding) {
111114
Objects.requireNonNull(currency, "Currency is required.");
112115
this.currency = currency;
@@ -197,6 +200,7 @@ public static RoundedMoney of(BigDecimal number, CurrencyUnit currency, MathCont
197200
* @param number The numeric part, not null.
198201
* @return A new instance of {@link RoundedMoney}.
199202
*/
203+
@Deprecated
200204
public static RoundedMoney of(Number number, CurrencyUnit currency) {
201205
return new RoundedMoney(number, currency, (MonetaryOperator) null);
202206
}
@@ -234,6 +238,7 @@ public static RoundedMoney of(Number number, CurrencyUnit currency, MonetaryCont
234238
* @param rounding The rounding to be applied.
235239
* @return A new instance of {@link RoundedMoney}.
236240
*/
241+
@Deprecated
237242
public static RoundedMoney of(CurrencyUnit currency, Number number, MonetaryContext monetaryContext,
238243
MonetaryOperator rounding) {
239244
return new RoundedMoney(number, currency,
@@ -247,6 +252,7 @@ public static RoundedMoney of(CurrencyUnit currency, Number number, MonetaryCont
247252
* @param number The numeric part, not null.
248253
* @return A new instance of {@link RoundedMoney}.
249254
*/
255+
@Deprecated
250256
public static RoundedMoney of(Number number, String currencyCode) {
251257
return new RoundedMoney(number, Monetary.getCurrency(currencyCode),
252258
Monetary.getDefaultRounding());
@@ -271,6 +277,7 @@ public static RoundedMoney of(Number number, String currencyCode, MonetaryOperat
271277
* @param number The numeric part, not null.
272278
* @return A new instance of {@link RoundedMoney}.
273279
*/
280+
@Deprecated
274281
public static RoundedMoney of(Number number, String currencyCode, MonetaryContext monetaryContext) {
275282
return new RoundedMoney(number, Monetary.getCurrency(currencyCode),
276283
DEFAULT_MONETARY_CONTEXT.toBuilder().importContext(monetaryContext).build(), null);

0 commit comments

Comments
 (0)