Package com.comphenix.protocol.wrappers
Enum Class WrappedAttributeModifier.Operation
java.lang.Object
java.lang.Enum<WrappedAttributeModifier.Operation>
com.comphenix.protocol.wrappers.WrappedAttributeModifier.Operation
- All Implemented Interfaces:
Serializable,Comparable<WrappedAttributeModifier.Operation>,Constable
- Enclosing class:
WrappedAttributeModifier
public static enum WrappedAttributeModifier.Operation
extends Enum<WrappedAttributeModifier.Operation>
Represents the different modifier operations.
The final value is computed as follows:
- Set X = base value.
- Execute all modifiers with
ADD_NUMBER. - Set Y = X.
- Execute all modifiers with
MULTIPLY_PERCENTAGE. - Execute all modifiers with
ADD_PERCENTAGE. - Y is the final value.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionIncrement X by amount.Multiply Y by (1 + amount)Increment Y by X * amount. -
Method Summary
Modifier and TypeMethodDescriptionfromId(int id) Retrieve the associated operation from an ID.intgetId()Retrieve the unique operation ID.Returns the enum constant of this class with the specified name.static WrappedAttributeModifier.Operation[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ADD_NUMBER
Increment X by amount. -
MULTIPLY_PERCENTAGE
Increment Y by X * amount. -
ADD_PERCENTAGE
Multiply Y by (1 + amount)
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
getId
public int getId()Retrieve the unique operation ID.- Returns:
- Operation ID.
-
fromId
Retrieve the associated operation from an ID.- Parameters:
id- - the ID.- Returns:
- The operation.
-