Class Version
java.lang.Object
com.inductiveautomation.ignition.common.model.Version
- All Implemented Interfaces:
Serializable
,Comparable<Version>
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Compares two Versions.boolean
boolean
exists()
static Version
fromXML
(InputStream is) Parses an XML document, looking for a Version element as given by getXML().Returns the version like 3.8.1 or 4.0.12-rc3int
getBeta()
int
int
getMajor()
int
getMinor()
int
getRc()
int
Returns the version like 3.8.1 (b1039)getXML()
int
hashCode()
boolean
isDev()
boolean
isFutureVersion
(Version that) This differs from compareTo in that it only looks at major/minor/rev.boolean
Convenience method for scripting.boolean
static Version
Creates a version from a string of the format created by Version.toParseableString()Returns the version as a compact, parsable (non-XML) string that can be parsed with the 1-string constructor of this classtoString()
-
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
Returns the version as a compact, parsable (non-XML) string that can be parsed with the 1-string constructor of this class -
toString
-
getBasicString
Returns the version like 3.8.1 or 4.0.12-rc3 -
getVerboseString
Returns the version like 3.8.1 (b1039) -
getMajor
public int getMajor() -
getMinor
public int getMinor() -
getRevision
public int getRevision() -
getXML
-
fromXML
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
Creates a version from a string of the format created by Version.toParseableString() -
isFutureVersion
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
Convenience method for scripting.- Parameters:
s
- String representing a Version- Returns:
- True if string represents a future major/minor/rev
-
compareTo
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 interfaceComparable<Version>
-
hashCode
public int hashCode() -
equals
-