Class VaultEconomyAdapter

java.lang.Object
com.palmergames.bukkit.towny.object.economy.adapter.VaultEconomyAdapter
All Implemented Interfaces:
EconomyAdapter
Direct Known Subclasses:
VaultEconomyAdapter.Legacy

public class VaultEconomyAdapter extends Object implements EconomyAdapter
  • Field Details

    • economy

      protected final net.milkbowl.vault.economy.Economy economy
  • Constructor Details

    • VaultEconomyAdapter

      public VaultEconomyAdapter(net.milkbowl.vault.economy.Economy economy)
  • Method Details

    • name

      public String name()
      Specified by:
      name in interface EconomyAdapter
    • add

      public boolean add(Account account, double amount)
      Description copied from interface: EconomyAdapter
      Attempts to add money to an account.
      Specified by:
      add in interface EconomyAdapter
      Parameters:
      account - The account.
      amount - The amount to add.
      Returns:
      A boolean indicating success.
    • subtract

      public boolean subtract(Account account, double amount)
      Description copied from interface: EconomyAdapter
      Attempts to subtract money from an account.
      Specified by:
      subtract in interface EconomyAdapter
      Parameters:
      account - The account.
      amount - The amount to add.
      Returns:
      A boolean indicating success.
    • hasAccount

      public boolean hasAccount(Account account)
      Description copied from interface: EconomyAdapter
      Checks whether the given account exists.
      Specified by:
      hasAccount in interface EconomyAdapter
      Parameters:
      account - The account.
      Returns:
      A boolean indicating success.
    • getBalance

      public double getBalance(Account account)
      Description copied from interface: EconomyAdapter
      Gets the balance of the account.
      Specified by:
      getBalance in interface EconomyAdapter
      Parameters:
      account - The account.
      Returns:
      A boolean indicating success.
    • newAccount

      public void newAccount(Account account)
      Description copied from interface: EconomyAdapter
      Attempts to create an account.
      Specified by:
      newAccount in interface EconomyAdapter
      Parameters:
      account - The name of the new account.
    • deleteAccount

      public void deleteAccount(Account account)
      Description copied from interface: EconomyAdapter
      Removes an account.
      Specified by:
      deleteAccount in interface EconomyAdapter
      Parameters:
      account - The name of the account to remove.
    • setBalance

      public boolean setBalance(Account account, double amount)
      Description copied from interface: EconomyAdapter
      Sets the balance of the account.
      Specified by:
      setBalance in interface EconomyAdapter
      Parameters:
      account - The account.
      amount - The amount to add.
      Returns:
      A boolean indicating success.
    • getFormattedBalance

      public String getFormattedBalance(double balance)
      Description copied from interface: EconomyAdapter
      Get's the proper formatting for a given balance.
      Specified by:
      getFormattedBalance in interface EconomyAdapter
      Parameters:
      balance - The balance to format.
      Returns:
      A string with the balance formatted.
    • renameAccount

      public boolean renameAccount(Account account, String newName)
      Description copied from interface: EconomyAdapter
      Renames an account.
      Specified by:
      renameAccount in interface EconomyAdapter
      Parameters:
      account - the Account to rename.
      newName - the name to give the Account.