Class VersionNumber

java.lang.Object
it.uniroma2.art.semanticturkey.resources.VersionNumber
All Implemented Interfaces:
Comparable<VersionNumber>

public class VersionNumber extends Object implements Comparable<VersionNumber>
a class for representing/managing Semantic Turkey version number
Author:
Armando Stellato
  • 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

      public VersionNumber(String versionCode)
  • 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

      public String toString()
      Overrides:
      toString in class Object
    • compareTo

      public int compareTo(VersionNumber o)
      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:
      compareTo in interface Comparable<VersionNumber>
      Parameters:
      o - the object to be compared.
      Returns:
    • main

      public static void main(String[] args)