X
- the type of the input and assembled (output) exceptions.@NotThreadSafe public class PriorityExceptionBuilder<X extends Throwable> extends AbstractExceptionBuilder<X,X>
Exception
from one or more input exceptions by
suppressing all but the
first input exception with the highest priority.
The priority of the exceptions is determined by the Comparator
provided to the constructor.Constructor and Description |
---|
PriorityExceptionBuilder(Comparator<? super X> comparator)
Constructs a new priority exception builder.
|
Modifier and Type | Method and Description |
---|---|
protected X |
post(X selection)
This function gets called to post-process the given result of the
assembly after it has been checked out.
|
protected X |
update(X input,
X assembly)
This function gets called to update the given
previous result of
the assembly with the given input exception. |
check, fail, warn
public PriorityExceptionBuilder(Comparator<? super X> comparator)
comparator.compare(input, assembly)
where input
is the input exception to add and assembly
is the current
assembly.comparator
- the comparator used for prioritizing the exceptions in
the assembly.protected final X post(X selection)
AbstractExceptionBuilder
The implementation in the class AbstractExceptionBuilder
simply
returns assembly
.
protected final X update(X input, @CheckForNull X assembly)
AbstractExceptionBuilder
previous
result of
the assembly with the given input exception.update
in class AbstractExceptionBuilder<X extends Throwable,X extends Throwable>
input
- the input exception to handle.assembly
- the current assembled (output) exception or null
if this is the first call to this method or the last assembly
has already been checked out.null
.Copyright © 2012–2016 Schlichtherle IT Services. All rights reserved.