Package ghidra.framework

# Class ApplicationVersion

java.lang.Object
ghidra.framework.ApplicationVersion

All Implemented Interfaces:
  `Comparable<ApplicationVersion>`

public class ApplicationVersion extends Object implements 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 `tag` part of the version is disregarded in the `compareTo(ApplicationVersion)` method).

Examples:

- 7.4
- 7.4.1
- 7.4.1-BETA

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ApplicationVersion(String version)`
  Creates a new `ApplicationVersion` object from the given version string.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `compareTo(ApplicationVersion other)`
  `boolean`
  `equals(Object obj)`
  `int`
  `getMajor()`
  Gets the major version.
  `int`
  `getMinor()`
  Gets the minor version.
  `int`
  `getPatch()`
  Gets the patch version.
  `String`
  `getTag()`
  Gets the tag.
  `int`
  `hashCode()`
  `String`
  `toString()`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### ApplicationVersion

    public ApplicationVersion(String version) throws IllegalArgumentException
    Creates a new `ApplicationVersion` object from the given version string.
    Parameters:
      `version` - A version string.
    Throws:
      `IllegalArgumentException` - if the version string failed to parse. The exception's message has more detailed information about why it failed.

- ## Method Details

  - ### 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 String getTag()
    Gets the tag.
    Returns:
      The tag. Could be the empty string.

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### compareTo

    public int compareTo(ApplicationVersion other)
    Specified by:
      `compareTo` in interface `Comparable<ApplicationVersion>`

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### equals

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