- java.lang.Object
- 
- swim.util.Severity
 
- 
- All Implemented Interfaces:
- Comparable<Severity>
 
 public final class Severity extends Object implements Comparable<Severity> Level of importance. Used for log levels and diagnostic classifications.
- 
- 
Field SummaryFields Modifier and Type Field Description static intALERT_LEVELstatic intDEBUG_LEVELstatic intERROR_LEVELstatic intFATAL_LEVELstatic intINFO_LEVELstatic intNOTE_LEVELstatic intTRACE_LEVELstatic intWARNING_LEVEL
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Severityalert()Returns theSeveritywithALERT_LEVELof importance.static Severityalert(String label)Returns aSeveritywithALERT_LEVELof importance, and the given descriptivelabel.intcompareTo(Severity that)static Severitycreate(int level, String label)Returns aSeveritywith the given importancelevel, and descriptivelabel.static Severitydebug()Returns theSeveritywithDEBUG_LEVELof importance.static Severitydebug(String label)Returns aSeveritywithDEBUG_LEVELof importance, and the given descriptivelabel.booleanequals(Object other)static Severityerror()Returns theSeveritywithERROR_LEVELof importance.static Severityerror(String label)Returns aSeveritywithERROR_LEVELof importance, and the given descriptivelabel.static Severityfatal()Returns theSeveritywithFATAL_LEVELof importance.static Severityfatal(String label)Returns aSeveritywithFATAL_LEVELof importance, and the given descriptivelabel.static Severityfrom(int level)Returns theSeveritywith the given importancelevel.inthashCode()static Severityinfo()Returns theSeveritywithINFO_LEVELof importance.static Severityinfo(String label)Returns aSeveritywithINFO_LEVELof importance, and the given descriptivelabel.booleanisAlert()Returnstrueif thisSeverityhasALERT_LEVELof importance.booleanisDebug()Returnstrueif thisSeverityhasDEBUG_LEVELof importance.booleanisError()Returnstrueif thisSeverityhasERROR_LEVELof importance.booleanisFatal()Returnstrueif thisSeverityhasFATAL_LEVELof importance.booleanisInfo()Returnstrueif thisSeverityhasINFO_LEVELof importance.booleanisNote()Returnstrueif thisSeverityhasNOTE_LEVELof importance.booleanisTrace()Returnstrueif thisSeverityhasTRACE_LEVELof importance.booleanisWarning()Returnstrueif thisSeverityhasWARNING_LEVELof importance.Stringlabel()Returns a descriptive label for thisSeverity.Severitylabel(String label)Returns a newSeveritywith the same level as thisSeverity, but with a new descriptivelabel.intlevel()Returns the integer level of importance of thisSeverity, with higher levels signifying greater importance.static Severitynote()Returns theSeveritywithNOTE_LEVELof importance.static Severitynote(String label)Returns aSeveritywithNOTE_LEVELof importance, and the given descriptivelabel.StringtoString()static Severitytrace()Returns theSeveritywithTRACE_LEVELof importance.static Severitytrace(String label)Returns aSeveritywithTRACE_LEVELof importance, and the given descriptivelabel.static Severitywarning()Returns theSeveritywithWARNING_LEVELof importance.static Severitywarning(String label)Returns aSeveritywithWARNING_LEVELof importance, and the given descriptivelabel.
 
- 
- 
- 
Field Detail- 
TRACE_LEVELpublic static final int TRACE_LEVEL - See Also:
- Constant Field Values
 
 - 
DEBUG_LEVELpublic static final int DEBUG_LEVEL - See Also:
- Constant Field Values
 
 - 
INFO_LEVELpublic static final int INFO_LEVEL - See Also:
- Constant Field Values
 
 - 
NOTE_LEVELpublic static final int NOTE_LEVEL - See Also:
- Constant Field Values
 
 - 
WARNING_LEVELpublic static final int WARNING_LEVEL - See Also:
- Constant Field Values
 
 - 
ERROR_LEVELpublic static final int ERROR_LEVEL - See Also:
- Constant Field Values
 
 - 
ALERT_LEVELpublic static final int ALERT_LEVEL - See Also:
- Constant Field Values
 
 - 
FATAL_LEVELpublic static final int FATAL_LEVEL - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
levelpublic int level() Returns the integer level of importance of thisSeverity, with higher levels signifying greater importance.- Returns:
- an integer between 0and7, inclusive. One ofTRACE_LEVEL,DEBUG_LEVEL,INFO_LEVEL,NOTE_LEVEL,WARNING_LEVEL,ERROR_LEVEL,ALERT_LEVEL, orFATAL_LEVEL.
 
 - 
labelpublic String label() Returns a descriptive label for thisSeverity.
 - 
labelpublic Severity label(String label) Returns a newSeveritywith the same level as thisSeverity, but with a new descriptivelabel.
 - 
isTracepublic boolean isTrace() Returnstrueif thisSeverityhasTRACE_LEVELof importance.
 - 
isDebugpublic boolean isDebug() Returnstrueif thisSeverityhasDEBUG_LEVELof importance.
 - 
isInfopublic boolean isInfo() Returnstrueif thisSeverityhasINFO_LEVELof importance.
 - 
isNotepublic boolean isNote() Returnstrueif thisSeverityhasNOTE_LEVELof importance.
 - 
isWarningpublic boolean isWarning() Returnstrueif thisSeverityhasWARNING_LEVELof importance.
 - 
isErrorpublic boolean isError() Returnstrueif thisSeverityhasERROR_LEVELof importance.
 - 
isAlertpublic boolean isAlert() Returnstrueif thisSeverityhasALERT_LEVELof importance.
 - 
isFatalpublic boolean isFatal() Returnstrueif thisSeverityhasFATAL_LEVELof importance.
 - 
compareTopublic int compareTo(Severity that) - Specified by:
- compareToin interface- Comparable<Severity>
 
 - 
createpublic static Severity create(int level, String label) Returns aSeveritywith the given importancelevel, and descriptivelabel.- Throws:
- IllegalArgumentException- if- levelis not a valid level of importance.
 
 - 
frompublic static Severity from(int level) Returns theSeveritywith the given importancelevel.- Throws:
- IllegalArgumentException- if- levelis not a valid level of importance.
 
 - 
tracepublic static Severity trace() Returns theSeveritywithTRACE_LEVELof importance.
 - 
tracepublic static Severity trace(String label) Returns aSeveritywithTRACE_LEVELof importance, and the given descriptivelabel.
 - 
debugpublic static Severity debug() Returns theSeveritywithDEBUG_LEVELof importance.
 - 
debugpublic static Severity debug(String label) Returns aSeveritywithDEBUG_LEVELof importance, and the given descriptivelabel.
 - 
infopublic static Severity info() Returns theSeveritywithINFO_LEVELof importance.
 - 
infopublic static Severity info(String label) Returns aSeveritywithINFO_LEVELof importance, and the given descriptivelabel.
 - 
notepublic static Severity note() Returns theSeveritywithNOTE_LEVELof importance.
 - 
notepublic static Severity note(String label) Returns aSeveritywithNOTE_LEVELof importance, and the given descriptivelabel.
 - 
warningpublic static Severity warning() Returns theSeveritywithWARNING_LEVELof importance.
 - 
warningpublic static Severity warning(String label) Returns aSeveritywithWARNING_LEVELof importance, and the given descriptivelabel.
 - 
errorpublic static Severity error() Returns theSeveritywithERROR_LEVELof importance.
 - 
errorpublic static Severity error(String label) Returns aSeveritywithERROR_LEVELof importance, and the given descriptivelabel.
 - 
alertpublic static Severity alert() Returns theSeveritywithALERT_LEVELof importance.
 - 
alertpublic static Severity alert(String label) Returns aSeveritywithALERT_LEVELof importance, and the given descriptivelabel.
 - 
fatalpublic static Severity fatal() Returns theSeveritywithFATAL_LEVELof importance.
 
- 
 
-