public abstract class IdStrategy extends AbstractDescribableImpl<IdStrategy> implements ExtensionPoint, Comparator<String>
| Modifier and Type | Class and Description |
|---|---|
static class |
IdStrategy.CaseInsensitive
The default case insensitive
IdStrategy |
static class |
IdStrategy.CaseSensitive
A case sensitive
IdStrategy |
static class |
IdStrategy.CaseSensitiveEmailAddress
A case sensitive email address
IdStrategy. |
ExtensionPoint.LegacyInstancesAreScopedToHudson| Modifier and Type | Field and Description |
|---|---|
static IdStrategy |
CASE_INSENSITIVE
The default case insensitive strategy.
|
| Constructor and Description |
|---|
IdStrategy() |
| Modifier and Type | Method and Description |
|---|---|
static DescriptorExtensionList<IdStrategy,IdStrategyDescriptor> |
all()
Returns all the registered
IdStrategy descriptors. |
abstract int |
compare(String id1,
String id2)
Compare tow IDs and return their sorting order.
|
boolean |
equals(Object obj)
This method is used to decide whether a
User.rekey() operation is required. |
boolean |
equals(String id1,
String id2)
Compare two IDs and return
true IFF the two ids are the same. |
abstract String |
filenameOf(String id)
Converts an ID into a name that for use as a filename.
|
IdStrategyDescriptor |
getDescriptor()
By default looks for a nested class (conventionally named
DescriptorImpl) implementing Descriptor and marked with Extension. |
int |
hashCode() |
String |
idFromFilename(String filename)
Converts a filename into the corresponding id.
|
abstract String |
keyFor(String id)
Converts an ID into a key for use in a Java Map.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitcomparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongpublic static IdStrategy CASE_INSENSITIVE
@Nonnull public abstract String filenameOf(@Nonnull String id)
id - the id. Note, this method assumes that the id does not contain any filesystem unsafe characters.public String idFromFilename(@Nonnull String filename)
filename - the filename.@Nonnull public abstract String keyFor(@Nonnull String id)
id - the id.public boolean equals(@Nonnull String id1, @Nonnull String id2)
true IFF the two ids are the same. Normally we expect that this should be
the same as compare(String, String) being equal to 0, however there may be a specific reason
for going beyond that, such as sorting id's case insensitively while treating them as case sensitive.id1 - the first id.id2 - the second id.true if and only if the two ids are the same.public abstract int compare(@Nonnull String id1, @Nonnull String id2)
equals(String, String) is true then this
must return 0 but compare(String, String) returning 0 need not imply that
equals(String, String) is true.compare in interface Comparator<String>id1 - the first id.id2 - the second id.public IdStrategyDescriptor getDescriptor()
DescriptorImpl) implementing Descriptor and marked with Extension.
Gets the descriptor for this instance.
Descriptor is a singleton for every concrete Describable
implementation, so if a.getClass() == b.getClass() then by default
a.getDescriptor() == b.getDescriptor() as well.
(In rare cases a single implementation class may be used for instances with distinct descriptors.)
getDescriptor in interface Describable<IdStrategy>getDescriptor in class AbstractDescribableImpl<IdStrategy>public boolean equals(Object obj)
User.rekey() operation is required.equals in interface Comparator<String>equals in class Objectobj - the object to compare with.true if and only if this is the same as obj.public static DescriptorExtensionList<IdStrategy,IdStrategyDescriptor> all()
IdStrategy descriptors.Copyright © 2019. All rights reserved.