@NotThreadSafe public class UserCachingComparator extends Object implements Comparator<ApplicationUser>
This comparator completely ignores case, using the specified locale to make sure that
we correctly sort i18n characters. It uses locale-sensitive collation, which is very
expensive in CPU time. To minimise the overhead of this, it caches the collation keys
for users internally. See http://docs.oracle.com/javase/tutorial/i18n/text/perform.html
for more information about collation keys and their performance implications.
WARNING: This class is NOT thread safe and caches information potentially about all users. You should not reuse instances of this class beyond the scope of a single servlet/rest/web request.
Constructor and Description |
---|
UserCachingComparator() |
UserCachingComparator(Locale locale) |
Modifier and Type | Method and Description |
---|---|
int |
compare(ApplicationUser user1,
ApplicationUser user2) |
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 UserCachingComparator(Locale locale)
public UserCachingComparator()
public int compare(ApplicationUser user1, ApplicationUser user2)
compare
in interface Comparator<ApplicationUser>
Copyright © 2002-2019 Atlassian. All Rights Reserved.