Class CounterStorageKeyComparator
- java.lang.Object
-
- net.shibboleth.idp.consent.logic.impl.CounterStorageKeyComparator
-
- All Implemented Interfaces:
Comparator<String>
public class CounterStorageKeyComparator extends Object implements Comparator<String>
AComparatorused to order storage keys so that the least used and oldest storage keys are returned first. The constructor for this class accepts two arguments : (1) the storage keys in order of oldest first and (2) the number of times the storage keys were used.
-
-
Field Summary
Fields Modifier and Type Field Description private Map<String,Long>keyToCounterMapMap of storage keys to counters.private LoggerlogClass logger.private List<String>storageKeysStorage keys in FIFO order.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(String o1, String 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
-
-
-
-
Method Detail
-
compare
public int compare(String o1, String o2)
- Specified by:
comparein interfaceComparator<String>
-
-