Interface Account

All Known Implementing Classes:
PlayerAccount

public interface Account
Represents an economy account. Handles all XP operations.
Since:
1.0-SNAPSHOT
Author:
Isabel Maskrey
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    deposit(@NotNull BigDecimal value)
    Deposits a given amount into the account.
    @NotNull BigDecimal
    Gets the balance on the account.
    @NotNull BigInteger
    Gets the raw experience point value on the account.
    @NotNull UUID
    Gets the account owner's player UUID.
    boolean
    has(@NotNull BigDecimal value)
    Checks whether the account can withdraw a given amount.
    @NotNull Account
    setBalance(@NotNull BigDecimal value)
    Sets the balance on the account.
    @NotNull Account
    setBalance(@NotNull BigDecimal value, boolean updateXPValue)
    Sets the balance on the account and optionally updates the player's XP value.
    @NotNull Account
    setBalanceRaw(@NotNull BigInteger value, boolean updateXPValue)
    Sets the raw balance value.
    @NotNull Account
    setUUID(@NotNull UUID value)
    Sets the account owner's player UUID.
    boolean
    withdraw(@NotNull BigDecimal value)
    Withdraws a given amount from the account.
  • Method Details

    • getUUID

      @NotNull @NotNull UUID getUUID()
      Gets the account owner's player UUID.
      Returns:
      The player UUID of the account owner.
    • setUUID

      @NotNull @NotNull Account setUUID(@NotNull @NotNull UUID value)
      Sets the account owner's player UUID.
      Parameters:
      value - The account owner's UUID.
      Returns:
      The account instance.
    • getBalance

      @NotNull @NotNull BigDecimal getBalance()
      Gets the balance on the account.
      Returns:
      The account balance.
    • setBalance

      @NotNull @NotNull Account setBalance(@NotNull @NotNull BigDecimal value)
      Sets the balance on the account.
      Parameters:
      value - The new account balance.
      Returns:
      The account instance.
    • getBalanceRaw

      @NotNull @NotNull BigInteger getBalanceRaw()
      Gets the raw experience point value on the account.
      Returns:
      The raw experience point balance.
    • setBalance

      @NotNull @NotNull Account setBalance(@NotNull @NotNull BigDecimal value, boolean updateXPValue)
      Sets the balance on the account and optionally updates the player's XP value.
      Parameters:
      value - The new account balance.
      updateXPValue - If true, also updates the player's XP value to match.
      Returns:
      The account instance.
    • setBalanceRaw

      @NotNull @NotNull Account setBalanceRaw(@NotNull @NotNull BigInteger value, boolean updateXPValue)
      Sets the raw balance value.
      Parameters:
      value - The experience point balance.
      updateXPValue - If true, also updates the player's XP value to match.
      Returns:
      The account instance.
    • has

      boolean has(@NotNull @NotNull BigDecimal value)
      Checks whether the account can withdraw a given amount.
      Parameters:
      value - The amount to withdraw.
      Returns:
      Whether the account can withdraw a given amount.
    • withdraw

      boolean withdraw(@NotNull @NotNull BigDecimal value)
      Withdraws a given amount from the account.
      Parameters:
      value - The account to withdraw.
    • deposit

      boolean deposit(@NotNull @NotNull BigDecimal value)
      Deposits a given amount into the account.
      Parameters:
      value - The amount to deposit.