info.magnolia.module.model
Class Version
java.lang.Object
info.magnolia.module.model.Version
public class Version
- extends 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. |
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(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 String getClassifier()
toString
public String toString()
- Overrides:
toString
in class Object
equals
public boolean equals(Object o)
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
Copyright © 2003-2013 Magnolia International Ltd.. All Rights Reserved.