Class VersionNumber
java.lang.Object
it.uniroma2.art.semanticturkey.resources.VersionNumber
- All Implemented Interfaces:
Comparable<VersionNumber>
a class for representing/managing Semantic Turkey version number
- Author:
- Armando Stellato
-
Constructor Summary
ConstructorsConstructorDescriptionVersionNumber(int major) VersionNumber(int major, int minor) VersionNumber(int major, int minor, int revision) VersionNumber(int major, int minor, int revision, boolean snapshot) VersionNumber(String versionCode) -
Method Summary
Modifier and TypeMethodDescriptionintCompare this version with another one.intgetMajor()intgetMinor()intbooleanstatic voidvoidsetMajor(int major) voidsetMinor(int minor) voidsetRevision(int revision) voidsetSnapshot(boolean snapshot) toString()
-
Constructor Details
-
VersionNumber
public VersionNumber(int major) -
VersionNumber
public VersionNumber(int major, int minor) -
VersionNumber
public VersionNumber(int major, int minor, int revision) -
VersionNumber
public VersionNumber(int major, int minor, int revision, boolean snapshot) -
VersionNumber
-
-
Method Details
-
setMajor
public void setMajor(int major) -
getMajor
public int getMajor() -
setMinor
public void setMinor(int minor) -
getMinor
public int getMinor() -
setRevision
public void setRevision(int revision) -
getRevision
public int getRevision() -
setSnapshot
public void setSnapshot(boolean snapshot) -
isSnapshot
public boolean isSnapshot() -
toString
-
compareTo
Compare this version with another one. The SNAPSHOT modifier is ignored: for example, 1.2.3 and 1.2.3-SNAPSHOT are considered equivalent and the method returns 0. This prevents executing the same update routine twice (which might not be idempotent). For example: - If ST is updated from 1.2.2 to 1.2.3-SNAPSHOT, the update routine for 1.2.3 is triggered because 1.2.2 < 1.2.3. - If ST is later updated from 1.2.3-SNAPSHOT to 1.3.0-SNAPSHOT, the routine for 1.2.3 MUST NOT be triggered again, since 1.2.3-SNAPSHOT is considered equal to 1.2.3.- Specified by:
compareToin interfaceComparable<VersionNumber>- Parameters:
o- the object to be compared.- Returns:
-
main
-