Enum Severity

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Severity>

    public enum Severity
    extends java.lang.Enum<Severity>
    Severity values used by the Syslog system.
    Numerical Code Severity
    0 Emergency: system is unusable
    1 Alert: action must be taken immediately
    2 Critical: critical conditions
    3 Error: error conditions
    4 Warning: warning conditions
    5 Notice: normal but significant condition
    6 Informational: informational messages
    7 Debug: debug-level messages
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      ALERT
      Action must be taken immediately.
      CRITICAL
      Critical conditions.
      DEBUG
      Debug level messages.
      EMERG
      System is unusable.
      ERROR
      Error conditions.
      INFO
      Informational messages.
      NOTICE
      Normal but significant conditions.
      WARNING
      Warning conditions.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int code  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Severity​(int code)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getCode()
      Returns the severity code.
      static Severity getSeverity​(Level level)
      Returns the Severity for the specified Level.
      boolean isEqual​(java.lang.String name)
      Determine if the name matches this Severity.
      static Severity valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static Severity[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • EMERG

        public static final Severity EMERG
        System is unusable.
      • ALERT

        public static final Severity ALERT
        Action must be taken immediately.
      • CRITICAL

        public static final Severity CRITICAL
        Critical conditions.
      • ERROR

        public static final Severity ERROR
        Error conditions.
      • WARNING

        public static final Severity WARNING
        Warning conditions.
      • NOTICE

        public static final Severity NOTICE
        Normal but significant conditions.
      • INFO

        public static final Severity INFO
        Informational messages.
      • DEBUG

        public static final Severity DEBUG
        Debug level messages.
    • Field Detail

      • code

        private final int code
    • Constructor Detail

      • Severity

        private Severity​(int code)
    • Method Detail

      • values

        public static Severity[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Severity c : Severity.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Severity valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getCode

        public int getCode()
        Returns the severity code.
        Returns:
        The numeric value associated with the Severity.
      • isEqual

        public boolean isEqual​(java.lang.String name)
        Determine if the name matches this Severity.
        Parameters:
        name - the name to match.
        Returns:
        true if the name matches, false otherwise.
      • getSeverity

        public static Severity getSeverity​(Level level)
        Returns the Severity for the specified Level.
        Parameters:
        level - The Level.
        Returns:
        The matching Severity, or DEBUG if there is no match.