Package jenkins.model
Class IdStrategy.CaseSensitive
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<IdStrategy>
-
- jenkins.model.IdStrategy
-
- jenkins.model.IdStrategy.CaseSensitive
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<IdStrategy>
,Serializable
,Comparator<String>
- Direct Known Subclasses:
IdStrategy.CaseSensitiveEmailAddress
- Enclosing class:
- IdStrategy
public static class IdStrategy.CaseSensitive extends IdStrategy implements Serializable
A case sensitiveIdStrategy
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
IdStrategy.CaseSensitive.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 CaseSensitive()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(String id1, String id2)
Compare two IDs and return their sorting order.boolean
equals(String id1, String id2)
Compare two IDs and returntrue
IFF the two ids are the same.String
idFromFilename(String filename)
Converts a filename into the corresponding id.-
Methods inherited from class jenkins.model.IdStrategy
all, equals, filenameOf, getDescriptor, hashCode, keyFor, 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
-
idFromFilename
public String idFromFilename(@NonNull String filename)
Description copied from class:IdStrategy
Converts a filename into the corresponding id. This may contain filesystem unsafe characters.- Overrides:
idFromFilename
in classIdStrategy
- Parameters:
filename
- the filename.- Returns:
- the corresponding id.
-
equals
public boolean equals(@NonNull String id1, @NonNull String id2)
Description copied from class:IdStrategy
Compare two IDs and returntrue
IFF 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) == 0
for a more performant implementation.- Overrides:
equals
in classIdStrategy
- Parameters:
id1
- the first id.id2
- the second id.- Returns:
true
if and only if the two ids are the same.
-
compare
public int compare(@NonNull String id1, @NonNull String id2)
Description copied from class:IdStrategy
Compare two IDs and return their sorting order. IfIdStrategy.equals(String, String)
istrue
then this must return0
butIdStrategy.compare(String, String)
returning0
need not imply thatIdStrategy.equals(String, String)
istrue
.- Specified by:
compare
in interfaceComparator<String>
- Specified by:
compare
in classIdStrategy
- Parameters:
id1
- the first id.id2
- the second id.- Returns:
- the sorting order of the two IDs.
-
-