Record Class Build

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

public record Build(Build.Flavor flavor, Build.Type type, String hash, String date, boolean isSnapshot, String version) extends Record
Information about a build of Elasticsearch.
  • Field Details

    • CURRENT

      public static final Build CURRENT
      The current build of Elasticsearch. Filled with information scanned at startup from the jar.
  • Constructor Details

    • Build

      public Build(Build.Flavor flavor, Build.Type type, String hash, String date, boolean isSnapshot, String version)
      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
      isSnapshot - the value for the isSnapshot record component
      version - the value for the version record component
  • Method Details

    • 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()
      Provides information about the intent of the build
      Returns:
      true if the build is intended for production use
    • 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 Build.Flavor 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
    • isSnapshot

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

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