Enum Class Severity
- All Implemented Interfaces:
Serializable
,Comparable<Severity>
,Constable
,ToNode
Severity level of a validation exception.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Check if the severity level of the error can be suppressed.static Severity
Creates a severity value from a node.fromString
(String text) Create a new Severity from a string.toNode()
Converts a value to aNode
.static Severity
Returns the enum constant of this class with the specified name.static Severity[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
SUPPRESSED
-
NOTE
-
WARNING
-
DANGER
-
ERROR
-
-
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
-
canSuppress
public boolean canSuppress()Check if the severity level of the error can be suppressed.- Returns:
- Returns true if a suppression can silence errors at this severity level.
-
fromString
Create a new Severity from a string.- Parameters:
text
- Text to convert into a severity level.- Returns:
- Returns the format in an Optional.
-
fromNode
Creates a severity value from a node.- Parameters:
node
- Node to parse.- Returns:
- Returns the parsed Severity.
- Throws:
ExpectationNotMetException
- if the node is invalid.
-
toNode
Description copied from interface:ToNode
Converts a value to aNode
.
-