java.lang.Object
java.lang.Record
org.elasticsearch.health.Diagnosis
- Record Components:
definition
- The definition of the diagnosis (e.g. message, helpURL)affectedResources
- Optional list of "things" that are affected by this condition (e.g. shards, indices, or policies).
- All Implemented Interfaces:
ChunkedToXContent
public record Diagnosis(Diagnosis.Definition definition, List<Diagnosis.Resource> affectedResources)
extends Record
implements ChunkedToXContent
Details a potential issue that was diagnosed by a
HealthService
.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
Details a diagnosis - cause and a potential action that a user could take to clear an issue identified by aHealthService
.static class
Represents a type of affected resource, together with the resources/abstractions that are affected. -
Field Summary
Fields inherited from interface org.elasticsearch.common.xcontent.ChunkedToXContent
EMPTY
-
Constructor Summary
ConstructorsConstructorDescriptionDiagnosis
(Diagnosis.Definition definition, List<Diagnosis.Resource> affectedResources) Creates an instance of aDiagnosis
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theaffectedResources
record component.Returns the value of thedefinition
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.final String
toString()
Returns a string representation of this record class.Iterator
<? extends ToXContent> toXContentChunked
(ToXContent.Params outerParams) Create an iterator ofToXContent
chunks for a REST response.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.elasticsearch.common.xcontent.ChunkedToXContent
isFragment, toXContentChunked, toXContentChunkedV8
-
Constructor Details
-
Diagnosis
public Diagnosis(Diagnosis.Definition definition, @Nullable List<Diagnosis.Resource> affectedResources) Creates an instance of aDiagnosis
record class.- Parameters:
definition
- the value for thedefinition
record componentaffectedResources
- the value for theaffectedResources
record component
-
-
Method Details
-
toXContentChunked
Description copied from interface:ChunkedToXContent
Create an iterator ofToXContent
chunks for a REST response. Each chunk is serialized with the sameXContentBuilder
andToXContent.Params
, which is also the same as theToXContent.Params
passed as theparams
argument. For best results, all chunks should beO(1)
size. The last chunk in the iterator must always yield at least one byte of output. See alsoChunkedToXContentHelper
for some handy utilities.Note that chunked response bodies cannot send deprecation warning headers once transmission has started, so implementations must check for deprecated feature use before returning.
- Specified by:
toXContentChunked
in interfaceChunkedToXContent
- Returns:
- iterator over chunks of
ToXContent
-
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)
. -
definition
Returns the value of thedefinition
record component.- Returns:
- the value of the
definition
record component
-
affectedResources
Returns the value of theaffectedResources
record component.- Returns:
- the value of the
affectedResources
record component
-