public final class Level
extends java.lang.Object
This class is immutable and thus suitable for concurrent use without external synchronization.
This class was designed as a class, rather than an enumeration, so that you can define your own logging levels.
Modifier and Type | Field and Description |
---|---|
static Level |
DEBUG
A
Level used for debugging purposes. |
static Level |
ERROR
A
Level used for arbitrary errors. |
static Level |
FATAL
A
Level used for fatal errors. |
static Level |
INFO
A
Level used for arbitrary information. |
static Level |
WARNING
A
Level used for warnings. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object object)
Returns
true if, and only if, object is an instance of Level , and that Level instance is equal to this Level instance, false otherwise. |
java.lang.String |
getName()
Returns the name assigned to this
Level instance. |
int |
hashCode()
Returns a hash-code for this
Level instance. |
java.lang.String |
toString()
Returns a
String representation of this Level instance. |
static Level |
valueOf(java.lang.String name)
Returns a
Level instance given its name. |
public static final Level DEBUG
Level
used for debugging purposes.public static final Level ERROR
Level
used for arbitrary errors.public static final Level FATAL
Level
used for fatal errors.public static final Level INFO
Level
used for arbitrary information.public static final Level WARNING
Level
used for warnings.public boolean equals(java.lang.Object object)
true
if, and only if, object
is an instance of Level
, and that Level
instance is equal to this Level
instance, false
otherwise.equals
in class java.lang.Object
object
- an Object
to compare to this Level
instance for equalitytrue
if, and only if, object
is an instance of Level
, and that Level
instance is equal to this Level
instance, false
otherwisepublic int hashCode()
Level
instance.hashCode
in class java.lang.Object
Level
instancepublic java.lang.String getName()
Level
instance.Level
instancepublic java.lang.String toString()
String
representation of this Level
instance.toString
in class java.lang.Object
String
representation of this Level
instancepublic static Level valueOf(java.lang.String name)
Level
instance given its name.
If name
is null
, a NullPointerException
will be thrown.
name
- the name of the Level
Level
instance given its namejava.lang.NullPointerException
- thrown if, and only if, name
is null