Package org.alfresco.repo.module
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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.maven.artifact.versioning.ComparableVersiondelegatestatic ModuleVersionNumberVERSION_BIGstatic ModuleVersionNumberVERSION_ZERO
-
Constructor Summary
Constructors Constructor Description ModuleVersionNumber()ModuleVersionNumber(String versionString)ModuleVersionNumber(VersionNumber versionCurrent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(ModuleVersionNumber installingVersion)Now that we create internal releases of the formM.m.r-M9(milestone),M.m.r-A9(alpha) andM.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 releaseM.m.r.booleanequals(Object obj)inthashCode()voidreadExternal(ObjectInput in)StringtoString()voidwriteExternal(ObjectOutput out)
-
-
-
Field Detail
-
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 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 formM.m.r-M9(milestone),M.m.r-A9(alpha) andM.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 releaseM.m.r. We also will allow a change from the final release back to an internal one for regression testing. The code withinModuleComponentHelperwhich calls this method, checks if it is the same version (0) and then if it is downgrading (> 0), so if they share the sameM.m.rpart 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.
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
-