Class ModuleVersionNumber

java.lang.Object
org.alfresco.repo.module.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:
  • Field Details

    • VERSION_ZERO

      public static final ModuleVersionNumber VERSION_ZERO
    • VERSION_BIG

      public static final ModuleVersionNumber VERSION_BIG
    • delegate

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

    • ModuleVersionNumber

      public ModuleVersionNumber()
    • ModuleVersionNumber

      public ModuleVersionNumber(String versionString)
    • ModuleVersionNumber

      public ModuleVersionNumber(VersionNumber versionCurrent)
  • Method Details

    • 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
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • writeExternal

      public void writeExternal(ObjectOutput out) throws IOException
      Specified by:
      writeExternal in interface Externalizable
      Throws:
      IOException
    • readExternal

      public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
      Specified by:
      readExternal in interface Externalizable
      Throws:
      IOException
      ClassNotFoundException