java.lang.Object
java.lang.Record
org.elasticsearch.Build
public record Build(Build.Type type, String hash, String date, boolean isSnapshot, String version)
extends Record
Information about a build of Elasticsearch.
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
ConstructorDescriptionBuild
(Build.Type type, String hash, String date, boolean isSnapshot, String version) Creates an instance of aBuild
record class. -
Method Summary
Modifier and TypeMethodDescriptiondate()
Returns the value of thedate
record component.final boolean
Indicates whether some other object is "equal to" this one.hash()
Returns the value of thehash
record component.final int
hashCode()
Returns a hash code value for this object.boolean
Provides information about the intent of the buildboolean
Returns the value of theisSnapshot
record component.Get the version as considered at build timestatic Build
readBuild
(StreamInput in) toString()
Returns a string representation of this record class.type()
Returns the value of thetype
record component.version()
Returns the value of theversion
record component.static void
writeBuild
(Build build, StreamOutput out)
-
Field Details
-
CURRENT
The current build of Elasticsearch. Filled with information scanned at startup from the jar.
-
-
Constructor Details
-
Build
Creates an instance of aBuild
record class.- Parameters:
type
- the value for thetype
record componenthash
- the value for thehash
record componentdate
- the value for thedate
record componentisSnapshot
- the value for theisSnapshot
record componentversion
- the value for theversion
record component
-
-
Method Details
-
readBuild
- Throws:
IOException
-
writeBuild
- Throws:
IOException
-
qualifiedVersion
Get the version as considered at build timeOffers 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
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. -
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. -
equals
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 withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
type
Returns the value of thetype
record component.- Returns:
- the value of the
type
record component
-
hash
Returns the value of thehash
record component.- Returns:
- the value of the
hash
record component
-
date
Returns the value of thedate
record component.- Returns:
- the value of the
date
record component
-
isSnapshot
public boolean isSnapshot()Returns the value of theisSnapshot
record component.- Returns:
- the value of the
isSnapshot
record component
-
version
Returns the value of theversion
record component.- Returns:
- the value of the
version
record component
-