Class Decision.Single
java.lang.Object
org.elasticsearch.cluster.routing.allocation.decider.Decision
org.elasticsearch.cluster.routing.allocation.decider.Decision.Single
- All Implemented Interfaces:
Writeable
,ToXContent
,ToXContentObject
- Enclosing class:
- Decision
public static class Decision.Single extends Decision implements ToXContentObject
Simple class representing a single decision
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.cluster.routing.allocation.decider.Decision
Decision.Multi, Decision.Single, Decision.Type
Nested classes/interfaces inherited from interface org.elasticsearch.common.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
-
Constructor Summary
Constructors Constructor Description Single()
Single(Decision.Type type)
Creates a newDecision.Single
decision of a given typeSingle(Decision.Type type, java.lang.String label, java.lang.String explanation, java.lang.Object... explanationParams)
Creates a newDecision.Single
decision of a given type -
Method Summary
Modifier and Type Method Description boolean
equals(java.lang.Object object)
java.util.List<Decision>
getDecisions()
Return the list of all decisions that make up this decisionjava.lang.String
getExplanation()
Returns the explanation string, fully formatted.int
hashCode()
java.lang.String
label()
Get the description label for this decision.java.lang.String
toString()
XContentBuilder
toXContent(XContentBuilder builder, ToXContent.Params params)
Decision.Type
type()
Get theDecision.Type
of this decisionvoid
writeTo(StreamOutput out)
Write this into the StreamOutput.Methods inherited from class org.elasticsearch.cluster.routing.allocation.decider.Decision
readFrom, single
-
Constructor Details
-
Single
public Single() -
Single
Creates a newDecision.Single
decision of a given type- Parameters:
type
-Decision.Type
of the decision
-
Single
public Single(Decision.Type type, @Nullable java.lang.String label, @Nullable java.lang.String explanation, @Nullable java.lang.Object... explanationParams)Creates a newDecision.Single
decision of a given type- Parameters:
type
-Decision.Type
of the decisionexplanation
- An explanation of thisDecision
explanationParams
- A set of additional parameters
-
-
Method Details
-
type
Description copied from class:Decision
Get theDecision.Type
of this decision- Specified by:
type
in classDecision
- Returns:
Decision.Type
of this decision
-
label
Description copied from class:Decision
Get the description label for this decision. -
getDecisions
Description copied from class:Decision
Return the list of all decisions that make up this decision- Specified by:
getDecisions
in classDecision
-
getExplanation
Returns the explanation string, fully formatted. Only formats the string once.- Specified by:
getExplanation
in classDecision
-
equals
public boolean equals(java.lang.Object object)- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException- Specified by:
toXContent
in interfaceToXContent
- Throws:
java.io.IOException
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.
-