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
-
Fields inherited from class org.elasticsearch.cluster.routing.allocation.decider.Decision
ALWAYS, NO, THROTTLE, YES
-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Constructor Summary
Constructors Constructor Description Single()Single(Decision.Type type)Creates a newDecision.Singledecision of a given typeSingle(Decision.Type type, String label, String explanation, Object... explanationParams)Creates a newDecision.Singledecision of a given type
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object object)List<Decision>getDecisions()Return the list of all decisions that make up this decisionStringgetExplanation()Returns the explanation string, fully formatted.inthashCode()Stringlabel()Get the description label for this decision.StringtoString()XContentBuildertoXContent(XContentBuilder builder, ToXContent.Params params)Decision.Typetype()Get theDecision.Typeof this decisionvoidwriteTo(StreamOutput out)Write this into the StreamOutput.-
Methods inherited from class org.elasticsearch.cluster.routing.allocation.decider.Decision
readFrom, single
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentObject
isFragment
-
-
-
-
Constructor Detail
-
Single
public Single()
-
Single
public Single(Decision.Type type)
Creates a newDecision.Singledecision of a given type- Parameters:
type-Decision.Typeof the decision
-
Single
public Single(Decision.Type type, @Nullable String label, @Nullable String explanation, @Nullable Object... explanationParams)
Creates a newDecision.Singledecision of a given type- Parameters:
type-Decision.Typeof the decisionexplanation- An explanation of thisDecisionexplanationParams- A set of additional parameters
-
-
Method Detail
-
type
public Decision.Type type()
Description copied from class:DecisionGet theDecision.Typeof this decision- Specified by:
typein classDecision- Returns:
Decision.Typeof this decision
-
label
@Nullable public String label()
Description copied from class:DecisionGet the description label for this decision.
-
getDecisions
public List<Decision> getDecisions()
Description copied from class:DecisionReturn the list of all decisions that make up this decision- Specified by:
getDecisionsin classDecision
-
getExplanation
@Nullable public String getExplanation()
Returns the explanation string, fully formatted. Only formats the string once.- Specified by:
getExplanationin classDecision
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
- Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-
writeTo
public void writeTo(StreamOutput out) throws IOException
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
-