Class Priority

java.lang.Object
org.apache.log4j.Priority
Direct Known Subclasses:
Level

public class Priority extends Object
Refrain from using this class directly, use the Level class instead.
Author:
Ceki Gülcü
  • Field Details

  • Constructor Details

    • Priority

      protected Priority()
      Default constructor for deserialization.
    • Priority

      protected Priority(int level, String levelStr, int syslogEquivalent)
      Instantiate a level object.
      Parameters:
      level - a level as in int
      levelStr - a levelStr
      syslogEquivalent - the syslog equivalent level integer
  • Method Details

    • equals

      public boolean equals(Object o)
      Two priorities are equal if their level fields are equal.
      Overrides:
      equals in class Object
      Since:
      1.2
    • getSyslogEquivalent

      public final int getSyslogEquivalent()
      Return the syslog equivalent of this priority as an integer.
      Returns:
      the Syslog Equivalent of this Priority
    • 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.

      Parameters:
      r - a priority
      Returns:
      a boolean
    • getAllPossiblePriorities

      @Deprecated 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.
      Returns:
      array of all possible priorities
    • toString

      public final String toString()
      Returns the string representation of this priority.
      Overrides:
      toString in class Object
    • toInt

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

      @Deprecated public static Priority toPriority(String sArg)
      Deprecated.
      Please use the Level.toLevel(String) method instead.
      Parameters:
      sArg - a string to convert to a Priority
      Returns:
      the corresponding Priority
    • toPriority

      @Deprecated public static Priority toPriority(int val)
      Deprecated.
      Please use the Level.toLevel(int) method instead.
      Parameters:
      val - an integer to convert to a Priority
      Returns:
      the corresponding Priority
    • toPriority

      @Deprecated public static Priority toPriority(int val, Priority defaultPriority)
      Deprecated.
      Please use the Level.toLevel(int, Level) method instead.
      Parameters:
      val - an integer value
      defaultPriority - a default priority value
      Returns:
      correspoding Priority value
    • toPriority

      @Deprecated public static Priority toPriority(String sArg, Priority defaultPriority)
      Deprecated.
      Please use the Level.toLevel(String, Level) method instead.
      Parameters:
      sArg - string value
      defaultPriority - a default Priority
      Returns:
      a Priority