Class FlagValueChangeEvent
- java.lang.Object
-
- com.launchdarkly.sdk.server.interfaces.FlagChangeEvent
-
- com.launchdarkly.sdk.server.interfaces.FlagValueChangeEvent
-
public class FlagValueChangeEvent extends FlagChangeEvent
Parameter class used withFlagValueChangeListener
.This is not an analytics event to be sent to LaunchDarkly; it is a notification to the application.
-
-
Constructor Summary
Constructors Constructor Description FlagValueChangeEvent(java.lang.String key, LDValue oldValue, LDValue newValue)
Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LDValue
getNewValue()
Returns the new value of the flag for the specified evaluation context.LDValue
getOldValue()
Returns the last known value of the flag for the specified evaluation context prior to the update.-
Methods inherited from class com.launchdarkly.sdk.server.interfaces.FlagChangeEvent
getKey
-
-
-
-
Method Detail
-
getOldValue
public LDValue getOldValue()
Returns the last known value of the flag for the specified evaluation context prior to the update.Since flag values can be of any JSON data type, this is represented as
LDValue
. That class has methods for converting to a primitive Java type such asLDValue.booleanValue()
.If the flag did not exist before or could not be evaluated, this will be
LDValue.ofNull()
. Note that there is no application default value parameter as there is for thevariation
methods; it is up to your code to substitute whatever fallback value is appropriate.- Returns:
- the previous flag value
-
getNewValue
public LDValue getNewValue()
Returns the new value of the flag for the specified evaluation context.Since flag values can be of any JSON data type, this is represented as
LDValue
. That class has methods for converting to a primitive Java type suchLDValue.booleanValue()
.If the flag was deleted or could not be evaluated, this will be
LDValue.ofNull()
. Note that there is no application default value parameter as there is for thevariation
methods; it is up to your code to substitute whatever fallback value is appropriate.- Returns:
- the new flag value
-
-