public class SeverityComparator extends Object implements Comparator<LogRecord>, 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 |
---|---|
Throwable |
apply(Throwable chain)
Identifies a single throwable that best describes the given throwable and
the entire cause chain.
|
int |
applyThenCompare(Throwable tc1,
Throwable tc2)
Reduces each throwable chain argument
then compare each throwable result. |
int |
compare(LogRecord o1,
LogRecord o2)
Compares two log records based on severity.
|
int |
compareThrowable(Throwable t1,
Throwable t2)
Compares two throwable objects or null.
|
boolean |
equals(Object o) |
int |
hashCode() |
boolean |
isNormal(Throwable t)
Determines if the given throwable instance is "normal occurrence".
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public Throwable apply(Throwable chain)
compare(java.util.logging.LogRecord, java.util.logging.LogRecord)
.chain
- the throwable or null.isNormal(java.lang.Throwable)
public final int applyThenCompare(Throwable tc1, Throwable tc2)
Reduces
each throwable chain argument
then compare each throwable result. This is method can be overridden to
change the behavior of compare(LogRecord, LogRecord).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(Throwable t1, Throwable t2)
reduce
each argument before
comparing.t1
- the first throwable or null.t2
- the second throwable or null.isNormal(java.lang.Throwable)
public int compare(LogRecord o1, LogRecord o2)
compare
in interface Comparator<LogRecord>
o1
- the first log record.o2
- the second log record.NullPointerException
- if either argument is null.public boolean equals(Object o)
equals
in interface Comparator<LogRecord>
equals
in class Object
public boolean isNormal(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 © 2016 Oracle. All rights reserved.