Module org.elasticsearch.server
Record Class Decision.Multi
java.lang.Object
java.lang.Record
org.elasticsearch.cluster.routing.allocation.decider.Decision.Multi
- All Implemented Interfaces:
Decision,Writeable,ToXContent,ToXContentFragment
- Enclosing interface:
Decision
public static record Decision.Multi(List<Decision.Single> decisions)
extends Record
implements Decision, ToXContentFragment
Simple class representing a list of decisions
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.cluster.routing.allocation.decider.Decision
Decision.Multi, Decision.Single, Decision.TypeNested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
Fields inherited from interface org.elasticsearch.cluster.routing.allocation.decider.Decision
ALWAYS, NO, THROTTLE, YESFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionMulti()Multi(List<Decision.Single> decisions) Creates an instance of aMultirecord class. -
Method Summary
Modifier and TypeMethodDescriptionAdd a decision to thisDecision.Multidecision instanceReturns the value of thedecisionsrecord component.final booleanIndicates whether some other object is "equal to" this one.Return the list of all decisions that make up this decisionGet the explanation for this decision.final inthashCode()Returns a hash code value for this object.label()Get the description label for this decision.toString()Returns a string representation of this record class.toXContent(XContentBuilder builder, ToXContent.Params params) type()Get theDecision.Typeof this decisionvoidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentFragment
isFragment
-
Constructor Details
-
Multi
public Multi() -
Multi
Creates an instance of aMultirecord class.- Parameters:
decisions- the value for thedecisionsrecord component
-
-
Method Details
-
add
Add a decision to thisDecision.Multidecision instance- Parameters:
decision-Decisionto add- Returns:
Decision.Multidecision instance with the given decision added
-
type
Description copied from interface:DecisionGet theDecision.Typeof this decision- Specified by:
typein interfaceDecision- Returns:
Decision.Typeof this decision
-
label
Description copied from interface:DecisionGet the description label for this decision. -
getExplanation
Description copied from interface:DecisionGet the explanation for this decision.- Specified by:
getExplanationin interfaceDecision
-
getDecisions
Description copied from interface:DecisionReturn the list of all decisions that make up this decision- Specified by:
getDecisionsin interfaceDecision
-
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. -
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
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). -
decisions
Returns the value of thedecisionsrecord component.- Returns:
- the value of the
decisionsrecord component
-