Class GoVer

java.lang.Object
ghidra.app.util.bin.format.golang.GoVer
All Implemented Interfaces:
Comparable<GoVer>

public class GoVer extends Object implements Comparable<GoVer>
Golang version numbers
  • Field Details

    • INVALID

      public static final GoVer INVALID
    • ANY

      public static final GoVer ANY
    • V1_2

      public static final GoVer V1_2
    • V1_16

      public static final GoVer V1_16
    • V1_17

      public static final GoVer V1_17
    • V1_18

      public static final GoVer V1_18
    • GOLANG_VERSION_PROPERTY_NAME

      public static final String GOLANG_VERSION_PROPERTY_NAME
      See Also:
  • Constructor Details

    • GoVer

      public GoVer(int major, int minor)
  • Method Details

    • isInvalid

      public boolean isInvalid()
    • isWildcard

      public boolean isWildcard()
    • getMajor

      public int getMajor()
      Major value
      Returns:
      major
    • getMinor

      public int getMinor()
      Minor value
      Returns:
      minor
    • compareTo

      public int compareTo(GoVer o)
      Specified by:
      compareTo in interface Comparable<GoVer>
    • isAtLeast

      public boolean isAtLeast(GoVer otherVersion)
      Compares this version to the specified other version and returns true if this version is greater than or equal to the other version.
      Parameters:
      otherVersion - version info to compare
      Returns:
      true if this version is gte other version
    • inRange

      public boolean inRange(GoVer min, GoVer max)
      Returns true if this version is between the specified min and max versions (inclusive).
      Parameters:
      min - minimum version to allow (inclusive)
      max - maximum version to allow (inclusive)
      Returns:
      boolean true if this version is between the specified min and max versions
    • parse

      public static GoVer parse(String s)
      Parses a version string ("1.2") and returns a GoVer instance, or INVALID if no matching version or bad data.
      Parameters:
      s - string to parse
      Returns:
      GoVer instance, or INVALID
    • fromProgramProperties

      public static GoVer fromProgramProperties(Program program)
    • setProgramPropertiesWithOriginalVersionString

      public static void setProgramPropertiesWithOriginalVersionString(Options props, String s)
    • hashCode

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

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

      public String toString()
      Overrides:
      toString in class Object