Klasse Severity

java.lang.Object
edu.hm.hafner.analysis.Severity
Alle implementierten Schnittstellen:
Serializable

@Immutable public class Severity extends Object implements 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.
Autor:
Ullrich Hafner
Siehe auch:
  • Felddetails

    • ERROR

      public static final Severity ERROR
      An error, e.g. a compile error.
    • WARNING_HIGH

      public static final Severity WARNING_HIGH
      A warning with priority high. Mapping of warning priorities is determined by the corresponding tool.
    • WARNING_NORMAL

      public static final Severity WARNING_NORMAL
      A warning with priority normal. Mapping of warning priorities is determined by the corresponding tool.
    • WARNING_LOW

      public static final Severity WARNING_LOW
      A warning with priority low. Mapping of warning priorities is determined by the corresponding tool.
  • Konstruktordetails

    • Severity

      public Severity(String name)
      Creates a new Severity with the specified name.
      Parameter:
      name - the name of the severity
  • Methodendetails

    • valueOf

      public static Severity valueOf(String name)
      Creates a new Severity with the specified name. If the name is the same as the name of one of the predefined severities, then this existing severity is returned.
      Parameter:
      name - the name of the severity
      Gibt zurück:
      the severity
    • valueOf

      public static Severity valueOf(@CheckForNull String severity, Severity defaultValue)
      Converts a String severity to one of the predefined severities. If the provided String does not match then the default severity will be returned.
      Parameter:
      severity - priority as a String
      defaultValue - default severity, if the specified String is null or is not a valid Severity name
      Gibt zurück:
      enumeration value
    • guessFromString

      public static Severity guessFromString(@CheckForNull String severity)
      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.
      Parameter:
      severity - the severity string
      Gibt zurück:
      mapped level.
    • collectSeveritiesFrom

      public static Collection<Severity> collectSeveritiesFrom(Severity minimumSeverity)
      Gets the severities starting from the specified severity to ERROR.
      Parameter:
      minimumSeverity - the minimum priority
      Gibt zurück:
      the priorities starting from the specified priority
    • getPredefinedValues

      public static Set<Severity> getPredefinedValues()
      Returns the set of predefined Severity instances.
      Gibt zurück:
      all predefined severities
    • getName

      public String getName()
      Returns the name of the severity.
      Gibt zurück:
      the name of the severity
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object
    • equalsIgnoreCase

      public boolean equalsIgnoreCase(String severityName)
      Checks if this instance has a name that is equal to the specified name.
      Parameter:
      severityName - the name to check
      Gibt zurück:
      true if this instance has the same name, false otherwise
    • equals

      public boolean equals(@CheckForNull Object o)
      Setzt außer Kraft:
      equals in Klasse Object
    • hashCode

      public int hashCode()
      Setzt außer Kraft:
      hashCode in Klasse Object