Package jenkins.model
Class IdStrategy.CaseSensitiveEmailAddress
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<IdStrategy>
-
- jenkins.model.IdStrategy
-
- jenkins.model.IdStrategy.CaseSensitive
-
- jenkins.model.IdStrategy.CaseSensitiveEmailAddress
-
- All Implemented Interfaces:
ExtensionPoint,Describable<IdStrategy>,Serializable,Comparator<String>
- Enclosing class:
- IdStrategy
public static class IdStrategy.CaseSensitiveEmailAddress extends IdStrategy.CaseSensitive implements Serializable
A case sensitive email addressIdStrategy. Providing this implementation among the set of default implementations as given the history of misunderstanding in the Jenkins code base around ID case sensitivity, if not provided people will get this wrong.Note: Not all email addresses are case sensitive. It is knowledge that belongs to the server that holds the mailbox. Most sane system administrators do not configure their accounts using case sensitive mailboxes but the RFC does allow them the option to configure that way. Domain names are always case insensitive per RFC.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classIdStrategy.CaseSensitiveEmailAddress.DescriptorImpl-
Nested classes/interfaces inherited from class jenkins.model.IdStrategy
IdStrategy.CaseInsensitive, IdStrategy.CaseSensitive, IdStrategy.CaseSensitiveEmailAddress
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
-
Fields inherited from class jenkins.model.IdStrategy
CASE_INSENSITIVE
-
-
Constructor Summary
Constructors Constructor Description CaseSensitiveEmailAddress()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(String id1, String id2)Compare two IDs and return their sorting order.booleanequals(String id1, String id2)Compare two IDs and returntrueIFF the two ids are the same.StringkeyFor(String id)Converts an ID into a key for use in a Java Map or similar.-
Methods inherited from class jenkins.model.IdStrategy.CaseSensitive
idFromFilename
-
Methods inherited from class jenkins.model.IdStrategy
all, equals, filenameOf, getDescriptor, hashCode, legacyFilenameOf, 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
-
-
-
-
Method Detail
-
equals
public boolean equals(@NonNull String id1, @NonNull String id2)Description copied from class:IdStrategyCompare two IDs and returntrueIFF the two ids are the same. Normally we expect that this should be the same asIdStrategy.compare(String, String)being equal to0, however there may be a specific reason for going beyond that, such as sorting id's case insensitively while treating them as case sensitive. Subclasses may want to override this naïve implementation that callscompare(id1, id2) == 0for a more performant implementation.- Overrides:
equalsin classIdStrategy.CaseSensitive- Parameters:
id1- the first id.id2- the second id.- Returns:
trueif and only if the two ids are the same.
-
keyFor
@NonNull public String keyFor(@NonNull String id)
Description copied from class:IdStrategyConverts an ID into a key for use in a Java Map or similar. This controls uniqueness of ids and how multiple different ids may map to the same id. For example, all different capitalizations of "Foo" may map to the same value "foo".- Overrides:
keyForin classIdStrategy- Parameters:
id- the id.- Returns:
- the key.
-
compare
public int compare(@NonNull String id1, @NonNull String id2)Description copied from class:IdStrategyCompare two IDs and return their sorting order. IfIdStrategy.equals(String, String)istruethen this must return0butIdStrategy.compare(String, String)returning0need not imply thatIdStrategy.equals(String, String)istrue.- Specified by:
comparein interfaceComparator<String>- Overrides:
comparein classIdStrategy.CaseSensitive- Parameters:
id1- the first id.id2- the second id.- Returns:
- the sorting order of the two IDs.
-
-