Skip to content

Commit 65b6d1b

Browse files
committed
Bumped version to 3.0.0-pre1
Updated deprecation annotations to mark methods for removal in version 3.0.0. Added `@since 3.0.0` annotations to newly introduced methods in `CurrencyHolder`.
1 parent 619d4eb commit 65b6d1b

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

src/main/java/net/thenextlvl/service/api/economy/Account.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public interface Account extends Comparable<Account> {
2828
* @return the new balance after the deposit
2929
* @deprecated use {@link #deposit(Number, Currency)}
3030
*/
31-
@Deprecated(forRemoval = true, since = "2.4.0")
31+
@Deprecated(forRemoval = true, since = "3.0.0")
3232
default BigDecimal deposit(Number amount) {
3333
return deposit(amount, getController().getDefaultCurrency());
3434
}
@@ -48,7 +48,7 @@ default BigDecimal deposit(Number amount) {
4848
* @return the balance of the account
4949
* @deprecated use {@link #getBalance(Currency)}
5050
*/
51-
@Deprecated(forRemoval = true, since = "2.4.0")
51+
@Deprecated(forRemoval = true, since = "3.0.0")
5252
default BigDecimal getBalance() {
5353
return getBalance(getController().getDefaultCurrency());
5454
}
@@ -62,7 +62,7 @@ default BigDecimal getBalance() {
6262
* @return the new balance after the withdrawal
6363
* @deprecated use {@link #withdraw(Number, Currency)}
6464
*/
65-
@Deprecated(forRemoval = true, since = "2.4.0")
65+
@Deprecated(forRemoval = true, since = "3.0.0")
6666
default BigDecimal withdraw(Number amount) {
6767
return withdraw(amount, getController().getDefaultCurrency());
6868
}
@@ -99,7 +99,7 @@ default BigDecimal withdraw(Number amount) {
9999
* @deprecated use {@link #compareTo(Account, Currency)}
100100
*/
101101
@Override
102-
@Deprecated(forRemoval = true, since = "2.4.0")
102+
@Deprecated(forRemoval = true, since = "3.0.0")
103103
default int compareTo(Account account) {
104104
return compareTo(account, getController().getDefaultCurrency());
105105
}
@@ -122,7 +122,7 @@ default int compareTo(Account account, Currency currency) {
122122
* @param balance the new balance of the account
123123
* @deprecated use {@link #setBalance(Number, Currency)}
124124
*/
125-
@Deprecated(forRemoval = true, since = "2.4.0")
125+
@Deprecated(forRemoval = true, since = "3.0.0")
126126
default void setBalance(Number balance) {
127127
setBalance(balance, getController().getDefaultCurrency());
128128
}

src/main/java/net/thenextlvl/service/api/economy/EconomyController.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public interface EconomyController extends Controller, CurrencyHolder {
2828
* @return the plural form of the currency name as a string
2929
* @deprecated use {@link Currency#getDisplayNamePlural(Locale)}
3030
*/
31-
@Deprecated(forRemoval = true, since = "2.4.0")
31+
@Deprecated(forRemoval = true, since = "3.0.0")
3232
default String getCurrencyNamePlural(Locale locale) {
3333
return PlainTextComponentSerializer.plainText().serialize(getDefaultCurrency().getDisplayNamePlural(locale));
3434
}
@@ -40,7 +40,7 @@ default String getCurrencyNamePlural(Locale locale) {
4040
* @return the name of the currency as a string
4141
* @deprecated use {@link Currency#getDisplayNameSingular(Locale)}
4242
*/
43-
@Deprecated(forRemoval = true, since = "2.4.0")
43+
@Deprecated(forRemoval = true, since = "3.0.0")
4444
default String getCurrencyNameSingular(Locale locale) {
4545
return PlainTextComponentSerializer.plainText().serialize(getDefaultCurrency().getDisplayNameSingular(locale));
4646
}
@@ -51,7 +51,7 @@ default String getCurrencyNameSingular(Locale locale) {
5151
* @return the currency symbol as a string
5252
* @deprecated use {@link Currency#getSymbol()}
5353
*/
54-
@Deprecated(forRemoval = true, since = "2.4.0")
54+
@Deprecated(forRemoval = true, since = "3.0.0")
5555
default String getCurrencySymbol() {
5656
return PlainTextComponentSerializer.plainText().serialize(getDefaultCurrency().getSymbol());
5757
}

src/main/java/net/thenextlvl/service/api/economy/currency/CurrencyHolder.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public interface CurrencyHolder {
2121
* @return the formatted amount as a string
2222
* @deprecated use {@link Currency#format(Number, Locale)}
2323
*/
24-
@Deprecated(forRemoval = true, since = "2.4.0")
24+
@Deprecated(forRemoval = true, since = "3.0.0")
2525
default String format(Number amount) {
2626
return PlainTextComponentSerializer.plainText().serialize(getDefaultCurrency().format(amount, Locale.US));
2727
}
@@ -32,7 +32,7 @@ default String format(Number amount) {
3232
* @return the number of fractional digits used for formatting currency amounts
3333
* @deprecated use {@link Currency#getFractionalDigits()}
3434
*/
35-
@Deprecated(forRemoval = true, since = "2.4.0")
35+
@Deprecated(forRemoval = true, since = "3.0.0")
3636
default int fractionalDigits() {
3737
return getDefaultCurrency().getFractionalDigits();
3838
}
@@ -42,6 +42,7 @@ default int fractionalDigits() {
4242
*
4343
* @return an unmodifiable set of currencies
4444
* @throws UnsupportedOperationException if {@link #hasMultiCurrencySupport()} is {@code false}
45+
* @since 3.0.0
4546
*/
4647
default @Unmodifiable Set<Currency> getCurrencies() {
4748
throw new UnsupportedOperationException("Not implemented yet");
@@ -53,6 +54,7 @@ default int fractionalDigits() {
5354
* @param name the name of the currency to retrieve
5455
* @return an {@code Optional} containing the currency, or empty
5556
* @throws UnsupportedOperationException if {@link #hasMultiCurrencySupport()} is {@code false}
57+
* @since 3.0.0
5658
*/
5759
default Optional<Currency> getCurrency(String name) {
5860
throw new UnsupportedOperationException("Not implemented yet");
@@ -64,6 +66,7 @@ default Optional<Currency> getCurrency(String name) {
6466
* @param name the name of the currency to check for existence
6567
* @return {@code true} if the currency exists, otherwise {@code false}
6668
* @throws UnsupportedOperationException if {@link #hasMultiCurrencySupport()} is {@code false}
69+
* @since 3.0.0
6770
*/
6871
default boolean hasCurrency(String name) {
6972
throw new UnsupportedOperationException("Not implemented yet");
@@ -78,6 +81,7 @@ default boolean hasCurrency(String name) {
7881
* @param builder a consumer to configure the {@link Currency.Builder} for currency creation
7982
* @return an optional containing the created {@link Currency}, or empty
8083
* @throws UnsupportedOperationException if {@link #hasMultiCurrencySupport()} is {@code false}
84+
* @since 3.0.0
8185
*/
8286
default Optional<Currency> createCurrency(String name, Consumer<Currency.Builder> builder) {
8387
throw new UnsupportedOperationException("Not implemented yet");
@@ -89,6 +93,7 @@ default Optional<Currency> createCurrency(String name, Consumer<Currency.Builder
8993
* @param name the name of the currency to delete
9094
* @return {@code true} if the currency was successfully deleted, otherwise {@code false}
9195
* @throws UnsupportedOperationException if {@link #hasMultiCurrencySupport()} is {@code false}
96+
* @since 3.0.0
9297
*/
9398
default boolean deleteCurrency(String name) {
9499
throw new UnsupportedOperationException("Not implemented yet");
@@ -98,6 +103,7 @@ default boolean deleteCurrency(String name) {
98103
* Retrieves the default currency for this economy controller.
99104
*
100105
* @return the default currency
106+
* @since 3.0.0
101107
*/
102108
Currency getDefaultCurrency();
103109

@@ -111,6 +117,7 @@ default boolean deleteCurrency(String name) {
111117
* @see #getCurrencies()
112118
* @see #getCurrency(String)
113119
* @see #hasCurrency(String)
120+
* @since 3.0.0
114121
*/
115122
default boolean hasMultiCurrencySupport() {
116123
return false;

0 commit comments

Comments
 (0)