Package de.alpharogroup.comparators
Class ChainableComparator<T>
- java.lang.Object
-
- org.apache.commons.collections4.comparators.ComparatorChain<T>
-
- de.alpharogroup.comparators.ChainableComparator<T>
-
- Type Parameters:
T- the generic type of the object that will be compared
- All Implemented Interfaces:
java.io.Serializable,java.util.Comparator<T>
public class ChainableComparator<T> extends org.apache.commons.collections4.comparators.ComparatorChain<T>The classChainableComparatorextends theComparatorChainand provides factory methods for createChainableComparatorobjects.- See Also:
ComparatorChain, Serialized Form
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> ChainableComparator<T>of()Factory method to create a new chainableComparatorobject.static <T> ChainableComparator<T>of(java.util.Comparator<T> comparator)Factory method to create a new chainableComparatorobject from the givenComparatorobject.static <T> ChainableComparator<T>of(java.util.Comparator<T> comparator, boolean reverse)Factory method to create a new chainableComparatorobject from the givenComparatorobject and the given reverse flag.static <T> ChainableComparator<T>of(java.util.List<java.util.Comparator<T>> list)Factory method to create a new chainableComparatorobject from the givenListofComparatorobjects.static <T> ChainableComparator<T>of(java.util.List<java.util.Comparator<T>> list, java.util.BitSet bits)Factory method to create a new chainableComparatorobject from the givenListofComparatorobjects.-
Methods inherited from class org.apache.commons.collections4.comparators.ComparatorChain
addComparator, addComparator, compare, equals, hashCode, isLocked, setComparator, setComparator, setForwardSort, setReverseSort, size
-
-
-
-
Method Detail
-
of
public static <T> ChainableComparator<T> of()
Factory method to create a new chainableComparatorobject.- Type Parameters:
T- the generic type of theComparatorobject that will be compared- Returns:
- the new chainable
Comparatorobject - See Also:
ComparatorChain
-
of
public static <T> ChainableComparator<T> of(java.util.Comparator<T> comparator)
Factory method to create a new chainableComparatorobject from the givenComparatorobject.- Type Parameters:
T- the generic type of theComparatorobject that will be compared- Parameters:
comparator- theComparatorobject that will be in the chain- Returns:
- the new chainable
Comparatorobject - See Also:
ComparatorChain
-
of
public static <T> ChainableComparator<T> of(java.util.Comparator<T> comparator, boolean reverse)
Factory method to create a new chainableComparatorobject from the givenComparatorobject and the given reverse flag.- Type Parameters:
T- the generic type of theComparatorobject that will be compared- Parameters:
comparator- theComparatorobject that will be in the chainreverse- the reverse flag- Returns:
- the new chainable
Comparatorobject - See Also:
ComparatorChain
-
of
public static <T> ChainableComparator<T> of(java.util.List<java.util.Comparator<T>> list)
Factory method to create a new chainableComparatorobject from the givenListofComparatorobjects.- Type Parameters:
T- the generic type of theComparatorobject that will be compared- Parameters:
list- the list with theComparatorobjects.- Returns:
- the new chainable
Comparatorobject - See Also:
ComparatorChain
-
of
public static <T> ChainableComparator<T> of(java.util.List<java.util.Comparator<T>> list, java.util.BitSet bits)
Factory method to create a new chainableComparatorobject from the givenListofComparatorobjects.- Type Parameters:
T- the generic type of theComparatorobject that will be compared- Parameters:
list- the list with theComparatorobjects.bits- Sort order for each Comparator. Extra bits are ignored, unless extra Comparators are added by another method.- Returns:
- the new chainable
Comparatorobject - See Also:
ComparatorChain
-
-