public static class FeatureFlagsState.Builder
extends java.lang.Object
FeatureFlagsState
instance.
Application code will not normally use this builder, since the SDK creates its own instances.
However, it may be useful in testing, to simulate values that might be returned by
LDClient.allFlagsState(com.launchdarkly.sdk.LDContext, FlagsStateOption...)
.
Modifier and Type | Method and Description |
---|---|
FeatureFlagsState.Builder |
add(java.lang.String flagKey,
LDValue value,
java.lang.Integer variationIndex,
EvaluationReason reason,
int flagVersion,
boolean trackEvents,
boolean trackReason,
java.lang.Long debugEventsUntilDate,
java.util.List<java.lang.String> prerequisites)
Adds data to the builder representing the result of a feature flag evaluation.
|
FeatureFlagsState.Builder |
add(java.lang.String flagKey,
LDValue value,
java.lang.Integer variationIndex,
EvaluationReason reason,
int flagVersion,
boolean trackEvents,
java.lang.Long debugEventsUntilDate,
java.util.List<java.lang.String> prerequisites)
Adds data to the builder representing the result of a feature flag evaluation.
|
FeatureFlagsState |
build()
Returns an object created from the builder state.
|
FeatureFlagsState.Builder |
valid(boolean valid)
Sets the
FeatureFlagsState.isValid() property. |
public FeatureFlagsState.Builder valid(boolean valid)
FeatureFlagsState.isValid()
property. This is true by default.valid
- the new property valuepublic FeatureFlagsState.Builder add(java.lang.String flagKey, LDValue value, java.lang.Integer variationIndex, EvaluationReason reason, int flagVersion, boolean trackEvents, java.lang.Long debugEventsUntilDate, java.util.List<java.lang.String> prerequisites)
The flagVersion
, trackEvents
, and debugEventsUntilDate
parameters are
normally generated internally by the SDK; they are used if the FeatureFlagsState
data
has been passed to front-end code, to control how analytics events are generated by the front
end. If you are using this builder in back-end test code, those values are unimportant.
flagKey
- the feature flag keyvalue
- the evaluated valuevariationIndex
- the evaluated variation indexreason
- the evaluation reasonflagVersion
- the current flag versiontrackEvents
- true if full event tracking is turned on for this flagdebugEventsUntilDate
- if set, event debugging is turned until this time (millisecond timestamp)prerequisites
- list of flag keys of the top level prerequisite flags evaluated as part of this evaluationpublic FeatureFlagsState.Builder add(java.lang.String flagKey, LDValue value, java.lang.Integer variationIndex, EvaluationReason reason, int flagVersion, boolean trackEvents, boolean trackReason, java.lang.Long debugEventsUntilDate, java.util.List<java.lang.String> prerequisites)
The flagVersion
, trackEvents
, and debugEventsUntilDate
parameters are
normally generated internally by the SDK; they are used if the FeatureFlagsState
data
has been passed to front-end code, to control how analytics events are generated by the front
end. If you are using this builder in back-end test code, those values are unimportant.
flagKey
- the feature flag keyvalue
- the evaluated valuevariationIndex
- the evaluated variation indexreason
- the evaluation reasonflagVersion
- the current flag versiontrackEvents
- true if full event tracking is turned on for this flagtrackReason
- true if evaluation reasons must be included due to experimentationdebugEventsUntilDate
- if set, event debugging is turned until this time (millisecond timestamp)prerequisites
- list of flag keys of the top level prerequisite flags evaluated as part of this evaluationpublic FeatureFlagsState build()
FeatureFlagsState