java.lang.Object
edu.hm.hafner.analysis.Severity
- All Implemented Interfaces:
Serializable
Severity of an issue. The predefined set of severities consists of an error and 3 warnings with priorities high,
normal, or low. Additional severities can be created if this set of severities is not sufficient. Note that new
instances are not cached by this class so that there might exist several severity instances with the same name.
- Author:
- Ullrich Hafner
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Collection<Severity>collectSeveritiesFrom(Severity minimumSeverity) Gets the severities starting from the specified severity toERROR.booleanbooleanequalsIgnoreCase(String severityName) Checks if this instance has a name that is equal to the specified name.getName()Returns the name of the severity.Returns the set of predefinedSeverityinstances.static SeverityguessFromString(String severity) Converts a String severity to one of the predefined severities.inthashCode()toString()static SeverityCreates a newSeveritywith the specified name.static SeverityConverts a String severity to one of the predefined severities.
-
Field Details
-
ERROR
An error, e.g. a compile error. -
WARNING_HIGH
A warning with priority high. Mapping of warning priorities is determined by the corresponding tool. -
WARNING_NORMAL
A warning with priority normal. Mapping of warning priorities is determined by the corresponding tool. -
WARNING_LOW
A warning with priority low. Mapping of warning priorities is determined by the corresponding tool.
-
-
Constructor Details
-
Severity
Creates a newSeveritywith the specified name.- Parameters:
name- the name of the severity
-
-
Method Details
-
valueOf
Creates a newSeveritywith the specified name. If the name is the same as the name of one of the predefined severities, then this existing severity is returned.- Parameters:
name- the name of the severity- Returns:
- the severity
-
valueOf
Converts a String severity to one of the predefined severities. If the provided String does not match then the default severity will be returned.- Parameters:
severity- priority as a StringdefaultValue- default severity, if the specified String isnullor is not a validSeverityname- Returns:
- enumeration value
-
guessFromString
Converts a String severity to one of the predefined severities. If the provided String does not match (even partly) then the default severity will be returned.- Parameters:
severity- the severity string- Returns:
- mapped level.
-
collectSeveritiesFrom
Gets the severities starting from the specified severity toERROR.- Parameters:
minimumSeverity- the minimum priority- Returns:
- the priorities starting from the specified priority
-
getPredefinedValues
Returns the set of predefinedSeverityinstances.- Returns:
- all predefined severities
-
getName
Returns the name of the severity.- Returns:
- the name of the severity
-
toString
-
equalsIgnoreCase
Checks if this instance has a name that is equal to the specified name.- Parameters:
severityName- the name to check- Returns:
trueif this instance has the same name,falseotherwise
-
equals
-
hashCode
public int hashCode()
-