Package org.ametys.plugins.linkdirectory
Class DirectoryHelper.DefaultLinkSorter
- java.lang.Object
-
- org.ametys.plugins.linkdirectory.DirectoryHelper.DefaultLinkSorter
-
- All Implemented Interfaces:
Comparator<Pair<Boolean,DefaultLink>>
- Enclosing class:
- DirectoryHelper
private class DirectoryHelper.DefaultLinkSorter extends Object implements Comparator<Pair<Boolean,DefaultLink>>
Helper class to sort links (DefaultLinkSorter implementation) If both links are in the ordered links list, this order is used If one of them is in it and not the other, the one in it will be before the other If none of them is in the list, the initial order will be used
-
-
Field Summary
Fields Modifier and Type Field Description private List<String>
_initialList
private String[]
_orderedLinksPrefLinksIdsArray
-
Constructor Summary
Constructors Constructor Description DefaultLinkSorter(List<Pair<Boolean,DefaultLink>> initialList, String[] orderedLinksPrefLinksIdsArray)
constructor for the helper
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(Pair<Boolean,DefaultLink> pair1, Pair<Boolean,DefaultLink> pair2)
-
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
-
_orderedLinksPrefLinksIdsArray
private String[] _orderedLinksPrefLinksIdsArray
-
_initialList
private List<String> _initialList
-
-
Constructor Detail
-
DefaultLinkSorter
public DefaultLinkSorter(List<Pair<Boolean,DefaultLink>> initialList, String[] orderedLinksPrefLinksIdsArray)
constructor for the helper- Parameters:
initialList
- initial list to keep track of the original order if no order is foundorderedLinksPrefLinksIdsArray
- ordered list of link ids
-
-
Method Detail
-
compare
public int compare(Pair<Boolean,DefaultLink> pair1, Pair<Boolean,DefaultLink> pair2)
- Specified by:
compare
in interfaceComparator<Pair<Boolean,DefaultLink>>
-
-