Package jenkins.model

Class IdStrategy

    • Field Detail

      • CASE_INSENSITIVE

        public static IdStrategy CASE_INSENSITIVE
        The default case insensitive strategy.
    • Constructor Detail

      • IdStrategy

        public IdStrategy()
    • Method Detail

      • filenameOf

        @Deprecated
        public String filenameOf​(@NonNull
                                 String id)
        Deprecated.
        No current use.
        No longer used. This method is now a no-op but the signature is retained for backward compatibility.
        Parameters:
        id - the id.
        Returns:
        the name. Must be filesystem safe.
      • legacyFilenameOf

        @Deprecated
        @Restricted(org.kohsuke.accmod.restrictions.ProtectedExternally.class)
        public String legacyFilenameOf​(@NonNull
                                       String id)
        Deprecated.
        No current use.
        No longer used. This method is now a no-op but the signature is retained for backward compatibility.
        Parameters:
        id - the id
        Returns:
        the name
      • idFromFilename

        @Deprecated
        public String idFromFilename​(@NonNull
                                     String filename)
        Deprecated.
        Use only for migrating to new format. After the migration an id is no longer represented by a filename (directory).
        Converts a filename into the corresponding id. This may contain filesystem unsafe characters.
        Parameters:
        filename - the filename.
        Returns:
        the corresponding id.
        Since:
        1.577
      • keyFor

        @NonNull
        public String keyFor​(@NonNull
                             String id)
        Converts 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".
        Parameters:
        id - the id.
        Returns:
        the key.
      • equals

        public boolean equals​(@NonNull
                              String id1,
                              @NonNull
                              String id2)
        Compare two IDs and return 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. Subclasses may want to override this naïve implementation that calls compare(id1, id2) == 0 for a more performant implementation.
        Parameters:
        id1 - the first id.
        id2 - the second id.
        Returns:
        true if and only if the two ids are the same.
      • equals

        public boolean equals​(Object obj)
        This method is used to decide whether a User.rekey() operation is required.
        Specified by:
        equals in interface Comparator<String>
        Overrides:
        equals in class Object
        Parameters:
        obj - the object to compare with.
        Returns:
        true if and only if this is the same as obj.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object