Class CredentialsNameComparator
java.lang.Object
com.cloudbees.plugins.credentials.CredentialsNameComparator
- All Implemented Interfaces:
Serializable
,Comparator<Credentials>
public class CredentialsNameComparator
extends Object
implements Comparator<Credentials>, Serializable
Comparator to alphabetically sort credentials drop down list in ascending order by Credential Name.
- Since:
- 1.28
- See Also:
-
Constructor Summary
ConstructorDescriptionCreates a new instance that case insensitively sorts names using the the web request locale (if invoked from a web request handling thread) or the default locale (if invoked outside of a web request thread.CredentialsNameComparator
(Locale locale) Creates a new instance that case insensitively sorts names using the specified locale.CredentialsNameComparator
(Locale locale, boolean ignoreCase) Creates a new instance that sorts names using the specified locale. -
Method Summary
Modifier and TypeMethodDescriptionint
compare
(Credentials c1, Credentials c2) boolean
int
hashCode()
toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
CredentialsNameComparator
public CredentialsNameComparator()Creates a new instance that case insensitively sorts names using the the web request locale (if invoked from a web request handling thread) or the default locale (if invoked outside of a web request thread. -
CredentialsNameComparator
Creates a new instance that case insensitively sorts names using the specified locale.- Parameters:
locale
- the locale to use ornull
to use the web request locale (if invoked from a web request handling thread) or the default locale (if invoked outside of a web request thread.
-
CredentialsNameComparator
Creates a new instance that sorts names using the specified locale.- Parameters:
locale
- the locale to use ornull
to use the web request locale (if invoked from a web request handling thread) or the default locale (if invoked outside of a web request thread.ignoreCase
- iftrue
then the names will be compared ignoring case.
-
-
Method Details
-
compare
- Specified by:
compare
in interfaceComparator<Credentials>
-
hashCode
public int hashCode() -
equals
- Specified by:
equals
in interfaceComparator<Credentials>
- Overrides:
equals
in classObject
-
toString
-