|
| 1 | +package net.thenextlvl.services.economy.account; |
| 2 | + |
| 3 | +import org.bukkit.OfflinePlayer; |
| 4 | + |
| 5 | +import java.util.UUID; |
| 6 | +import java.util.concurrent.CompletableFuture; |
| 7 | + |
| 8 | +/** |
| 9 | + * The AccountController interface provides methods to create, retrieve and delete accounts. |
| 10 | + */ |
| 11 | +public interface AccountController { |
| 12 | + /** |
| 13 | + * Creates an account with the given unique ID. |
| 14 | + * |
| 15 | + * @param uniqueId the unique ID of the account to be created |
| 16 | + * @return a CompletableFuture that will complete with the created account |
| 17 | + */ |
| 18 | + CompletableFuture<Account> createAccount(UUID uniqueId); |
| 19 | + |
| 20 | + /** |
| 21 | + * Creates an account for the specified player. |
| 22 | + * |
| 23 | + * @param player the player for whom the account will be created |
| 24 | + * @return a CompletableFuture that will complete with the created account |
| 25 | + */ |
| 26 | + CompletableFuture<Account> createAccount(OfflinePlayer player); |
| 27 | + |
| 28 | + /** |
| 29 | + * Retrieves the account for the specified player. |
| 30 | + * |
| 31 | + * @param player the player for whom the account will be retrieved |
| 32 | + * @return a CompletableFuture that will complete with the retrieved account |
| 33 | + */ |
| 34 | + CompletableFuture<Account> getAccount(OfflinePlayer player); |
| 35 | + |
| 36 | + /** |
| 37 | + * Retrieves the account with the specified unique ID. |
| 38 | + * |
| 39 | + * @param uniqueId the unique ID of the account to be retrieved |
| 40 | + * @return a CompletableFuture that will complete with the retrieved account |
| 41 | + */ |
| 42 | + CompletableFuture<Account> getAccount(UUID uniqueId); |
| 43 | + |
| 44 | + /** |
| 45 | + * Deletes the specified account. |
| 46 | + * |
| 47 | + * @param account the account to be deleted |
| 48 | + * @return a CompletableFuture that will complete when the account is deleted |
| 49 | + */ |
| 50 | + CompletableFuture<Void> deleteAccount(Account account); |
| 51 | + |
| 52 | + /** |
| 53 | + * Deletes the account of the specified player. |
| 54 | + * |
| 55 | + * @param player the player whose account will be deleted |
| 56 | + * @return a CompletableFuture that will complete when the account is deleted |
| 57 | + */ |
| 58 | + CompletableFuture<Void> deleteAccount(OfflinePlayer player); |
| 59 | + |
| 60 | + /** |
| 61 | + * Deletes the account with the specified unique ID. |
| 62 | + * |
| 63 | + * @param uniqueId the unique ID of the account to be deleted |
| 64 | + * @return a CompletableFuture that will complete when the account is deleted |
| 65 | + */ |
| 66 | + CompletableFuture<Void> deleteAccount(UUID uniqueId); |
| 67 | +} |
0 commit comments