Interface FlagChangeListener
-
public interface FlagChangeListener
An event listener that is notified when a feature flag's configuration has changed.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 thevariation
methods on the client.
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 useFlagChangeListener listenForChanges = event -> { System.out.println("a flag has changed: " + event.getKey()); }; client.getFlagTracker().addFlagChangeListener(listenForChanges);
FlagValueChangeListener
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
onFlagChange(FlagChangeEvent event)
The SDK calls this method when a feature flag's configuration has changed in some way.
-
-
-
Method Detail
-
onFlagChange
void onFlagChange(FlagChangeEvent event)
The SDK calls this method when a feature flag's configuration has changed in some way.- Parameters:
event
- the event parameters
-
-