Record Class HttpUtil.PluginVersion

java.lang.Object
java.lang.Record
kr.toxicity.model.api.util.HttpUtil.PluginVersion
Record Components:
id - id
versionNumber - number
versionType - type
versions - game versions
loaders - loaders
Enclosing class:
HttpUtil

public static record HttpUtil.PluginVersion(@NotNull String id, @NotNull org.semver4j.Semver versionNumber, @NotNull String versionType, @NotNull Set<MinecraftVersion> versions, @NotNull Set<String> loaders) extends Record
Plugin version
  • Constructor Details

    • PluginVersion

      public PluginVersion(@NotNull @NotNull String id, @NotNull @NotNull org.semver4j.Semver versionNumber, @NotNull @NotNull String versionType, @NotNull @NotNull Set<MinecraftVersion> versions, @NotNull @NotNull Set<String> loaders)
      Creates an instance of a PluginVersion record class.
      Parameters:
      id - the value for the id record component
      versionNumber - the value for the versionNumber record component
      versionType - the value for the versionType record component
      versions - the value for the versions record component
      loaders - the value for the loaders record component
  • Method Details

    • toURLComponent

      @NotNull public @NotNull net.kyori.adventure.text.Component toURLComponent()
      Creates a text component with URL
      Returns:
      text component
    • isSamePlatform

      public boolean isSamePlatform()
      Checks this version is same platform with running platform
      Returns:
      is same platform
    • 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.
    • id

      @NotNull public @NotNull String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • versionNumber

      @NotNull @SerializedName("version_number") public @NotNull org.semver4j.Semver versionNumber()
      Returns the value of the versionNumber record component.
      Returns:
      the value of the versionNumber record component
    • versionType

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

      @NotNull @SerializedName("game_versions") public @NotNull Set<MinecraftVersion> versions()
      Returns the value of the versions record component.
      Returns:
      the value of the versions record component
    • loaders

      @NotNull public @NotNull Set<String> loaders()
      Returns the value of the loaders record component.
      Returns:
      the value of the loaders record component