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.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Buildcurrent()date()Returns the value of thedaterecord component.static StringdefaultDisplayString(Build.Type type, String hash, String date, String version) Returns the value of thedisplayStringrecord component.final booleanIndicates whether some other object is "equal to" this one.flavor()Returns the value of theflavorrecord component.hash()Returns the value of thehashrecord component.final inthashCode()Returns a hash code value for this object.booleanbooleanReturns the value of theisSnapshotrecord component.static StringminimumCompatString(IndexVersion minimumCompatible) Returns the value of theminIndexCompatVersionrecord component.Returns the value of theminWireCompatVersionrecord component.Get the version as considered at build timeReturns the value of thequalifierrecord component.static 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)
-
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 aBuildrecord class.- Parameters:
flavor- the value for theflavorrecord componenttype- the value for thetyperecord componenthash- the value for thehashrecord componentdate- the value for thedaterecord componentversion- the value for theversionrecord componentqualifier- the value for thequalifierrecord componentisSnapshot- the value for theisSnapshotrecord componentminWireCompatVersion- the value for theminWireCompatVersionrecord componentminIndexCompatVersion- the value for theminIndexCompatVersionrecord componentdisplayString- the value for thedisplayStringrecord component
-
-
Method Details
-
minimumCompatString
-
current
-
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() -
defaultDisplayString
public static String defaultDisplayString(Build.Type type, String hash, String date, String version) -
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 '=='. -
flavor
Returns the value of theflavorrecord component.- Returns:
- the value of the
flavorrecord component
-
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
-
version
Returns the value of theversionrecord component.- Returns:
- the value of the
versionrecord component
-
qualifier
Returns the value of thequalifierrecord component.- Returns:
- the value of the
qualifierrecord component
-
isSnapshot
public boolean isSnapshot()Returns the value of theisSnapshotrecord component.- Returns:
- the value of the
isSnapshotrecord component
-
minWireCompatVersion
Returns the value of theminWireCompatVersionrecord component.- Returns:
- the value of the
minWireCompatVersionrecord component
-
minIndexCompatVersion
Returns the value of theminIndexCompatVersionrecord component.- Returns:
- the value of the
minIndexCompatVersionrecord component
-
displayString
Returns the value of thedisplayStringrecord component.- Returns:
- the value of the
displayStringrecord component
-