public static class ReportComparator.Builder extends Object
Modifier and Type | Field and Description |
---|---|
protected List<Class<?>> |
baseTypeOrder |
protected ReportComparator.Strategy |
comparisonStrategy |
protected Map<Class<?>,Comparator<?>> |
perTypeComparators |
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
ReportComparator |
build()
Constructs a new Report comparator instance with the configured behavior.
|
<E extends Element<E>> |
comparingElements(Class<E> elementBaseType,
Comparator<E> comparator)
Sets up the report comparator with a custom comparator for a certain types of report elements.
|
ReportComparator.Builder |
withComparisonStrategy(ReportComparator.Strategy comparisonStrategy) |
ReportComparator.Builder |
withExplicitOrder(Class<?>... elementBaseTypes)
This sets up the comparator to order the reports of 2 different element types according to the position
of the element base types in the provided array.
|
protected final Map<Class<?>,Comparator<?>> perTypeComparators
protected ReportComparator.Strategy comparisonStrategy
public <E extends Element<E>> ReportComparator.Builder comparingElements(Class<E> elementBaseType, Comparator<E> comparator)
E
- the base type of elementselementBaseType
- the base type of an elementcomparator
- the comparator to usepublic ReportComparator.Builder withExplicitOrder(Class<?>... elementBaseTypes)
elementBaseTypes
- the list of element base typespublic ReportComparator.Builder withComparisonStrategy(ReportComparator.Strategy comparisonStrategy)
public ReportComparator build()
Copyright © 2014-2021 Lukas Krejci. All Rights Reserved.