FileDocCategorySizeDatePackage
Priority.javaAPI DocApache log4j 1.2.154900Sat Aug 25 00:09:42 BST 2007org.apache.log4j

Priority

public class Priority extends Object
Refrain from using this class directly, use the {@link Level} class instead.
author
Ceki Gülcü

Fields Summary
transient int
level
transient String
levelStr
transient int
syslogEquivalent
public static final int
OFF_INT
public static final int
FATAL_INT
public static final int
ERROR_INT
public static final int
WARN_INT
public static final int
INFO_INT
public static final int
DEBUG_INT
public static final int
ALL_INT
public static final Priority
FATAL
public static final Priority
ERROR
public static final Priority
WARN
public static final Priority
INFO
public static final Priority
DEBUG
Constructors Summary
protected Priority()
Default constructor for deserialization.



          
    
      level = DEBUG_INT;
      levelStr = "DEBUG";
      syslogEquivalent = 7;
  
protected Priority(int level, String levelStr, int syslogEquivalent)
Instantiate a level object.

    this.level = level;
    this.levelStr = levelStr;
    this.syslogEquivalent = syslogEquivalent;
  
Methods Summary
public booleanequals(java.lang.Object o)
Two priorities are equal if their level fields are equal.

since
1.2

    if(o instanceof Priority) {
      Priority r = (Priority) o;
      return (this.level == r.level);
    } else {
      return false;
    }
  
public static org.apache.log4j.Priority[]getAllPossiblePriorities()
Return all possible priorities as an array of Level objects in descending order.

deprecated
This method will be removed with no replacement.

    return new Priority[] {Priority.FATAL, Priority.ERROR, Level.WARN, 
			   Priority.INFO, Priority.DEBUG};
  
public final intgetSyslogEquivalent()
Return the syslog equivalent of this priority as an integer.

    return syslogEquivalent;
  
public booleanisGreaterOrEqual(org.apache.log4j.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.

    return level >= r.level;
  
public final inttoInt()
Returns the integer representation of this level.

    return level;
  
public static org.apache.log4j.PrioritytoPriority(int val)

deprecated
Please use the {@link Level#toLevel(int)} method instead.

    return toPriority(val, Priority.DEBUG);
  
public static org.apache.log4j.PrioritytoPriority(int val, org.apache.log4j.Priority defaultPriority)

deprecated
Please use the {@link Level#toLevel(int, Level)} method instead.

    return Level.toLevel(val, (Level) defaultPriority);
  
public static org.apache.log4j.PrioritytoPriority(java.lang.String sArg, org.apache.log4j.Priority defaultPriority)

deprecated
Please use the {@link Level#toLevel(String, Level)} method instead.

                  
    return Level.toLevel(sArg, (Level) defaultPriority);
  
public static org.apache.log4j.PrioritytoPriority(java.lang.String sArg)

deprecated
Please use the {@link Level#toLevel(String)} method instead.

    return Level.toLevel(sArg);
  
public final java.lang.StringtoString()
Returns the string representation of this priority.

    return levelStr;