Record Class BuildSpecification

java.lang.Object
java.lang.Record
fr.fidorial.version.BuildSpecification
Record Components:
minecraftVersion - the Minecraft version implemented
protocolVersion - the protocol version clients must use to join
apiVersion - the Fidorial API version, for instance 0.1.0
version - the full server version, for instance 26.3-build.42+0.1.0
buildNumber - the CI build number, empty for a local build

public record BuildSpecification(MinecraftVersion minecraftVersion, int protocolVersion, String apiVersion, String version, OptionalInt buildNumber) extends Record
The build of the running server.
Since:
0.1.0
  • Constructor Details

    • BuildSpecification

      public BuildSpecification(MinecraftVersion minecraftVersion, int protocolVersion, String apiVersion, String version, OptionalInt buildNumber)
      Creates an instance of a BuildSpecification record class.
      Parameters:
      minecraftVersion - the value for the minecraftVersion record component
      protocolVersion - the value for the protocolVersion record component
      apiVersion - the value for the apiVersion record component
      version - the value for the version record component
      buildNumber - the value for the buildNumber 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 the compare method from their corresponding wrapper classes.
      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.
    • minecraftVersion

      public MinecraftVersion minecraftVersion()
      Returns the value of the minecraftVersion record component.
      Returns:
      the value of the minecraftVersion record component
    • protocolVersion

      public int protocolVersion()
      Returns the value of the protocolVersion record component.
      Returns:
      the value of the protocolVersion record component
    • apiVersion

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

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

      public OptionalInt buildNumber()
      Returns the value of the buildNumber record component.
      Returns:
      the value of the buildNumber record component