Enum Class EconomyMethod

java.lang.Object
java.lang.Enum<EconomyMethod>
dev.satyrn.xpeconomy.utils.EconomyMethod
All Implemented Interfaces:
Serializable, Comparable<EconomyMethod>, Constable

public enum EconomyMethod extends Enum<EconomyMethod>
Economy processing method.
  • Enum Constant Details

    • POINTS

      public static final EconomyMethod POINTS
      Economy method for individual points.
    • LEVELS

      public static final EconomyMethod LEVELS
      Economy method for levels.
    • PER_HUNDRED

      public static final EconomyMethod PER_HUNDRED
      Economy method for per-hundred XP points.
  • Method Details

    • values

      public static EconomyMethod[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static EconomyMethod valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getDefault

      public static EconomyMethod getDefault()
      Returns the default economy method value.
      Returns:
      POINTS
    • getScale

      public int getScale()
      Returns the decimal scale of the economy method.
      Returns:
      The decimal scale of the economy method.
    • getRoundingMode

      public RoundingMode getRoundingMode()
      Returns the rounding mode to use when converting the economy method balance.
      Returns:
      The rounding mode to use when converting the economy method balance.
    • scale

      @NotNull public @NotNull BigDecimal scale(@NotNull @NotNull BigDecimal value)
      Scales the value to the economy mode.
      Parameters:
      value - The value to scale.
      Returns:
      The scaled value.
    • toString

      @NotNull public @NotNull String toString(@NotNull @NotNull BigDecimal value)
      Transforms a value into a string representation. Does not append economy name.
      Parameters:
      value - The value to convert.
      Returns:
      The value as a string.
    • toString

      @NotNull public @NotNull String toString(@NotNull @NotNull BigDecimal value, boolean includeCurrencyName)
      Transforms a value into a string representation.
      Parameters:
      value - The value to convert.
      includeCurrencyName - Whether to include the translated currency name.
      Returns:
      The transformed value.
    • getCurrencyName

      @NotNull public @NotNull String getCurrencyName()
      Gets the translated currency name.
      Returns:
      The translated currency name.
    • getCurrencyNamePlural

      @NotNull public @NotNull String getCurrencyNamePlural()
      Gets the translated plural currency name.
      Returns:
      The translated plural currency name.
    • fromRawBalance

      @NotNull public @NotNull BigDecimal fromRawBalance(BigInteger rawBalance)
      Converts raw XP values into economy values.
      Parameters:
      rawBalance - The raw XP value.
      Returns:
      The economy value.
    • toRawBalance

      @NotNull public @NotNull BigInteger toRawBalance(BigDecimal balance, BigInteger rawBalance)
      Converts economy values into raw XP values.
      Parameters:
      balance - The current economy value.
      rawBalance - The current XP value. Used to properly add levels. Can be set to 0 if it should not be used.
      Returns:
      The raw XP value.