Record Class Build

java.lang.Object
java.lang.Record
org.elasticsearch.Build

public record Build(String flavor, Build.Type type, String hash, String date, String version, String qualifier, boolean isSnapshot, String minWireCompatVersion, String minIndexCompatVersion, String displayString) extends Record
Information about a build of Elasticsearch.
  • Constructor Details

    • Build

      public Build(String flavor, Build.Type type, String hash, String date, String version, String qualifier, boolean isSnapshot, String minWireCompatVersion, String minIndexCompatVersion, String displayString)
      Creates an instance of a Build record class.
      Parameters:
      flavor - the value for the flavor record component
      type - the value for the type record component
      hash - the value for the hash record component
      date - the value for the date record component
      version - the value for the version record component
      qualifier - the value for the qualifier record component
      isSnapshot - the value for the isSnapshot record component
      minWireCompatVersion - the value for the minWireCompatVersion record component
      minIndexCompatVersion - the value for the minIndexCompatVersion record component
      displayString - the value for the displayString record component
  • Method Details

    • minimumCompatString

      public static String minimumCompatString(IndexVersion minimumCompatible)
    • current

      public static Build current()
    • readBuild

      public static Build readBuild(StreamInput in) throws IOException
      Throws:
      IOException
    • writeBuild

      public static void writeBuild(Build build, StreamOutput out) throws IOException
      Throws:
      IOException
    • qualifiedVersion

      public String qualifiedVersion()
      Get the version as considered at build time

      Offers a way to get the fully qualified version as configured by the build. This will be the same as Version for production releases, but may include on of the qualifier ( e.x alpha1 ) or -SNAPSHOT for others.

      Returns:
      the fully qualified build
    • isProductionRelease

      public boolean isProductionRelease()
    • defaultDisplayString

      public static String defaultDisplayString(Build.Type type, String hash, String date, String version)
    • toString

      public 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.
    • flavor

      public String flavor()
      Returns the value of the flavor record component.
      Returns:
      the value of the flavor record component
    • type

      public Build.Type type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • hash

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

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

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

      public String qualifier()
      Returns the value of the qualifier record component.
      Returns:
      the value of the qualifier record component
    • isSnapshot

      public boolean isSnapshot()
      Returns the value of the isSnapshot record component.
      Returns:
      the value of the isSnapshot record component
    • minWireCompatVersion

      public String minWireCompatVersion()
      Returns the value of the minWireCompatVersion record component.
      Returns:
      the value of the minWireCompatVersion record component
    • minIndexCompatVersion

      public String minIndexCompatVersion()
      Returns the value of the minIndexCompatVersion record component.
      Returns:
      the value of the minIndexCompatVersion record component
    • displayString

      public String displayString()
      Returns the value of the displayString record component.
      Returns:
      the value of the displayString record component