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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description 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(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(Credentials c1, Credentials c2)
boolean
equals(Object o)
int
hashCode()
String
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 Detail
-
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
public CredentialsNameComparator(@CheckForNull Locale locale)
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
public CredentialsNameComparator(@CheckForNull Locale locale, boolean ignoreCase)
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 Detail
-
compare
public int compare(Credentials c1, Credentials c2)
- Specified by:
compare
in interfaceComparator<Credentials>
-
equals
public boolean equals(Object o)
- Specified by:
equals
in interfaceComparator<Credentials>
- Overrides:
equals
in classObject
-
-