Package com.launchdarkly.sdk.android
Class DataModel.Flag
java.lang.Object
com.launchdarkly.sdk.android.DataModel.Flag
- Enclosing class:
- DataModel
Represents the state of a feature flag evaluation received from LaunchDarkly.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic DataModel.Flag
deletedItemPlaceholder
(String key, int version) boolean
static DataModel.Flag
Deserializes a flag from JSON toDataModel.Flag
toJson()
toString()
-
Constructor Details
-
Flag
public Flag(@NonNull String key, @NonNull LDValue value, int version, @Nullable Integer flagVersion, @Nullable Integer variation, boolean trackEvents, boolean trackReason, @Nullable Long debugEventsUntilDate, @Nullable EvaluationReason reason, @Nullable String[] prerequisites) Constructs an instance, specifying all properties.- Parameters:
key
- the flag keyvalue
- the current valueversion
- a value that is incremented with each updateflagVersion
- the current flag version for analytics eventsvariation
- variation index of the resulttrackEvents
- true if full event tracking is enabledtrackReason
- true if events must include evaluation reasonsdebugEventsUntilDate
- non-null if debugging is enabledreason
- evaluation reason of the result, or null if not availableprerequisites
- flag keys of prerequisites
-
-
Method Details
-
deletedItemPlaceholder
- Parameters:
key
- of the flagversion
- of the flag- Returns:
- a placeholder
DataModel.Flag
to represent a deleted flag
-
toString
-
equals
-
fromJson
Deserializes a flag from JSON toDataModel.Flag
- Parameters:
json
- to convert- Returns:
- the
DataModel.Flag
- Throws:
SerializationException
- if unable to deserialize
-
toJson
- Returns:
- JSON serialization of the flag
-