Record Class GoVerSet

java.lang.Object
java.lang.Record
ghidra.app.util.bin.format.golang.GoVerSet
Record Components:
ranges - list of ranges that define the set

public record GoVerSet(List<GoVerRange> ranges) extends Record
Represents a set of version numbers.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final GoVerSet
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an instance of a GoVerSet record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns true if the specified version is present in the set.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    boolean
    Returns true if the set contains no versions
    static GoVerSet
    Parses a version list string (eg.
    Returns the value of the ranges record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • ALL

      public static final GoVerSet ALL
  • Constructor Details

    • GoVerSet

      public GoVerSet(List<GoVerRange> ranges)
      Creates an instance of a GoVerSet record class.
      Parameters:
      ranges - the value for the ranges record component
  • Method Details

    • parse

      public static GoVerSet parse(String s) throws IOException
      Parses a version list string (eg. "all", or "1.0-1.5,1.8-1.9,1.11-") and returns a GoVerSet containing the found versions.
      Parameters:
      s - string to parse
      Returns:
      GoVerSet containing the found versions
      Throws:
      IOException - if the string had invalid start or end wildcard ranges
    • isEmpty

      public boolean isEmpty()
      Returns true if the set contains no versions
      Returns:
      boolean true if empty
    • contains

      public boolean contains(GoVer ver)
      Returns true if the specified version is present in the set.
      Parameters:
      ver - GoVer to search for
      Returns:
      boolean true if version is present
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • ranges

      public List<GoVerRange> ranges()
      Returns the value of the ranges record component.
      Returns:
      the value of the ranges record component