Package net.sourceforge.pmd.lang.rule
Enum Class RulePriority
- All Implemented Interfaces:
Serializable,Comparable<RulePriority>,Constable
These are the possible Rule priority values.
For backward compatibility, priorities range in value from 1 to 5, with 5
being the lowest priority. This means the ordinal value of the Enum should be
avoided in favor of
getPriority() and
valueOf(int)- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionHigh: Change absolutely required.Low: Change highly optional.Medium: Change recommended.Medium to high: Change highly recommended.Medium to low: Change optional. -
Method Summary
Modifier and TypeMethodDescriptiongetName()Get the descriptive name of this priority.intGet the priority value as a number.toString()Returns the descriptive name of the priority.static RulePriorityvalueOf(int priority) Get the priority which corresponds to the given number as returned bygetPriority().static RulePriorityReturns the enum constant of this class with the specified name.static RulePriorityvalueOfNullable(int priority) Returns the priority which corresponds to the given number as returned bygetPriority().static RulePriorityvalueOfNullable(String priority) Returns the priority which corresponds to the given number as returned bygetPriority().static RulePriority[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
HIGH
High: Change absolutely required. Behavior is critically broken/buggy -
MEDIUM_HIGH
Medium to high: Change highly recommended. Behavior is quite likely to be broken/buggy. -
MEDIUM
Medium: Change recommended. Behavior is confusing, perhaps buggy, and/or against standards/best practices. -
MEDIUM_LOW
Medium to low: Change optional. Behavior is not likely to be buggy, but more just flies in the face of standards/style/good taste. -
LOW
Low: Change highly optional. Nice to have, such as a consistent naming policy for package/class/fields...
-
-
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
-
getPriority
public int getPriority()Get the priority value as a number. This is the value to be used in the externalized form of a priority (e.g. in RuleSet XML).- Returns:
- The
intvalue of the priority.
-
getName
Get the descriptive name of this priority.- Returns:
- The descriptive name.
-
toString
Returns the descriptive name of the priority.- Overrides:
toStringin classEnum<RulePriority>- Returns:
- descriptive name of the priority
- See Also:
-
valueOf
Get the priority which corresponds to the given number as returned bygetPriority(). If the number is an invalid value, thenLOWwill be returned.- Parameters:
priority- The numeric priority value.- Returns:
- The priority.
-
valueOfNullable
Returns the priority which corresponds to the given number as returned bygetPriority(). If the number is an invalid value, then null will be returned.- Parameters:
priority- The numeric priority value.
-
valueOfNullable
Returns the priority which corresponds to the given number as returned bygetPriority(). If the number is an invalid value, then null will be returned.- Parameters:
priority- The numeric priority value.
-