Package com.randomnoun.common
Class Struct.StructuredListComparator
java.lang.Object
com.randomnoun.common.Struct.StructuredListComparator
- All Implemented Interfaces:
Comparator
- Enclosing class:
Struct
A Comparator which performs comparisons between two rows in a structured list (used
in sorting). This comparator is equivalent to an 'ORDER BY' on a single field
returned by the Spring JdbcTemplate method.
-
Constructor Summary
ConstructorsConstructorDescriptionStructuredListComparator
(String fieldName) Create a new StructuredListComparator object, which will sort on the supplied field. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
StructuredListComparator
Create a new StructuredListComparator object, which will sort on the supplied field.- Parameters:
fieldName
- The name of the field to sort on
-
-
Method Details
-
compare
Compare two structured list elements- Specified by:
compare
in interfaceComparator
- Throws:
IllegalArgumentException
- See Also:
-