|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.module.CmsModuleVersion
public class CmsModuleVersion
A version number for an OpenCms module.
A module version number has the form n1.n2.n3.n4
.
Only n1
is required, n2 - n4
are optional.
The valid range for each n
is 0 - 999.
Examples for valid version numbers are 0.9
, 1.0.0.5
or 5
.
The maximum version number is 999.999.999.999
.
The comparison is started with n1
being the most important value,
followed by n2 - n4
.
For example 5.0.0.1 > 4.999.999.999
since 5 > 4
.
For any n1 - n4
, if n > 0
leading zeros are ignored.
So 001.002.004.004 = 1.2.3.4
. Unrequired leading zeros are automatically
stripped from version numbers.
Field Summary | |
---|---|
static String |
DEFAULT_VERSION
Default version for new modules. |
Constructor Summary | |
---|---|
CmsModuleVersion(String version)
Creates a new module version based on a String. |
Method Summary | |
---|---|
int |
compareTo(Object obj)
|
boolean |
equals(Object obj)
|
String |
getVersion()
Returns the current version String. |
int |
hashCode()
|
protected void |
increment()
Increments this version number by 1 in the last digit. |
protected boolean |
isUpdated()
Returns the updated status. |
protected void |
setUpdated(boolean updated)
Sets the updated status. |
void |
setVersion(String version)
Sets the version as a String. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_VERSION
Constructor Detail |
---|
public CmsModuleVersion(String version)
version
- the version to setMethod Detail |
---|
public int compareTo(Object obj)
compareTo
in interface Comparable<Object>
Comparable.compareTo(java.lang.Object)
public boolean equals(Object obj)
equals
in class Object
Object.equals(java.lang.Object)
public String getVersion()
public int hashCode()
hashCode
in class Object
Object.hashCode()
public void setVersion(String version)
version
- the version String to setpublic String toString()
toString
in class Object
Object.toString()
protected void increment()
protected boolean isUpdated()
protected void setUpdated(boolean updated)
updated
- the updated status to set
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |