java.lang.Object
swim.util.Severity
- All Implemented Interfaces:
Comparable<Severity>
Level of importance. Used for log levels and diagnostic classifications.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptionstatic Severityalert()Returns theSeveritywithALERT_LEVELof importance.static SeverityReturns aSeveritywithALERT_LEVELof importance, and the given descriptivelabel.intstatic SeverityReturns aSeveritywith the given importancelevel, and descriptivelabel.static Severitydebug()Returns theSeveritywithDEBUG_LEVELof importance.static SeverityReturns aSeveritywithDEBUG_LEVELof importance, and the given descriptivelabel.booleanstatic Severityerror()Returns theSeveritywithERROR_LEVELof importance.static SeverityReturns aSeveritywithERROR_LEVELof importance, and the given descriptivelabel.static Severityfatal()Returns theSeveritywithFATAL_LEVELof importance.static SeverityReturns aSeveritywithFATAL_LEVELof importance, and the given descriptivelabel.static Severityfrom(int level) Returns theSeveritywith the given importancelevel.inthashCode()static Severityinfo()Returns theSeveritywithINFO_LEVELof importance.static SeverityReturns 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.booleanReturnstrueif thisSeverityhasWARNING_LEVELof importance.label()Returns a descriptive label for thisSeverity.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 SeverityReturns aSeveritywithNOTE_LEVELof importance, and the given descriptivelabel.toString()static Severitytrace()Returns theSeveritywithTRACE_LEVELof importance.static SeverityReturns aSeveritywithTRACE_LEVELof importance, and the given descriptivelabel.static Severitywarning()Returns theSeveritywithWARNING_LEVELof importance.static SeverityReturns aSeveritywithWARNING_LEVELof importance, and the given descriptivelabel.
-
Field Details
-
TRACE_LEVEL
public static final int TRACE_LEVEL- See Also:
-
DEBUG_LEVEL
public static final int DEBUG_LEVEL- See Also:
-
INFO_LEVEL
public static final int INFO_LEVEL- See Also:
-
NOTE_LEVEL
public static final int NOTE_LEVEL- See Also:
-
WARNING_LEVEL
public static final int WARNING_LEVEL- See Also:
-
ERROR_LEVEL
public static final int ERROR_LEVEL- See Also:
-
ALERT_LEVEL
public static final int ALERT_LEVEL- See Also:
-
FATAL_LEVEL
public static final int FATAL_LEVEL- See Also:
-
-
Method Details
-
level
public 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.
-
label
Returns a descriptive label for thisSeverity. -
label
Returns a newSeveritywith the same level as thisSeverity, but with a new descriptivelabel. -
isTrace
public boolean isTrace()Returnstrueif thisSeverityhasTRACE_LEVELof importance. -
isDebug
public boolean isDebug()Returnstrueif thisSeverityhasDEBUG_LEVELof importance. -
isInfo
public boolean isInfo()Returnstrueif thisSeverityhasINFO_LEVELof importance. -
isNote
public boolean isNote()Returnstrueif thisSeverityhasNOTE_LEVELof importance. -
isWarning
public boolean isWarning()Returnstrueif thisSeverityhasWARNING_LEVELof importance. -
isError
public boolean isError()Returnstrueif thisSeverityhasERROR_LEVELof importance. -
isAlert
public boolean isAlert()Returnstrueif thisSeverityhasALERT_LEVELof importance. -
isFatal
public boolean isFatal()Returnstrueif thisSeverityhasFATAL_LEVELof importance. -
compareTo
- Specified by:
compareToin interfaceComparable<Severity>
-
equals
-
hashCode
public int hashCode() -
toString
-
create
Returns aSeveritywith the given importancelevel, and descriptivelabel.- Throws:
IllegalArgumentException- iflevelis not a valid level of importance.
-
from
Returns theSeveritywith the given importancelevel.- Throws:
IllegalArgumentException- iflevelis not a valid level of importance.
-
trace
Returns theSeveritywithTRACE_LEVELof importance. -
trace
Returns aSeveritywithTRACE_LEVELof importance, and the given descriptivelabel. -
debug
Returns theSeveritywithDEBUG_LEVELof importance. -
debug
Returns aSeveritywithDEBUG_LEVELof importance, and the given descriptivelabel. -
info
Returns theSeveritywithINFO_LEVELof importance. -
info
Returns aSeveritywithINFO_LEVELof importance, and the given descriptivelabel. -
note
Returns theSeveritywithNOTE_LEVELof importance. -
note
Returns aSeveritywithNOTE_LEVELof importance, and the given descriptivelabel. -
warning
Returns theSeveritywithWARNING_LEVELof importance. -
warning
Returns aSeveritywithWARNING_LEVELof importance, and the given descriptivelabel. -
error
Returns theSeveritywithERROR_LEVELof importance. -
error
Returns aSeveritywithERROR_LEVELof importance, and the given descriptivelabel. -
alert
Returns theSeveritywithALERT_LEVELof importance. -
alert
Returns aSeveritywithALERT_LEVELof importance, and the given descriptivelabel. -
fatal
Returns theSeveritywithFATAL_LEVELof importance. -
fatal
Returns aSeveritywithFATAL_LEVELof importance, and the given descriptivelabel.
-