Interface EconomyAdapter
- All Known Implementing Classes:
ReserveEconomyAdapter
,ReserveEconomyAdapter.Legacy
,VaultEconomyAdapter
,VaultEconomyAdapter.Legacy
,VaultUnlockedEconomyAdapter
@Internal
public interface EconomyAdapter
An adapter that is used to adapt multiple
economy implementations.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Attempts to add money to an account.void
deleteAccount
(Account account) Removes an account.double
getBalance
(Account account) Gets the balance of the account.getFormattedBalance
(double balance) Get's the proper formatting for a given balance.boolean
hasAccount
(Account account) Checks whether the given account exists.name()
void
newAccount
(Account account) Attempts to create an account.boolean
renameAccount
(Account account, String newName) Renames an account.boolean
setBalance
(Account account, double amount) Sets the balance of the account.boolean
Attempts to subtract money from an account.
-
Method Details
-
name
String name() -
add
Attempts to add money to an account.- Parameters:
account
- The account.amount
- The amount to add.- Returns:
- A boolean indicating success.
-
subtract
Attempts to subtract money from an account.- Parameters:
account
- The account.amount
- The amount to add.- Returns:
- A boolean indicating success.
-
hasAccount
Checks whether the given account exists.- Parameters:
account
- The account.- Returns:
- A boolean indicating success.
-
getBalance
Gets the balance of the account.- Parameters:
account
- The account.- Returns:
- A boolean indicating success.
-
newAccount
Attempts to create an account.- Parameters:
account
- The name of the new account.
-
deleteAccount
Removes an account.- Parameters:
account
- The name of the account to remove.
-
renameAccount
Renames an account.- Parameters:
account
- the Account to rename.newName
- the name to give the Account.
-
setBalance
Sets the balance of the account.- Parameters:
account
- The account.amount
- The amount to add.- Returns:
- A boolean indicating success.
-
getFormattedBalance
Get's the proper formatting for a given balance.- Parameters:
balance
- The balance to format.- Returns:
- A string with the balance formatted.
-