Class UserCachingComparator
java.lang.Object
com.atlassian.jira.issue.comparator.UserCachingComparator
- All Implemented Interfaces:
Comparator<ApplicationUser>
@NotThreadSafe
public class UserCachingComparator
extends Object
implements Comparator<ApplicationUser>
This comparator tries to compare two users based on their 'best name'
ie their full name if possible, otherwise their username.
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
}
for more information about collation keys and their performance implications.
invalid @link
{@link http://docs.oracle.com/javase/tutorial/i18n/text/perform.html
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.
- Since:
- v6.2
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
UserCachingComparator
-
UserCachingComparator
public UserCachingComparator()
-
-
Method Details
-
compare
- Specified by:
comparein interfaceComparator<ApplicationUser>
-