public final class TraceLevel extends Object implements Serializable
A singleton instance of each enumerated value is guaranteed (via an implementation
of readResolve()
- refer java.io.Serializable
),
so that equality tests using ==
are always evaluated correctly. (This
equality test is only guaranteed if this class is loaded in the application's boot class
path, rather than dynamically loaded at runtime.)
The trace levels in descending order are:
The trace level OFF is also defined for the purposes of disabling trace message generation at the management level.
Modifier and Type | Field and Description |
---|---|
static TraceLevel |
CONFIG
Trace level for messages relating to configuration.
|
static String |
CONFIG_STRING
A string representation of
CONFIG . |
static TraceLevel |
FINE
Trace level for general coarse-grained debugging messages.
|
static String |
FINE_STRING
A string representation of
FINE . |
static TraceLevel |
FINER
Trace level for debug messages containing moderate detail.
|
static String |
FINER_STRING
A string representation of
FINER . |
static TraceLevel |
FINEST
Trace level for highly detailed or fine-grained messages.
|
static String |
FINEST_STRING
A string representation of
FINEST . |
static TraceLevel |
INFO
Trace level for general information messages.
|
static String |
INFO_STRING
A string representation of
INFO . |
static int |
LEVEL_CONFIG
An integer representation of
CONFIG . |
static int |
LEVEL_FINE
An integer representation of
FINE . |
static int |
LEVEL_FINER
An integer representation of
FINER . |
static int |
LEVEL_FINEST
An integer representation of
FINEST . |
static int |
LEVEL_INFO
An integer representation of
INFO . |
static int |
LEVEL_OFF
An integer representation of
OFF . |
static int |
LEVEL_SEVERE
An integer representation of
SEVERE . |
static int |
LEVEL_WARNING
An integer representation of
WARNING . |
static TraceLevel |
OFF
Trace level for maximum filtering.
|
static String |
OFF_STRING
A string representation of
OFF . |
static TraceLevel |
SEVERE
Trace level for messages that indicate a severe error has occurred.
|
static String |
SEVERE_STRING
A string representation of
SEVERE . |
static TraceLevel |
WARNING
Trace level for messages that indicate warnings.
|
static String |
WARNING_STRING
A string representation of
WARNING . |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Compare this trace level for equality with another.
|
static TraceLevel |
fromInt(int level)
Get a
TraceLevel object from an integer value. |
static TraceLevel |
fromString(String level)
Get a
TraceLevel object from a string value. |
int |
hashCode()
Get a hash code value for this trace level.
|
boolean |
isConfig()
Determine if this TraceLevel object represents the CONFIG level.
|
boolean |
isFine()
Determine if this TraceLevel object represents the FINE level.
|
boolean |
isFiner()
Determine if this TraceLevel object represents the FINER level.
|
boolean |
isFinest()
Determine if this TraceLevel object represents the FINEST level.
|
boolean |
isHigherLevel(TraceLevel other)
Determine if this TraceLevel object represents a level that is higher than some other
TraceLevel object.
|
boolean |
isInfo()
Determine if this TraceLevel object represents the INFO level.
|
boolean |
isOff()
Determine if this TraceLevel object represents the OFF level.
|
boolean |
isSevere()
Determine if this TraceLevel object represents the SEVERE level.
|
boolean |
isWarning()
Determine if this TraceLevel object represents the WARNING level.
|
int |
toInt()
Get an integer value representation for this
TraceLevel object. |
String |
toString()
Get the textual representation of the TraceLevel object.
|
public static final int LEVEL_OFF
OFF
.public static final int LEVEL_SEVERE
SEVERE
.public static final int LEVEL_WARNING
WARNING
.public static final int LEVEL_INFO
INFO
.public static final int LEVEL_CONFIG
CONFIG
.public static final int LEVEL_FINE
FINE
.public static final int LEVEL_FINER
FINER
.public static final int LEVEL_FINEST
FINEST
.public static final String OFF_STRING
OFF
.public static final String SEVERE_STRING
SEVERE
.public static final String WARNING_STRING
WARNING
.public static final String INFO_STRING
INFO
.public static final String CONFIG_STRING
CONFIG
.public static final String FINE_STRING
FINE
.public static final String FINER_STRING
FINER
.public static final String FINEST_STRING
FINEST
.public static final TraceLevel OFF
public static final TraceLevel SEVERE
public static final TraceLevel WARNING
public static final TraceLevel INFO
public static final TraceLevel CONFIG
public static final TraceLevel FINE
public static final TraceLevel FINER
public static final TraceLevel FINEST
public static TraceLevel fromInt(int level) throws IllegalArgumentException
TraceLevel
object from an integer value.level
- the level as an integer.TraceLevel
object corresponding to level
.IllegalArgumentException
- if level
is not a valid trace
level value.public static TraceLevel fromString(String level) throws NullPointerException, IllegalArgumentException
TraceLevel
object from a string value.level
- the level as a string, for example as returned by the toString()
method (case insensitive).TraceLevel
object corresponding to level
.NullPointerException
- if level
is null
.IllegalArgumentException
- if level
is not a valid trace
level string.public int toInt()
TraceLevel
object.TraceLevel
object.public boolean isOff()
This method is effectively equivalent to the conditional test:
(this == OFF)
, ie. the code:
if (traceLevel.isOff()) ...
is interchangeable with the code:
if (traceLevel == TraceLevel.OFF) ...
true
if this object represents the OFF level,
false
otherwise.public boolean isSevere()
This method is effectively equivalent to the conditional test:
(this == SEVERE)
, ie. the code:
if (traceLevel.isSevere()) ...
is interchangeable with the code:
if (traceLevel == TraceLevel.SEVERE) ...
true
if this object represents the SEVERE level,
false
otherwise.public boolean isWarning()
This method is effectively equivalent to the conditional test:
(this == WARNING)
, ie. the code:
if (traceLevel.isWarning()) ...
is interchangeable with the code:
if (traceLevel == TraceLevel.WARNING) ...
true
if this object represents the WARNING level,
false
otherwise.public boolean isInfo()
This method is effectively equivalent to the conditional test:
(this == INFO)
, ie. the code:
if (traceLevel.isMinor()) ...
is interchangeable with the code:
if (traceLevel == TraceLevel.INFO) ...
true
if this object represents the INFO level,
false
otherwise.public boolean isConfig()
This method is effectively equivalent to the conditional test:
(this == CONFIG)
, ie. the code:
if (traceLevel.isConfig()) ...
is interchangeable with the code:
if (traceLevel == TraceLevel.CONFIG) ...
true
if this object represents the CONFIG level,
false
otherwise.public boolean isFine()
This method is effectively equivalent to the conditional test:
(this == FINE)
, ie. the code:
if (traceLevel.isFine()) ...
is interchangeable with the code:
if (traceLevel == TraceLevel.FINE) ...
true
if this object represents the FINE level,
false
otherwise.public boolean isFiner()
This method is effectively equivalent to the conditional test:
(this == FINER)
, ie. the code:
if (traceLevel.isFiner()) ...
is interchangeable with the code:
if (traceLevel == TraceLevel.FINER) ...
true
if this object represents the FINER level,
false
otherwise.public boolean isFinest()
This method is effectively equivalent to the conditional test:
(this == FINEST)
, ie. the code:
if (traceLevel.isFinest()) ...
is interchangeable with the code:
if (traceLevel == TraceLevel.FINEST) ...
true
if this object represents the FINEST level,
false
otherwise.public boolean isHigherLevel(TraceLevel other) throws NullPointerException
other
- the TraceLevel
object to compare this with.true
if the level represented by this TraceLevel
object is a higher level than the level represented by the specified
TraceLevel
object, false
otherwise.NullPointerException
- if other
is null
.public boolean equals(Object obj)
public int hashCode()