T - public class ComparatorBuilder<T> extends Object implements Comparator<T>
A ComparatorBuilder allows the creation of a comparator for a given java bean type based on the values of the properties within the bean.
In the resulting comparator, properties are compared using the specified rules in the order they are supplied to the builder. Evaluation continues until a non-zero value occurs on a property, or all properties have been compared.
Expressive.Comparators#compare(Class)| Modifier and Type | Class and Description |
|---|---|
class |
ComparatorBuilder.CompareUsing<S> |
| Modifier and Type | Field and Description |
|---|---|
protected LinkedHashMap<String,Comparator<?>> |
propertyComparators |
| Constructor and Description |
|---|
ComparatorBuilder(Class<T> type) |
ComparatorBuilder(Class<T> type,
boolean noCache) |
| Modifier and Type | Method and Description |
|---|---|
int |
compare(T o1,
T o2) |
<S> ComparatorBuilder.CompareUsing<S> |
on(String property) |
protected void |
put(String property,
Comparator<?> comparator) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitequalsprotected LinkedHashMap<String,Comparator<?>> propertyComparators
protected void put(String property, Comparator<?> comparator)
public <S> ComparatorBuilder.CompareUsing<S> on(String property)
public int compare(T o1, T o2)
compare in interface Comparator<T>Copyright © 2013 Atomic Leopard. All Rights Reserved.