Module org.elasticsearch.server
Record Class DataStreamFailureStore.Template
java.lang.Object
java.lang.Record
org.elasticsearch.cluster.metadata.DataStreamFailureStore.Template
- All Implemented Interfaces:
Writeable
,ToXContent
,ToXContentObject
- Enclosing class:
DataStreamFailureStore
public static record DataStreamFailureStore.Template(ResettableValue<Boolean> enabled)
extends Record
implements Writeable, ToXContentObject
This class is only used in template configuration. It wraps the fields of
DataStreamFailureStore
with ResettableValue
to allow a user to signal when they want to reset any previously encountered values during template composition. Furthermore, it
provides the method merge(Template, Template)
that dictates how two templates can be composed.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ConstructingObjectParser
<DataStreamFailureStore.Template, Void> Fields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS
-
Constructor Summary
ConstructorsConstructorDescriptionTemplate
(ResettableValue<Boolean> enabled) Creates an instance of aTemplate
record class. -
Method Summary
Modifier and TypeMethodDescriptionenabled()
Returns the value of theenabled
record component.final boolean
Indicates whether some other object is "equal to" this one.fromXContent
(XContentParser parser) final int
hashCode()
Returns a hash code value for this object.merge
(DataStreamFailureStore.Template ignored, DataStreamFailureStore.Template update) Returns a template which has the value of the initial template updated with the values of the update.read
(StreamInput in) toString()
Returns a string representation of this record class.toXContent
(XContentBuilder builder, ToXContent.Params params) Converts the template to XContent, depending on the XContent.Params set byResettableValue.hideResetValues(Params)
it may or may not display any explicit nulls when the value is to be reset.void
writeTo
(StreamOutput out) Write this into the StreamOutput.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
Field Details
-
PARSER
-
-
Constructor Details
-
Template
Creates an instance of aTemplate
record class.- Parameters:
enabled
- the value for theenabled
record component
-
-
Method Details
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in interfaceWriteable
- Throws:
IOException
-
read
- Throws:
IOException
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException Converts the template to XContent, depending on the XContent.Params set byResettableValue.hideResetValues(Params)
it may or may not display any explicit nulls when the value is to be reset.- Specified by:
toXContent
in interfaceToXContent
- Throws:
IOException
-
fromXContent
public static DataStreamFailureStore.Template fromXContent(XContentParser parser) throws IOException - Throws:
IOException
-
merge
public static DataStreamFailureStore.Template merge(DataStreamFailureStore.Template ignored, DataStreamFailureStore.Template update) Returns a template which has the value of the initial template updated with the values of the update. Note: for now it's a trivial composition because we have only one non-null field.- Returns:
- the composed template
-
toFailureStore
-
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. All components in this record class are compared withObjects::equals(Object,Object)
. -
enabled
Returns the value of theenabled
record component.- Returns:
- the value of the
enabled
record component
-