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 Details

    • name

      String name()
    • add

      boolean add(Account account, double amount)
      Attempts to add money to an account.
      Parameters:
      account - The account.
      amount - The amount to add.
      Returns:
      A boolean indicating success.
    • subtract

      boolean subtract(Account account, double amount)
      Attempts to subtract money from an account.
      Parameters:
      account - The account.
      amount - The amount to add.
      Returns:
      A boolean indicating success.
    • hasAccount

      boolean hasAccount(Account account)
      Checks whether the given account exists.
      Parameters:
      account - The account.
      Returns:
      A boolean indicating success.
    • getBalance

      double getBalance(Account account)
      Gets the balance of the account.
      Parameters:
      account - The account.
      Returns:
      A boolean indicating success.
    • newAccount

      void newAccount(Account account)
      Attempts to create an account.
      Parameters:
      account - The name of the new account.
    • deleteAccount

      void deleteAccount(Account account)
      Removes an account.
      Parameters:
      account - The name of the account to remove.
    • renameAccount

      boolean renameAccount(Account account, String newName)
      Renames an account.
      Parameters:
      account - the Account to rename.
      newName - the name to give the Account.
    • setBalance

      boolean setBalance(Account account, double amount)
      Sets the balance of the account.
      Parameters:
      account - The account.
      amount - The amount to add.
      Returns:
      A boolean indicating success.
    • getFormattedBalance

      String getFormattedBalance(double balance)
      Get's the proper formatting for a given balance.
      Parameters:
      balance - The balance to format.
      Returns:
      A string with the balance formatted.