Class FeatureFlagsState.Builder
- java.lang.Object
-
- com.launchdarkly.sdk.server.FeatureFlagsState.Builder
-
- Enclosing class:
- FeatureFlagsState
public static class FeatureFlagsState.Builder extends java.lang.Object
A builder for aFeatureFlagsState
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...)
.- Since:
- 5.6.0
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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)
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)
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 theFeatureFlagsState.isValid()
property.
-
-
-
Method Detail
-
valid
public FeatureFlagsState.Builder valid(boolean valid)
Sets theFeatureFlagsState.isValid()
property. This is true by default.- Parameters:
valid
- the new property value- Returns:
- the builder
-
add
public FeatureFlagsState.Builder add(java.lang.String flagKey, LDValue value, java.lang.Integer variationIndex, EvaluationReason reason, int flagVersion, boolean trackEvents, java.lang.Long debugEventsUntilDate)
Adds data to the builder representing the result of a feature flag evaluation.The
flagVersion
,trackEvents
, anddebugEventsUntilDate
parameters are normally generated internally by the SDK; they are used if theFeatureFlagsState
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.- Parameters:
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)- Returns:
- the builder
-
add
public 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)
Adds data to the builder representing the result of a feature flag evaluation.The
flagVersion
,trackEvents
, anddebugEventsUntilDate
parameters are normally generated internally by the SDK; they are used if theFeatureFlagsState
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.- Parameters:
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)- Returns:
- the builder
-
build
public FeatureFlagsState build()
Returns an object created from the builder state.- Returns:
- an immutable
FeatureFlagsState
-
-