Show / Hide Table of Contents

Class EvaluationReason

Describes the reason that a flag evaluation produced a particular value.

Inheritance
System.Object
EvaluationReason
Implements
IJsonSerializable
Namespace: LaunchDarkly.Sdk
Assembly: LaunchDarkly.CommonSdk.dll
Syntax
public sealed class EvaluationReason : ValueType, IJsonSerializable
Remarks

For converting this type to or from JSON, see LaunchDarkly.Sdk.Json.

Properties

BigSegmentsStatus

Describes the validity of big segment information, if and only if the flag evaluation required querying at least one big segment. Otherwise it returns null.

Declaration
public Nullable<BigSegmentsStatus> BigSegmentsStatus { get; }
Property Value
Type Description
System.Nullable<BigSegmentsStatus>
Remarks

"Big segments" are a specific kind of user segments. For more information, read the LaunchDarkly documentation about user segments: https://docs.launchdarkly.com/home/users/big-segments

ErrorKind

Describes the type of error, if Kind is Error, otherwise null.

Declaration
public Nullable<EvaluationErrorKind> ErrorKind { get; }
Property Value
Type Description
System.Nullable<EvaluationErrorKind>

FallthroughReason

Returns an EvaluationReason of the kind Fallthrough.

Declaration
public static EvaluationReason FallthroughReason { get; }
Property Value
Type Description
EvaluationReason

InExperiment

Whether the evaluation was part of an experiment.

Declaration
public bool InExperiment { get; }
Property Value
Type Description
System.Boolean
Remarks

This is true if the evaluation resulted in an experiment rollout and served one of the variations in the experiment. Otherwise it is false.

Kind

An enum indicating the general category of the reason.

Declaration
public EvaluationReasonKind Kind { get; }
Property Value
Type Description
EvaluationReasonKind

OffReason

Returns an EvaluationReason of the kind Off.

Declaration
public static EvaluationReason OffReason { get; }
Property Value
Type Description
EvaluationReason

PrerequisiteKey

The key of the prerequisite flag that failed, if Kind is PrerequisiteFailed, otherwise null.

Declaration
public string PrerequisiteKey { get; }
Property Value
Type Description
System.String

RuleId

The unique identifier of the rule that was matched, or null if this is not a rule match.

Declaration
public string RuleId { get; }
Property Value
Type Description
System.String

RuleIndex

The index of the rule that was matched (0 for the first), or null if this is not a rule match.

Declaration
public Nullable<int> RuleIndex { get; }
Property Value
Type Description
System.Nullable<System.Int32>

TargetMatchReason

Returns an EvaluationReason of the kind TargetMatch.

Declaration
public static EvaluationReason TargetMatchReason { get; }
Property Value
Type Description
EvaluationReason

Methods

Equals(Object)

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
System.Object obj
Returns
Type Description
System.Boolean

ErrorReason(EvaluationErrorKind)

Returns an EvaluationReason of the kind Error.

Declaration
public static EvaluationReason ErrorReason(EvaluationErrorKind errorKind)
Parameters
Type Name Description
EvaluationErrorKind errorKind
Returns
Type Description
EvaluationReason

a reason descriptor

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32

PrerequisiteFailedReason(String)

Returns an EvaluationReason of the kind PrerequisiteFailed.

Declaration
public static EvaluationReason PrerequisiteFailedReason(string key)
Parameters
Type Name Description
System.String key

the key of the prerequisite flag

Returns
Type Description
EvaluationReason

a reason descriptor

RuleMatchReason(Int32, String)

Returns an EvaluationReason of the kind RuleMatch.

Declaration
public static EvaluationReason RuleMatchReason(int ruleIndex, string ruleId)
Parameters
Type Name Description
System.Int32 ruleIndex

the rule index

System.String ruleId

the unique rule ID

Returns
Type Description
EvaluationReason

a reason descriptor

ToString()

Declaration
public override string ToString()
Returns
Type Description
System.String

WithBigSegmentsStatus(Nullable<BigSegmentsStatus>)

Returns a copy of this EvaluationReason with a specific BigSegmentsStatus value added.

Declaration
public EvaluationReason WithBigSegmentsStatus(Nullable<BigSegmentsStatus> bigSegmentsStatus)
Parameters
Type Name Description
System.Nullable<BigSegmentsStatus> bigSegmentsStatus

the new property value

Returns
Type Description
EvaluationReason

a reason descriptor

WithInExperiment(Boolean)

Returns a new instance with the InExperiment property set to the specified value, if supported.

Declaration
public EvaluationReason WithInExperiment(bool inExperiment)
Parameters
Type Name Description
System.Boolean inExperiment

the desired value for the property

Returns
Type Description
EvaluationReason

a copy of this instance with the property modified

Remarks

Setting InExperiment is only allowed for Fallthrough and RuleMatch. For all other reason kinds, this has no effect.

Implements

IJsonSerializable
In This Article
Back to top Generated by DocFX