java.lang.Object
java.lang.Record
org.elasticsearch.Build
public record Build(String flavor, Build.Type type, String hash, String date, boolean isSnapshot, String version, 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 Build
current()
date()
Returns the value of thedate
record component.static String
defaultDisplayString
(Build.Type type, String hash, String date, String version) Returns the value of thedisplayString
record component.final boolean
Indicates whether some other object is "equal to" this one.flavor()
Returns the value of theflavor
record component.hash()
Returns the value of thehash
record component.final int
hashCode()
Returns a hash code value for this object.boolean
boolean
Returns the value of theisSnapshot
record component.Returns the value of theminIndexCompatVersion
record component.Returns the value of theminWireCompatVersion
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)
-
Constructor Details
-
Build
public Build(String flavor, Build.Type type, String hash, String date, boolean isSnapshot, String version, String minWireCompatVersion, String minIndexCompatVersion, String displayString) Creates an instance of aBuild
record class.- Parameters:
flavor
- the value for theflavor
record componenttype
- 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 componentminWireCompatVersion
- the value for theminWireCompatVersion
record componentminIndexCompatVersion
- the value for theminIndexCompatVersion
record componentdisplayString
- the value for thedisplayString
record component
-
-
Method Details
-
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
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
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 theflavor
record component.- Returns:
- the value of the
flavor
record component
-
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
-
minWireCompatVersion
Returns the value of theminWireCompatVersion
record component.- Returns:
- the value of the
minWireCompatVersion
record component
-
minIndexCompatVersion
Returns the value of theminIndexCompatVersion
record component.- Returns:
- the value of the
minIndexCompatVersion
record component
-
displayString
Returns the value of thedisplayString
record component.- Returns:
- the value of the
displayString
record component
-