Interface BankAccount

All Known Implementing Classes:
PlayerPartyStorage

public interface BankAccount
Represents a storage of an economy for a given entity
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    add(double amount)
    Adds the amount to the current balance Returns false if the transaction fails for any given reason (check console logs) DO NOT PASS NEGATIVE VALUES
    default boolean
    add(float amount)
    Adds the amount to the current balance Returns false if the transaction fails for any given reason (check console logs) DO NOT PASS NEGATIVE VALUES
    default boolean
    add(int amount)
    Adds the amount to the current balance Returns false if the transaction fails for any given reason (check console logs) DO NOT PASS NEGATIVE VALUES
    boolean
    add(BigDecimal amount)
    Adds the amount to the current balance Returns false if the transaction fails for any given reason (check console logs) DO NOT PASS NEGATIVE VALUES
    Gets balance of the account
    Gets the unique identifier of the given entity
    default boolean
    hasBalance(double amount)
    Checks if the account has more than the given amount
    default boolean
    hasBalance(float amount)
    Checks if the account has more than the given amount
    default boolean
    hasBalance(int amount)
    Checks if the account has more than the given amount
    boolean
    Checks if the account has more than the given amount
    default void
    setBalance(double amount)
    Sets the balance of the account
    default void
    setBalance(float amount)
    Sets the balance of the account
    default void
    setBalance(int amount)
    Sets the balance of the account
    void
    Sets the balance of the account
    default boolean
    take(double amount)
    Take the amount to the current balance Returns false if the transaction fails for any given reason (check console logs) DO NOT PASS NEGATIVE VALUES
    default boolean
    take(float amount)
    Take the amount to the current balance Returns false if the transaction fails for any given reason (check console logs) DO NOT PASS NEGATIVE VALUES
    default boolean
    take(int amount)
    Take the amount to the current balance Returns false if the transaction fails for any given reason (check console logs) DO NOT PASS NEGATIVE VALUES
    boolean
    take(BigDecimal amount)
    Take the amount to the current balance Returns false if the transaction fails for any given reason (check console logs) DO NOT PASS NEGATIVE VALUES
    default void
    Sends an update packet to the client of the player to update any local references to their balance Sends them the amount returned by getBalance()
    default void
    Sends an update packet to the client of the player to update any local references to their balance
  • Method Details

    • getIdentifier

      UUID getIdentifier()
      Gets the unique identifier of the given entity
      Returns:
      The identifier
    • getBalance

      BigDecimal getBalance()
      Gets balance of the account
      Returns:
      The amount of money
    • setBalance

      default void setBalance(int amount)
      Sets the balance of the account
      Parameters:
      amount - The new balance
    • setBalance

      default void setBalance(double amount)
      Sets the balance of the account
      Parameters:
      amount - The new balance
    • setBalance

      default void setBalance(float amount)
      Sets the balance of the account
      Parameters:
      amount - The new balance
    • setBalance

      void setBalance(BigDecimal amount)
      Sets the balance of the account
      Parameters:
      amount - The new balance
    • hasBalance

      default boolean hasBalance(float amount)
      Checks if the account has more than the given amount
      Parameters:
      amount - Amount to check
      Returns:
      True if the account has more
    • hasBalance

      default boolean hasBalance(double amount)
      Checks if the account has more than the given amount
      Parameters:
      amount - Amount to check
      Returns:
      True if the account has more
    • hasBalance

      default boolean hasBalance(int amount)
      Checks if the account has more than the given amount
      Parameters:
      amount - Amount to check
      Returns:
      True if the account has more
    • hasBalance

      boolean hasBalance(BigDecimal amount)
      Checks if the account has more than the given amount
      Parameters:
      amount - Amount to check
      Returns:
      True if the account has more
    • take

      default boolean take(int amount)
      Take the amount to the current balance Returns false if the transaction fails for any given reason (check console logs) DO NOT PASS NEGATIVE VALUES
      Parameters:
      amount - The amount being taken
      Returns:
      true if successful
    • take

      default boolean take(float amount)
      Take the amount to the current balance Returns false if the transaction fails for any given reason (check console logs) DO NOT PASS NEGATIVE VALUES
      Parameters:
      amount - The amount being taken
      Returns:
      true if successful
    • take

      default boolean take(double amount)
      Take the amount to the current balance Returns false if the transaction fails for any given reason (check console logs) DO NOT PASS NEGATIVE VALUES
      Parameters:
      amount - The amount being taken
      Returns:
      true if successful
    • take

      boolean take(BigDecimal amount)
      Take the amount to the current balance Returns false if the transaction fails for any given reason (check console logs) DO NOT PASS NEGATIVE VALUES
      Parameters:
      amount - The amount being taken
      Returns:
      true if successful
    • add

      default boolean add(int amount)
      Adds the amount to the current balance Returns false if the transaction fails for any given reason (check console logs) DO NOT PASS NEGATIVE VALUES
      Parameters:
      amount - The amount being added
      Returns:
      true if successful
    • add

      default boolean add(float amount)
      Adds the amount to the current balance Returns false if the transaction fails for any given reason (check console logs) DO NOT PASS NEGATIVE VALUES
      Parameters:
      amount - The amount being added
      Returns:
      true if successful
    • add

      default boolean add(double amount)
      Adds the amount to the current balance Returns false if the transaction fails for any given reason (check console logs) DO NOT PASS NEGATIVE VALUES
      Parameters:
      amount - The amount being added
      Returns:
      true if successful
    • add

      boolean add(BigDecimal amount)
      Adds the amount to the current balance Returns false if the transaction fails for any given reason (check console logs) DO NOT PASS NEGATIVE VALUES
      Parameters:
      amount - The amount being added
      Returns:
      true if successful
    • updatePlayer

      default void updatePlayer(BigDecimal amount)
      Sends an update packet to the client of the player to update any local references to their balance
      Parameters:
      amount - The amount being updated to
    • updatePlayer

      default void updatePlayer()
      Sends an update packet to the client of the player to update any local references to their balance Sends them the amount returned by getBalance()