Package org.nuxeo.ecm.core.api
Class DocumentModelComparator
java.lang.Object
org.nuxeo.ecm.core.api.DocumentModelComparator
- All Implemented Interfaces:
Serializable
,Comparator<DocumentModel>
,Sorter
DocumentModel comparator. Uses ordering independent of case or accent. If two values are integers/longs, numbering
comparison is used.
- Author:
- Florent Guillaume, Anahide Tchertchian
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDocumentModelComparator
(String schemaName, Map<String, String> orderBy) Constructor using a schema and a map of field names to compare on.DocumentModelComparator
(Map<String, String> orderBy) Constructor using a map of property names to compare on. -
Method Summary
Modifier and TypeMethodDescriptionprotected int
int
compare
(DocumentModel doc1, DocumentModel doc2) 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
-
Field Details
-
ORDER_ASC
- See Also:
-
-
Constructor Details
-
DocumentModelComparator
Constructor using a schema and a map of field names to compare on.- Parameters:
schemaName
- the schema nameorderBy
- map using property names as keys, and "asc" or "desc" as values. Should be aLinkedHashMap
if order of criteria matters.
-
DocumentModelComparator
Constructor using a map of property names to compare on.- Parameters:
orderBy
- map using property names as keys, and "asc" or "desc" as values. Should be aLinkedHashMap
if order of criteria matters.
-
-
Method Details
-
compare
-
compare
- Specified by:
compare
in interfaceComparator<DocumentModel>
-