Class FeatureFlagsStateBuilder
A builder for constructing FeatureFlagsState instances.
Inherited Members
Namespace: LaunchDarkly.Sdk.Server
Assembly: LaunchDarkly.ServerSdk.dll
Syntax
public class FeatureFlagsStateBuilder
Remarks
This may be useful in test code. Use Builder(params FlagsStateOption[]) to create a new builder.
Methods
| Edit this page View SourceAddFlag(string, EvaluationDetail<LdValue>)
Adds the result of a flag evaluation.
Declaration
public FeatureFlagsStateBuilder AddFlag(string flagKey, EvaluationDetail<LdValue> result)
Parameters
| Type | Name | Description |
|---|---|---|
| string | flagKey | the flag key |
| EvaluationDetail<LdValue> | result | the evaluation result |
Returns
| Type | Description |
|---|---|
| FeatureFlagsStateBuilder |
Build()
Creates a FeatureFlagsState with the properties that have been set on the builder.
Declaration
public FeatureFlagsState Build()
Returns
| Type | Description |
|---|---|
| FeatureFlagsState | a state object |
Valid(bool)
Allows the state object to be marked as not valid (i.e. an error occurred, so flags could not be evaluated).
Declaration
public FeatureFlagsStateBuilder Valid(bool valid)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | valid | true if valid, false if invalid (default is valid) |
Returns
| Type | Description |
|---|---|
| FeatureFlagsStateBuilder | the same builder |