Package com.atlassian.confluence.util
Class AttachmentComparator
- java.lang.Object
-
- com.atlassian.confluence.util.AttachmentComparator
-
- All Implemented Interfaces:
Comparator
public class AttachmentComparator extends Object implements Comparator
-
-
Field Summary
Fields Modifier and Type Field Description static String
COMMENT_SORT
static String
CREATION_DATE_SORT
static String
FILENAME_SORT
static String
MODIFICATION_DATE_SORT
static String
SIZE_SORT
-
Constructor Summary
Constructors Constructor Description AttachmentComparator(String sortBy, boolean reverse)
Create an AttachmentComparator that will sort by the specified field.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(Object o1, Object o2)
-
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 Detail
-
FILENAME_SORT
public static final String FILENAME_SORT
- See Also:
- Constant Field Values
-
COMMENT_SORT
public static final String COMMENT_SORT
- See Also:
- Constant Field Values
-
MODIFICATION_DATE_SORT
public static final String MODIFICATION_DATE_SORT
- See Also:
- Constant Field Values
-
CREATION_DATE_SORT
public static final String CREATION_DATE_SORT
- See Also:
- Constant Field Values
-
SIZE_SORT
public static final String SIZE_SORT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AttachmentComparator
public AttachmentComparator(String sortBy, boolean reverse)
Create an AttachmentComparator that will sort by the specified field.- Parameters:
sortBy
- the field to sort on. If null, or unknown then the default behaviour will be to sort on name.reverse
- reverse the order of the sort.
-
-
Method Detail
-
compare
public int compare(Object o1, Object o2)
- Specified by:
compare
in interfaceComparator
-
-