public interface FlagChangeListener
As described in FlagTracker.addFlagChangeListener(FlagChangeListener)
, this notification
does not mean that the flag now returns a different value for any particular user, only that it
may do so. LaunchDarkly feature flags can be configured to return a single value for all
users, or to have complex targeting behavior. To know what effect the change would have for any
given set of user properties, you would need to re-evaluate the flag by calling one of the
variation
methods on the client.
FlagChangeListener listenForChanges = event -> {
System.out.println("a flag has changed: " + event.getKey());
};
client.getFlagTracker().addFlagChangeListener(listenForChanges);
In simple use cases where you know that the flag configuration does not vary per user, or where you
know ahead of time what user properties you will evaluate the flag with, it may be more convenient
to use FlagValueChangeListener
.Modifier and Type | Method and Description |
---|---|
void |
onFlagChange(FlagChangeEvent event)
The SDK calls this method when a feature flag's configuration has changed in some way.
|
void onFlagChange(FlagChangeEvent event)
event
- the event parameters