info.magnolia.module.model
Class Version
java.lang.Object
info.magnolia.module.model.Version
public class Version
- extends java.lang.Object
Represents a module version. Format is x.y.z-classifier. y,z and classifier are
optional. The classifier string is ignored in version comparisons.
- Version:
- $Revision: $ ($Author: $)
- Author:
- gjoseph
Constructor Summary |
protected |
Version(int major,
int minor,
int patch)
Convenience constructor that could be used to register Deltas or update tasks. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
UNDEFINED_FROM
public static final Version UNDEFINED_FROM
UNDEFINED_TO
public static final Version UNDEFINED_TO
UNDEFINED_DEVELOPMENT_VERSION
public static final Version UNDEFINED_DEVELOPMENT_VERSION
Version
protected Version(int major,
int minor,
int patch)
- Convenience constructor that could be used to register Deltas or update tasks.
parseVersion
public static Version parseVersion(java.lang.String versionStr)
- Factory method that will parse a version string and return the correct Version implementation.
- Parameters:
versionStr
- version as string, for example 1.2.3-test
. The String
${project.version}
is interpreted as an undefined version during development ant it will always
match version ranges
- Returns:
- a Version implementation, never null
parseVersion
public static Version parseVersion(int major,
int minor,
int patch)
isEquivalent
public boolean isEquivalent(Version other)
- Compares major, minor and patch revisions of this Version against the given Version.
Classifier is ignored.
isStrictlyAfter
public boolean isStrictlyAfter(Version other)
isBeforeOrEquivalent
public boolean isBeforeOrEquivalent(Version other)
getMajor
public short getMajor()
getMinor
public short getMinor()
getPatch
public short getPatch()
getClassifier
public java.lang.String getClassifier()
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in class java.lang.Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
Copyright © 2003-2011 Magnolia International Ltd.. All Rights Reserved.