public class SeverityComparator
extends java.lang.Object
implements java.util.Comparator<java.util.logging.LogRecord>, java.io.Serializable
The following LogRecord properties determine severity ordering:
Throwable
defined as
"normal occurrence
".
java.lang.Throwable
class and is not a
java.lang.RuntimeException
or a java.lang.Error
.
java.lang.RuntimeException
objects.
java.lang.Error
objects.
Constructor and Description |
---|
SeverityComparator() |
Modifier and Type | Method and Description |
---|---|
java.lang.Throwable |
apply(java.lang.Throwable chain)
Identifies a single throwable that best describes the given throwable and
the entire cause chain.
|
int |
applyThenCompare(java.lang.Throwable tc1,
java.lang.Throwable tc2)
Reduces each throwable chain argument
then compare each throwable result. |
int |
compare(java.util.logging.LogRecord o1,
java.util.logging.LogRecord o2)
Compares two log records based on severity.
|
int |
compareThrowable(java.lang.Throwable t1,
java.lang.Throwable t2)
Compares two throwable objects or null.
|
boolean |
equals(java.lang.Object o)
Determines if the given object is also a comparator and it imposes the
same ordering as this comparator.
|
int |
hashCode()
Returns a hash code value for the object.
|
boolean |
isNormal(java.lang.Throwable t)
Determines if the given throwable instance is "normal occurrence".
|
public java.lang.Throwable apply(java.lang.Throwable chain)
compare(java.util.logging.LogRecord, java.util.logging.LogRecord)
.chain
- the throwable or null.isNormal(java.lang.Throwable)
public final int applyThenCompare(java.lang.Throwable tc1, java.lang.Throwable tc2)
Reduces
each throwable chain argument
then compare each throwable result.tc1
- the first throwable chain or null.tc2
- the second throwable chain or null.apply(java.lang.Throwable)
,
compareThrowable(java.lang.Throwable, java.lang.Throwable)
public int compareThrowable(java.lang.Throwable t1, java.lang.Throwable t2)
reduce
each argument before
comparing. This is method can be overridden to change the behavior of
compare(LogRecord, LogRecord).t1
- the first throwable or null.t2
- the second throwable or null.isNormal(java.lang.Throwable)
public int compare(java.util.logging.LogRecord o1, java.util.logging.LogRecord o2)
compare
in interface java.util.Comparator<java.util.logging.LogRecord>
o1
- the first log record.o2
- the second log record.java.lang.NullPointerException
- if either argument is null.public boolean equals(java.lang.Object o)
equals
in interface java.util.Comparator<java.util.logging.LogRecord>
equals
in class java.lang.Object
o
- the reference object with which to compare.public int hashCode()
hashCode
in class java.lang.Object
public boolean isNormal(java.lang.Throwable t)
java.lang.ThreadDeath
object or
subclasses.
This method can be overridden to change the behavior of the
apply(java.lang.Throwable) method.t
- a throwable or null.Copyright © 2010 - 2020 Adobe. All Rights Reserved