Skip to content

Commit 8a0585f

Browse files
committed
Updated Javadocs for method clarity
Enhanced documentation across `EconomyController` and `CurrencyHolder`. Clarified behaviors, improved annotations, and ensured consistent descriptions for return values and exceptions.
1 parent 72f62c0 commit 8a0585f

File tree

2 files changed

+20
-12
lines changed

2 files changed

+20
-12
lines changed

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

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,11 @@ default CompletableFuture<Optional<Account>> tryGetAccount(UUID uuid, @Nullable
182182

183183
/**
184184
* Creates an account for the specified player.
185+
* <p>
186+
* Completes with an {@link IllegalStateException} if a similar account already exists
185187
*
186188
* @param player the player for whom the account will be created
187189
* @return a CompletableFuture that will complete with the created account
188-
* @throws IllegalStateException if a similar account already exists
189190
*/
190191
@Contract("_ -> new")
191192
default CompletableFuture<Account> createAccount(OfflinePlayer player) {
@@ -194,6 +195,8 @@ default CompletableFuture<Account> createAccount(OfflinePlayer player) {
194195

195196
/**
196197
* Creates an account for the specified player in the specified world.
198+
* <p>
199+
* Completes with an {@link IllegalStateException} if a similar account already exists
197200
*
198201
* @param player the player for whom the account will be created
199202
* @param world the world in which the player's account will be created
@@ -206,6 +209,8 @@ default CompletableFuture<Account> createAccount(OfflinePlayer player, @Nullable
206209

207210
/**
208211
* Creates an account with the given uuid.
212+
* <p>
213+
* Completes with an {@link IllegalStateException} if a similar account already exists
209214
*
210215
* @param uuid the uuid of the account to be created
211216
* @return a CompletableFuture that will complete with the created account
@@ -217,6 +222,8 @@ default CompletableFuture<Account> createAccount(UUID uuid) {
217222

218223
/**
219224
* Creates an account with the given uuid and world.
225+
* <p>
226+
* Completes with an {@link IllegalStateException} if a similar account already exists
220227
*
221228
* @param uuid the uuid of the account to be created
222229
* @param world the world in which the account will be created
@@ -269,49 +276,49 @@ default CompletableFuture<Optional<Account>> loadAccount(UUID uuid) {
269276
* Deletes the specified account.
270277
*
271278
* @param account the account to be deleted
272-
* @return a CompletableFuture that will complete when the account is deleted
279+
* @return a {@code CompletableFuture} completing with a boolean indicating whether the account was deleted
273280
*/
274281
default CompletableFuture<Boolean> deleteAccount(Account account) {
275282
return deleteAccount(account.getOwner(), account.getWorld().orElse(null));
276283
}
277284

278285
/**
279-
* Deletes the account of the specified player.
286+
* Deletes the account of the given player.
280287
*
281288
* @param player the player whose account will be deleted
282-
* @return a CompletableFuture that will complete when the account is deleted
289+
* @return a {@code CompletableFuture} completing with a boolean indicating whether the account was deleted
283290
*/
284291
default CompletableFuture<Boolean> deleteAccount(OfflinePlayer player) {
285292
return deleteAccount(player, null);
286293
}
287294

288295
/**
289-
* Deletes the account of the specified player in the specified world.
296+
* Deletes the account of the given player in the specified world.
290297
*
291298
* @param player the player whose account will be deleted
292299
* @param world the world in which the player's account exists
293-
* @return a CompletableFuture that will complete when the account is deleted
300+
* @return a {@code CompletableFuture} completing with a boolean indicating whether the account was deleted
294301
*/
295302
default CompletableFuture<Boolean> deleteAccount(OfflinePlayer player, @Nullable World world) {
296303
return deleteAccount(player.getUniqueId(), world);
297304
}
298305

299306
/**
300-
* Deletes the account with the specified uuid.
307+
* Deletes the account of the given owner's UUID.
301308
*
302309
* @param uuid the uuid of the account to be deleted
303-
* @return a CompletableFuture that will complete when the account is deleted
310+
* @return a {@code CompletableFuture} completing with a boolean indicating whether the account was deleted
304311
*/
305312
default CompletableFuture<Boolean> deleteAccount(UUID uuid) {
306313
return deleteAccount(uuid, null);
307314
}
308315

309316
/**
310-
* Deletes the account with the specified uuid in the specified world.
317+
* Deletes the account of the given owner's uuid in the specified world.
311318
*
312319
* @param uuid the uuid of the account to be deleted
313320
* @param world the world in which the account exists
314-
* @return a CompletableFuture that will complete when the account is deleted
321+
* @return a {@code CompletableFuture} completing with a boolean indicating whether the account was deleted
315322
*/
316323
CompletableFuture<Boolean> deleteAccount(UUID uuid, @Nullable World world);
317324

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ default int fractionalDigits() {
3939
}
4040

4141
/**
42-
* Retrieves all currencies managed by the currency holder.
42+
* Retrieves all currencies managed by the currency holder,
43+
* including the {@link #getDefaultCurrency() default currency}.
4344
*
4445
* @return an unmodifiable set of currencies
4546
* @throws UnsupportedOperationException if {@link #hasMultiCurrencySupport()} is {@code false}
@@ -111,7 +112,7 @@ default boolean deleteCurrency(String name) {
111112
Currency getDefaultCurrency();
112113

113114
/**
114-
* Determines whether the economy controller supports multiple currencies.
115+
* Determines whether the holder supports multiple currencies.
115116
*
116117
* @return {@code true} if multi-currency is supported, otherwise {@code false}
117118
* @implSpec If multiple currencies are supported, all respective methods have to be implemented.

0 commit comments

Comments
 (0)