public abstract class EvaluationReason
extends java.lang.Object
LDClientInterface.boolVariationDetail(String, LDUser, boolean)
.
Note that this is an enum-like class hierarchy rather than an enum, because some of the
possible reasons have their own properties. However, directly referencing the subclasses is
deprecated; in a future version only the EvaluationReason
base class will be visible,
and it has getter methods for all of the possible properties.
Modifier and Type | Class and Description |
---|---|
static class |
EvaluationReason.Error
Deprecated.
This type will be removed in a future version. Use
getKind() instead and check
for the EvaluationReason.Kind.ERROR value. |
static class |
EvaluationReason.ErrorKind
Enumerated type defining the possible values of
EvaluationReason.Error.getErrorKind() . |
static class |
EvaluationReason.Fallthrough
Deprecated.
This type will be removed in a future version. Use
getKind() instead and check
for the EvaluationReason.Kind.FALLTHROUGH value. |
static class |
EvaluationReason.Kind
Enumerated type defining the possible values of
getKind() . |
static class |
EvaluationReason.Off
Deprecated.
This type will be removed in a future version. Use
getKind() instead and check
for the EvaluationReason.Kind.OFF value. |
static class |
EvaluationReason.PrerequisiteFailed
Deprecated.
This type will be removed in a future version. Use
getKind() instead and check
for the EvaluationReason.Kind.PREREQUISITE_FAILED value. |
static class |
EvaluationReason.RuleMatch
Deprecated.
This type will be removed in a future version. Use
getKind() instead and check
for the EvaluationReason.Kind.RULE_MATCH value. |
static class |
EvaluationReason.TargetMatch
Deprecated.
This type will be removed in a future version. Use
getKind() instead and check
for the EvaluationReason.Kind.TARGET_MATCH value. |
Modifier | Constructor and Description |
---|---|
protected |
EvaluationReason(EvaluationReason.Kind kind) |
Modifier and Type | Method and Description |
---|---|
static EvaluationReason.Error |
error(EvaluationReason.ErrorKind errorKind)
Returns an instance whose
kind is EvaluationReason.Kind.ERROR . |
static EvaluationReason.Error |
exception(java.lang.Exception exception)
Returns an instance of
Error with the kind EvaluationReason.ErrorKind.EXCEPTION and an exception instance. |
static EvaluationReason.Fallthrough |
fallthrough()
Returns an instance whose
kind is EvaluationReason.Kind.FALLTHROUGH . |
EvaluationReason.ErrorKind |
getErrorKind()
An enumeration value indicating the general category of error, if the
kind is EvaluationReason.Kind.PREREQUISITE_FAILED . |
java.lang.Exception |
getException()
The exception that caused the error condition, if the
kind is
EvaluationReason.Kind.ERROR and the errorKind is EvaluationReason.ErrorKind.EXCEPTION . |
EvaluationReason.Kind |
getKind()
Returns an enum indicating the general category of the reason.
|
java.lang.String |
getPrerequisiteKey()
The key of the prerequisite flag that did not return the desired variation, if the
kind is EvaluationReason.Kind.PREREQUISITE_FAILED . |
java.lang.String |
getRuleId()
The unique identifier of the rule that was matched, if the
kind is
EvaluationReason.Kind.RULE_MATCH . |
int |
getRuleIndex()
The index of the rule that was matched (0 for the first rule in the feature flag),
if the
kind is EvaluationReason.Kind.RULE_MATCH . |
static EvaluationReason.Off |
off()
Returns an instance whose
kind is EvaluationReason.Kind.OFF . |
static EvaluationReason.PrerequisiteFailed |
prerequisiteFailed(java.lang.String prerequisiteKey)
Returns an instance whose
kind is EvaluationReason.Kind.PREREQUISITE_FAILED . |
static EvaluationReason.RuleMatch |
ruleMatch(int ruleIndex,
java.lang.String ruleId)
Returns an instance whose
kind is EvaluationReason.Kind.RULE_MATCH . |
static EvaluationReason.TargetMatch |
targetMatch()
Returns an instance whose
kind is EvaluationReason.Kind.TARGET_MATCH . |
java.lang.String |
toString() |
protected EvaluationReason(EvaluationReason.Kind kind)
public EvaluationReason.Kind getKind()
EvaluationReason.Kind
valuepublic int getRuleIndex()
kind
is EvaluationReason.Kind.RULE_MATCH
. Otherwise this returns -1.public java.lang.String getRuleId()
kind
is
EvaluationReason.Kind.RULE_MATCH
. Otherwise null
.
Unlike the rule index, this identifier will not change if other rules are added or deleted.
public java.lang.String getPrerequisiteKey()
kind
is EvaluationReason.Kind.PREREQUISITE_FAILED
. Otherwise null
.public EvaluationReason.ErrorKind getErrorKind()
kind
is EvaluationReason.Kind.PREREQUISITE_FAILED
. Otherwise null
.public java.lang.Exception getException()
kind
is
EvaluationReason.Kind.ERROR
and the errorKind
is EvaluationReason.ErrorKind.EXCEPTION
.
Otherwise null
.public java.lang.String toString()
toString
in class java.lang.Object
public static EvaluationReason.Off off()
kind
is EvaluationReason.Kind.OFF
.public static EvaluationReason.TargetMatch targetMatch()
kind
is EvaluationReason.Kind.TARGET_MATCH
.public static EvaluationReason.RuleMatch ruleMatch(int ruleIndex, java.lang.String ruleId)
kind
is EvaluationReason.Kind.RULE_MATCH
.ruleIndex
- the rule indexruleId
- the rule identifierpublic static EvaluationReason.PrerequisiteFailed prerequisiteFailed(java.lang.String prerequisiteKey)
kind
is EvaluationReason.Kind.PREREQUISITE_FAILED
.prerequisiteKey
- the flag key of the prerequisite that failedpublic static EvaluationReason.Fallthrough fallthrough()
kind
is EvaluationReason.Kind.FALLTHROUGH
.public static EvaluationReason.Error error(EvaluationReason.ErrorKind errorKind)
kind
is EvaluationReason.Kind.ERROR
.errorKind
- describes the type of errorpublic static EvaluationReason.Error exception(java.lang.Exception exception)
Error
with the kind EvaluationReason.ErrorKind.EXCEPTION
and an exception instance.exception
- the exception that caused the error