public class DocumentModelComparator extends Object implements Sorter
Constructor and Description |
---|
DocumentModelComparator(Map<String,String> orderBy)
Constructor using a map of property names to compare on.
|
DocumentModelComparator(String schemaName,
Map<String,String> orderBy)
Constructor using a schema and a map of field names to compare on.
|
Modifier and Type | Method and Description |
---|---|
int |
compare(DocumentModel doc1,
DocumentModel doc2) |
protected int |
compare(Object v1,
Object v2,
boolean asc) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public static final String ORDER_ASC
public DocumentModelComparator(String schemaName, Map<String,String> orderBy)
schemaName
- the schema nameorderBy
- map using property names as keys, and "asc" or "desc" as values. Should be a LinkedHashMap
if order of criteria matters.public DocumentModelComparator(Map<String,String> orderBy)
orderBy
- map using property names as keys, and "asc" or "desc" as values. Should be a LinkedHashMap
if order of criteria matters.public int compare(DocumentModel doc1, DocumentModel doc2)
compare
in interface Comparator<DocumentModel>
Copyright © 2015 Nuxeo SA. All rights reserved.