Class AccessTokenExpirationDateComparator
- java.lang.Object
-
- com.jalios.jstore.BasicStorable.CdateComparator<T>
-
- com.jalios.jcms.comparator.BasicComparator<AccessToken>
-
- com.jalios.jcms.authentication.accesstoken.AccessTokenExpirationDateComparator
-
- All Implemented Interfaces:
java.util.Comparator<AccessToken>
public class AccessTokenExpirationDateComparator extends BasicComparator<AccessToken>
A Comparator implementation that compares twoAccessToken
on their expiration Date objects and orders them such that past dates come before future dates.This Comparator considers non-null values to be greater than any null date. Hence, non-null dates will be sorted to the end of the list.
- Since:
- jcms-10.0.8
- Author:
- Sylvain Devaux
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.jalios.jcms.comparator.BasicComparator
BasicComparator.StringComparisonMethod
-
-
Field Summary
-
Fields inherited from class com.jalios.jcms.comparator.BasicComparator
channel, comparisonMethod, contextMap, jcmsContext, language, locale
-
-
Constructor Summary
Constructors Constructor Description AccessTokenExpirationDateComparator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(AccessToken p1, AccessToken p2)
Compares two Dates in ascending order.-
Methods inherited from class com.jalios.jcms.comparator.BasicComparator
compareString
-
Methods inherited from class com.jalios.jstore.BasicStorable.CdateComparator
compareDate
-
-
-
-
Method Detail
-
compare
public int compare(AccessToken p1, AccessToken p2)
Compares two Dates in ascending order.- Specified by:
compare
in interfacejava.util.Comparator<AccessToken>
- Overrides:
compare
in classBasicStorable.CdateComparator<AccessToken>
- Parameters:
p1
- the first token with expiration date d1p2
- the second token with expiration date d2- Returns:
- -1, 0 or 1 if d1 is lower than, equals or greater than d2
-
-