public class FeatureFlagsState extends java.lang.Object implements JsonSerializable
LDClientInterface.allFlagsState(com.launchdarkly.sdk.LDUser, FlagsStateOption...).
LaunchDarkly defines a standard JSON encoding for this object, suitable for bootstrapping the LaunchDarkly JavaScript browser SDK. You can convert it to JSON in any of these ways:
JsonSerialization.
Gson instance with
LDGson.
ObjectMapper instance with
LDJackson.
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object other) |
EvaluationReason |
getFlagReason(java.lang.String key)
Returns the evaluation reason for an individual feature flag at the time the state was recorded.
|
LDValue |
getFlagValue(java.lang.String key)
Returns the value of an individual feature flag at the time the state was recorded.
|
int |
hashCode() |
boolean |
isValid()
Returns true if this object contains a valid snapshot of feature flag state, or false if the
state could not be computed (for instance, because the client was offline or there was no user).
|
java.util.Map<java.lang.String,LDValue> |
toValuesMap()
Returns a map of flag keys to flag values.
|
public boolean isValid()
public LDValue getFlagValue(java.lang.String key)
key - the feature flag keypublic EvaluationReason getFlagReason(java.lang.String key)
key - the feature flag keyEvaluationReason; null if reasons were not recorded, or if there was no such flagpublic java.util.Map<java.lang.String,LDValue> toValuesMap()
Do not use this method if you are passing data to the front end to "bootstrap" the JavaScript client.
Instead, serialize the FeatureFlagsState object to JSON using Gson.toJson() or Gson.toJsonTree().
public boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object