Class ModuleVersionNumber

  • All Implemented Interfaces:
    Externalizable, Serializable

    public class ModuleVersionNumber
    extends Object
    implements Externalizable
    The exising Alfresco VersionNumber can only be numeric. ModuleVersionNumber allows string literals in the version number. It follows maven conventions and actually uses the ComparableVersion class from the maven code base.
    Author:
    Gethin James
    See Also:
    Serialized Form
    • Field Detail

      • delegate

        protected org.apache.maven.artifact.versioning.ComparableVersion delegate
    • Constructor Detail

      • ModuleVersionNumber

        public ModuleVersionNumber()
      • ModuleVersionNumber

        public ModuleVersionNumber​(String versionString)
      • ModuleVersionNumber

        public ModuleVersionNumber​(VersionNumber versionCurrent)
    • Method Detail

      • compareTo

        public int compareTo​(ModuleVersionNumber installingVersion)
        Now that we create internal releases of the form M.m.r-M9 (milestone), M.m.r-A9 (alpha) and M.m.r-RC9 (release candidate) during development and testing, we need to ensure we can upgrade from any of these to any other, as they may occur in any order and also to the final external release M.m.r. We also will allow a change from the final release back to an internal one for regression testing. The code within ModuleComponentHelper which calls this method, checks if it is the same version (0) and then if it is downgrading (> 0), so if they share the same M.m.r part matches AND is one of these formats, we return <0.
        Parameters:
        installingVersion - the new version
        Returns:
        a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object