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
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBuild(Build.Type type, String hash, String date, boolean isSnapshot, String version) Creates an instance of aBuildrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondate()Returns the value of thedaterecord component.final booleanIndicates whether some other object is "equal to" this one.hash()Returns the value of thehashrecord component.final inthashCode()Returns a hash code value for this object.booleanProvides information about the intent of the buildbooleanReturns the value of theisSnapshotrecord component.Get the version as considered at build timestatic BuildreadBuild(StreamInput in) toString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.version()Returns the value of theversionrecord component.static voidwriteBuild(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 aBuildrecord class.- Parameters:
type- the value for thetyperecord componenthash- the value for thehashrecord componentdate- the value for thedaterecord componentisSnapshot- the value for theisSnapshotrecord componentversion- the value for theversionrecord 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
Versionfor 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 thetyperecord component.- Returns:
- the value of the
typerecord component
-
hash
Returns the value of thehashrecord component.- Returns:
- the value of the
hashrecord component
-
date
Returns the value of thedaterecord component.- Returns:
- the value of the
daterecord component
-
isSnapshot
public boolean isSnapshot()Returns the value of theisSnapshotrecord component.- Returns:
- the value of the
isSnapshotrecord component
-
version
Returns the value of theversionrecord component.- Returns:
- the value of the
versionrecord component
-