org.apache.log4j

Class Priority

public class Priority extends Object

Refrain from using this class directly, use the Level class instead.

Author: Ceki Gülcü

Field Summary
static intALL_INT
static PriorityDEBUG
static intDEBUG_INT
static PriorityERROR
static intERROR_INT
static PriorityFATAL
static intFATAL_INT
static PriorityINFO
static intINFO_INT
static intOFF_INT
static PriorityWARN
static intWARN_INT
Constructor Summary
protected Priority()
Default constructor for deserialization.
protected Priority(int level, String levelStr, int syslogEquivalent)
Instantiate a level object.
Method Summary
booleanequals(Object o)
Two priorities are equal if their level fields are equal.
static Priority[]getAllPossiblePriorities()
Return all possible priorities as an array of Level objects in descending order.
intgetSyslogEquivalent()
Return the syslog equivalent of this priority as an integer.
booleanisGreaterOrEqual(Priority r)
Returns true if this level has a higher or equal level than the level passed as argument, false otherwise.
inttoInt()
Returns the integer representation of this level.
static PrioritytoPriority(String sArg)
static PrioritytoPriority(int val)
static PrioritytoPriority(int val, Priority defaultPriority)
static PrioritytoPriority(String sArg, Priority defaultPriority)
StringtoString()
Returns the string representation of this priority.

Field Detail

ALL_INT

public static final int ALL_INT

DEBUG

public static final Priority DEBUG

Deprecated: Use DEBUG instead.

DEBUG_INT

public static final int DEBUG_INT

ERROR

public static final Priority ERROR

Deprecated: Use ERROR instead.

ERROR_INT

public static final int ERROR_INT

FATAL

public static final Priority FATAL

Deprecated: Use FATAL instead.

FATAL_INT

public static final int FATAL_INT

INFO

public static final Priority INFO

Deprecated: Use INFO instead.

INFO_INT

public static final int INFO_INT

OFF_INT

public static final int OFF_INT

WARN

public static final Priority WARN

Deprecated: Use WARN instead.

WARN_INT

public static final int WARN_INT

Constructor Detail

Priority

protected Priority()
Default constructor for deserialization.

Priority

protected Priority(int level, String levelStr, int syslogEquivalent)
Instantiate a level object.

Method Detail

equals

public boolean equals(Object o)
Two priorities are equal if their level fields are equal.

Since: 1.2

getAllPossiblePriorities

public static Priority[] getAllPossiblePriorities()

Deprecated: This method will be removed with no replacement.

Return all possible priorities as an array of Level objects in descending order.

getSyslogEquivalent

public final int getSyslogEquivalent()
Return the syslog equivalent of this priority as an integer.

isGreaterOrEqual

public boolean isGreaterOrEqual(Priority r)
Returns true if this level has a higher or equal level than the level passed as argument, false otherwise.

You should think twice before overriding the default implementation of isGreaterOrEqual method.

toInt

public final int toInt()
Returns the integer representation of this level.

toPriority

public static Priority toPriority(String sArg)

Deprecated: Please use the toLevel method instead.

toPriority

public static Priority toPriority(int val)

Deprecated: Please use the Level method instead.

toPriority

public static Priority toPriority(int val, Priority defaultPriority)

Deprecated: Please use the Level method instead.

toPriority

public static Priority toPriority(String sArg, Priority defaultPriority)

Deprecated: Please use the Level method instead.

toString

public final String toString()
Returns the string representation of this priority.
Copyright 2000-2005 Apache Software Foundation.