Enum Class AttributeOperation

java.lang.Object
java.lang.Enum<AttributeOperation>
com.github.darksoulq.abyssallib.world.data.attribute.AttributeOperation
All Implemented Interfaces:
Serializable, Comparable<AttributeOperation>, Constable

public enum AttributeOperation extends Enum<AttributeOperation>
Defines arithmetic operations that can be applied to numeric attributes via AttributeModifier.

These operations are applied in the context of numeric types such as Integer, Float, Double, Long, Short, Byte, and BigDecimal.

  • Enum Constant Details

    • ADD

      public static final AttributeOperation ADD
      Adds the modifier to the base value.

      Example: base + modifier

    • SUBTRACT

      public static final AttributeOperation SUBTRACT
      Subtracts the modifier from the base value.

      Example: base - modifier

    • MULTIPLY

      public static final AttributeOperation MULTIPLY
      Multiplies the base value by the modifier.

      Example: base * modifier

    • DIVIDE

      public static final AttributeOperation DIVIDE
      Divides the base value by the modifier. If the modifier is zero, division is skipped and the base value is returned unchanged.

      Example: base / modifier

  • Method Details

    • values

      public static AttributeOperation[] 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 AttributeOperation 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