java.lang.Object
com.inductiveautomation.ignition.common.model.Version
All Implemented Interfaces:
Serializable, Comparable<Version>

public class Version extends Object implements Comparable<Version>, Serializable
See Also:
  • Constructor Details

    • Version

      public Version()
      Creates a dev version
    • Version

      public Version(int major, int minor, int rev, int build)
    • Version

      public Version(int major, int minor, int rev, int build, int beta, int rc)
  • Method Details

    • isDev

      public boolean isDev()
    • isSnapshot

      public boolean isSnapshot()
    • exists

      public boolean exists()
    • getBuildNumber

      public int getBuildNumber()
    • getBeta

      public int getBeta()
    • getRc

      public int getRc()
    • toParseableString

      public String toParseableString()
      Returns the version as a compact, parsable (non-XML) string that can be parsed with the 1-string constructor of this class
    • toString

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

      public String getBasicString()
      Returns the version like 3.8.1 or 4.0.12-rc3
    • getVerboseString

      public String getVerboseString()
      Returns the version like 3.8.1 (b1039)
    • getMajor

      public int getMajor()
    • getMinor

      public int getMinor()
    • getRevision

      public int getRevision()
    • getXML

      public String getXML()
    • fromXML

      public static Version fromXML(InputStream is) throws SAXException, IOException
      Parses an XML document, looking for a Version element as given by getXML(). If found, will return a version object corresponding to that version. If no version element is found, null is returned.
      Throws:
      SAXException
      IOException
    • parse

      public static Version parse(String s)
      Creates a version from a string of the format created by Version.toParseableString()
    • isFutureVersion

      public boolean isFutureVersion(Version that)
      This differs from compareTo in that it only looks at major/minor/rev. Returns true if 'that' is a future major/minor/rev and should not be restored / imported
    • isFutureVersion

      public boolean isFutureVersion(String s)
      Convenience method for scripting.
      Parameters:
      s - String representing a Version
      Returns:
      True if string represents a future major/minor/rev
    • compareTo

      public int compareTo(Version that)
      Compares two Versions. Note that this comparison is stricter than we want for Gateway restores or project imports. For those, isFutureVersion()
      Specified by:
      compareTo in interface Comparable<Version>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object