Package ghidra.framework
Class ApplicationVersion
- java.lang.Object
-
- ghidra.framework.ApplicationVersion
-
- All Implemented Interfaces:
java.lang.Comparable<ApplicationVersion>
public class ApplicationVersion extends java.lang.Object implements java.lang.Comparable<ApplicationVersion>
Class to represent an application's version information.The version format is \d\.\d(\.\d)?(\-.+)?
Note: this class has a natural ordering that is inconsistent with equals (the
tagpart of the version is disregarded in thecompareTo(ApplicationVersion)method).Examples:
- 7.4
- 7.4.1
- 7.4.1-BETA
-
-
Constructor Summary
Constructors Constructor Description ApplicationVersion(java.lang.String version)Creates a newApplicationVersionobject from the given version string.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(ApplicationVersion other)booleanequals(java.lang.Object obj)intgetMajor()Gets the major version.intgetMinor()Gets the minor version.intgetPatch()Gets the patch version.java.lang.StringgetTag()Gets the tag.inthashCode()java.lang.StringtoString()
-
-
-
Constructor Detail
-
ApplicationVersion
public ApplicationVersion(java.lang.String version) throws java.lang.IllegalArgumentExceptionCreates a newApplicationVersionobject from the given version string.- Parameters:
version- A version string.- Throws:
java.lang.IllegalArgumentException- if the version string failed to parse. The exception's message has more detailed information about why it failed.
-
-
Method Detail
-
getMajor
public int getMajor()
Gets the major version.- Returns:
- The major version.
-
getMinor
public int getMinor()
Gets the minor version.- Returns:
- The minor version.
-
getPatch
public int getPatch()
Gets the patch version.- Returns:
- The patch version.
-
getTag
public java.lang.String getTag()
Gets the tag.- Returns:
- The tag. Could be the empty string.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
compareTo
public int compareTo(ApplicationVersion other)
- Specified by:
compareToin interfacejava.lang.Comparable<ApplicationVersion>
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-