public class EvaluationOutcome
extends java.lang.Object
OfferEvaluationStage. Describes whether the evaluation passed or failed, and the
reason(s) why. Supports a nested tree of outcomes which describe any sub-evaluations which may have been performed
within the OfferEvaluationStage.| Modifier and Type | Class and Description |
|---|---|
static class |
EvaluationOutcome.Builder
Builder for constructor
EvaluationOutcome instances. |
| Modifier and Type | Method and Description |
|---|---|
static EvaluationOutcome.Builder |
fail(java.lang.Object source,
java.lang.String reasonFormat,
java.lang.Object... reasonArgs)
Returns a new failing outcome object with the provided descriptive reason.
|
java.util.Collection<EvaluationOutcome> |
getChildren()
Returns any nested outcomes which resulted in this decision.
|
java.util.Optional<MesosResource> |
getMesosResource() |
java.util.List<OfferRecommendation> |
getOfferRecommendations() |
java.lang.String |
getReason()
Returns the reason that this response is passing or failing.
|
java.lang.String |
getSource()
Returns the name of the object which produced this response.
|
boolean |
isPassing()
Returns whether this outcome was passing (
true) or failing (false). |
static EvaluationOutcome.Builder |
pass(java.lang.Object source,
java.util.Collection<OfferRecommendation> offerRecommendations,
java.lang.String reasonFormat,
java.lang.Object... reasonArgs)
Returns a new passing outcome object with the provided descriptive reason.
|
static EvaluationOutcome.Builder |
pass(java.lang.Object source,
java.lang.String reasonFormat,
java.lang.Object... reasonArgs)
Returns a new passing outcome object with the provided descriptive reason.
|
java.lang.String |
toString() |
public static EvaluationOutcome.Builder pass(java.lang.Object source, java.lang.String reasonFormat, java.lang.Object... reasonArgs)
source - the object which produced this outcome, whose class name will be labeled as the originreasonFormat - String.format(String, Object...) compatible format string describing the pass reasonreasonArgs - format arguments, if any, to apply against reasonFormatpublic static EvaluationOutcome.Builder pass(java.lang.Object source, java.util.Collection<OfferRecommendation> offerRecommendations, java.lang.String reasonFormat, java.lang.Object... reasonArgs)
source - the object which produced this outcome, whose class name will be labeled as the originofferRecommendations - the offer recommendations generated by the source, if anyreasonFormat - String.format(String, Object...) compatible format string describing the pass reasonreasonArgs - format arguments, if any, to apply against reasonFormatpublic static EvaluationOutcome.Builder fail(java.lang.Object source, java.lang.String reasonFormat, java.lang.Object... reasonArgs)
source - the object which produced this outcome, whose class name will be labeled as the originreasonFormat - String.format(String, Object...) compatible format string describing the fail reasonreasonArgs - format arguments, if any, to apply against reasonFormatpublic boolean isPassing()
true) or failing (false).public java.lang.String getSource()
public java.lang.String getReason()
public java.util.Collection<EvaluationOutcome> getChildren()
public java.util.Optional<MesosResource> getMesosResource()
public java.util.List<OfferRecommendation> getOfferRecommendations()
public java.lang.String toString()
toString in class java.lang.Object