Module swim.util
Package swim.util

Class Severity

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static Severity alert()
      Returns the Severity with ALERT_LEVEL of importance.
      static Severity alert​(String label)
      Returns a Severity with ALERT_LEVEL of importance, and the given descriptive label.
      int compareTo​(Severity that)  
      static Severity create​(int level, String label)
      Returns a Severity with the given importance level, and descriptive label.
      static Severity debug()
      Returns the Severity with DEBUG_LEVEL of importance.
      static Severity debug​(String label)
      Returns a Severity with DEBUG_LEVEL of importance, and the given descriptive label.
      boolean equals​(Object other)  
      static Severity error()
      Returns the Severity with ERROR_LEVEL of importance.
      static Severity error​(String label)
      Returns a Severity with ERROR_LEVEL of importance, and the given descriptive label.
      static Severity fatal()
      Returns the Severity with FATAL_LEVEL of importance.
      static Severity fatal​(String label)
      Returns a Severity with FATAL_LEVEL of importance, and the given descriptive label.
      static Severity from​(int level)
      Returns the Severity with the given importance level.
      int hashCode()  
      static Severity info()
      Returns the Severity with INFO_LEVEL of importance.
      static Severity info​(String label)
      Returns a Severity with INFO_LEVEL of importance, and the given descriptive label.
      boolean isAlert()
      Returns true if this Severity has ALERT_LEVEL of importance.
      boolean isDebug()
      Returns true if this Severity has DEBUG_LEVEL of importance.
      boolean isError()
      Returns true if this Severity has ERROR_LEVEL of importance.
      boolean isFatal()
      Returns true if this Severity has FATAL_LEVEL of importance.
      boolean isInfo()
      Returns true if this Severity has INFO_LEVEL of importance.
      boolean isNote()
      Returns true if this Severity has NOTE_LEVEL of importance.
      boolean isTrace()
      Returns true if this Severity has TRACE_LEVEL of importance.
      boolean isWarning()
      Returns true if this Severity has WARNING_LEVEL of importance.
      String label()
      Returns a descriptive label for this Severity.
      Severity label​(String label)
      Returns a new Severity with the same level as this Severity, but with a new descriptive label.
      int level()
      Returns the integer level of importance of this Severity, with higher levels signifying greater importance.
      static Severity note()
      Returns the Severity with NOTE_LEVEL of importance.
      static Severity note​(String label)
      Returns a Severity with NOTE_LEVEL of importance, and the given descriptive label.
      String toString()  
      static Severity trace()
      Returns the Severity with TRACE_LEVEL of importance.
      static Severity trace​(String label)
      Returns a Severity with TRACE_LEVEL of importance, and the given descriptive label.
      static Severity warning()
      Returns the Severity with WARNING_LEVEL of importance.
      static Severity warning​(String label)
      Returns a Severity with WARNING_LEVEL of importance, and the given descriptive label.
    • Method Detail

      • level

        public int level()
        Returns the integer level of importance of this Severity, with higher levels signifying greater importance.
        Returns:
        an integer between 0 and 7, inclusive. One of TRACE_LEVEL, DEBUG_LEVEL, INFO_LEVEL, NOTE_LEVEL, WARNING_LEVEL, ERROR_LEVEL, ALERT_LEVEL, or FATAL_LEVEL.
      • label

        public String label()
        Returns a descriptive label for this Severity.
      • label

        public Severity label​(String label)
        Returns a new Severity with the same level as this Severity, but with a new descriptive label.
      • isTrace

        public boolean isTrace()
        Returns true if this Severity has TRACE_LEVEL of importance.
      • isDebug

        public boolean isDebug()
        Returns true if this Severity has DEBUG_LEVEL of importance.
      • isInfo

        public boolean isInfo()
        Returns true if this Severity has INFO_LEVEL of importance.
      • isNote

        public boolean isNote()
        Returns true if this Severity has NOTE_LEVEL of importance.
      • isWarning

        public boolean isWarning()
        Returns true if this Severity has WARNING_LEVEL of importance.
      • isError

        public boolean isError()
        Returns true if this Severity has ERROR_LEVEL of importance.
      • isAlert

        public boolean isAlert()
        Returns true if this Severity has ALERT_LEVEL of importance.
      • isFatal

        public boolean isFatal()
        Returns true if this Severity has FATAL_LEVEL of importance.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • create

        public static Severity create​(int level,
                                      String label)
        Returns a Severity with the given importance level, and descriptive label.
        Throws:
        IllegalArgumentException - if level is not a valid level of importance.
      • from

        public static Severity from​(int level)
        Returns the Severity with the given importance level.
        Throws:
        IllegalArgumentException - if level is not a valid level of importance.
      • trace

        public static Severity trace()
        Returns the Severity with TRACE_LEVEL of importance.
      • trace

        public static Severity trace​(String label)
        Returns a Severity with TRACE_LEVEL of importance, and the given descriptive label.
      • debug

        public static Severity debug()
        Returns the Severity with DEBUG_LEVEL of importance.
      • debug

        public static Severity debug​(String label)
        Returns a Severity with DEBUG_LEVEL of importance, and the given descriptive label.
      • info

        public static Severity info()
        Returns the Severity with INFO_LEVEL of importance.
      • info

        public static Severity info​(String label)
        Returns a Severity with INFO_LEVEL of importance, and the given descriptive label.
      • note

        public static Severity note()
        Returns the Severity with NOTE_LEVEL of importance.
      • note

        public static Severity note​(String label)
        Returns a Severity with NOTE_LEVEL of importance, and the given descriptive label.
      • warning

        public static Severity warning()
        Returns the Severity with WARNING_LEVEL of importance.
      • warning

        public static Severity warning​(String label)
        Returns a Severity with WARNING_LEVEL of importance, and the given descriptive label.
      • error

        public static Severity error()
        Returns the Severity with ERROR_LEVEL of importance.
      • error

        public static Severity error​(String label)
        Returns a Severity with ERROR_LEVEL of importance, and the given descriptive label.
      • alert

        public static Severity alert()
        Returns the Severity with ALERT_LEVEL of importance.
      • alert

        public static Severity alert​(String label)
        Returns a Severity with ALERT_LEVEL of importance, and the given descriptive label.
      • fatal

        public static Severity fatal()
        Returns the Severity with FATAL_LEVEL of importance.
      • fatal

        public static Severity fatal​(String label)
        Returns a Severity with FATAL_LEVEL of importance, and the given descriptive label.