Class FeatureFlagsState

    • Method Detail

      • isValid

        public 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).
        Returns:
        true if the state is valid
      • getFlagValue

        public LDValue getFlagValue​(java.lang.String key)
        Returns the value of an individual feature flag at the time the state was recorded.
        Parameters:
        key - the feature flag key
        Returns:
        the flag's JSON value; LDValue.ofNull() if the flag returned the default value; null if there was no such flag
      • getFlagReason

        public EvaluationReason getFlagReason​(java.lang.String key)
        Returns the evaluation reason for an individual feature flag at the time the state was recorded.
        Parameters:
        key - the feature flag key
        Returns:
        an EvaluationReason; null if reasons were not recorded, or if there was no such flag
      • toValuesMap

        public java.util.Map<java.lang.String,​LDValue> toValuesMap()
        Returns a map of flag keys to flag values. If a flag would have evaluated to the default value, its value will be null.

        The returned map is unmodifiable.

        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().

        Returns:
        an immutable map of flag keys to JSON values
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object