Record Class GameVersionTag

java.lang.Object
java.lang.Record
io.github.smootheez.modrinth.GameVersionTag
Record Components:
version - the human-readable version string (e.g., "1.20.1")
versionType - classification of the version (e.g., "release", "snapshot", "beta"); mapped from the JSON field version_type
date - the release date of the version in ISO-8601 format
major - whether this version is marked as a major update

public record GameVersionTag(String version, String versionType, String date, boolean major) extends Record
Represents a game version entry retrieved from an external API such as Modrinth.

Each version includes metadata describing its release type, publication date, and whether it is considered a major release. This information is typically used to determine compatibility or filter target versions during publishing.

  • Constructor Details

    • GameVersionTag

      public GameVersionTag(String version, String versionType, String date, boolean major)
      Creates an instance of a GameVersionTag record class.
      Parameters:
      version - the value for the version record component
      versionType - the value for the versionType record component
      date - the value for the date record component
      major - the value for the major record component
  • Method Details

    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • version

      public String version()
      Returns the value of the version record component.
      Returns:
      the value of the version record component
    • versionType

      @SerializedName("version_type") public String versionType()
      Returns the value of the versionType record component.
      Returns:
      the value of the versionType record component
    • date

      public String date()
      Returns the value of the date record component.
      Returns:
      the value of the date record component
    • major

      public boolean major()
      Returns the value of the major record component.
      Returns:
      the value of the major record component