Class LDClient
- java.lang.Object
-
- com.launchdarkly.sdk.android.LDClient
-
- All Implemented Interfaces:
LDClientInterface
,java.io.Closeable
,java.lang.AutoCloseable
public class LDClient extends java.lang.Object implements LDClientInterface, java.io.Closeable
Client for accessing LaunchDarkly's Feature Flag system. This class enforces a singleton pattern. The main entry point is theinit(Application, LDConfig, LDContext)
method.Like all client-side LaunchDarkly SDKs, the
LDClient
always has a single currentLDContext
(evaluation context). You specify this context at initialization time, and you can change it later withidentify(LDContext)
. All subsequent calls to evaluation methods likeboolVariation(java.lang.String, boolean)
refer to the flag values for the current context.Normally, the SDK uses the exact context that you have specified in th
LDContext
. However, you can also tell the SDK to generate a randomized identifier and use this as the context'skey
; seeLDConfig.Builder.generateAnonymousKeys(boolean)
.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
LDClient(com.launchdarkly.sdk.android.PlatformState platformState, IEnvironmentReporter environmentReporter, com.launchdarkly.sdk.android.TaskExecutor taskExecutor, com.launchdarkly.sdk.android.PersistentDataStoreWrapper.PerEnvironmentData environmentStore, LDContext initialContext, LDConfig config, java.lang.String mobileKey, java.lang.String environmentName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,LDValue>
allFlags()
Returns a map of all feature flags for the current evaluation context.boolean
boolVariation(java.lang.String key, boolean defaultValue)
Returns the boolean value of a feature flag for the current evaluation context.EvaluationDetail<java.lang.Boolean>
boolVariationDetail(java.lang.String key, boolean defaultValue)
Returns the boolean value of a feature flag for the current evaluation context, along with information about how it was calculated.void
close()
Closes the client.double
doubleVariation(java.lang.String flagKey, double defaultValue)
Returns the double-precision floating-point numeric value of a feature flag for the current evaluation context.EvaluationDetail<java.lang.Double>
doubleVariationDetail(java.lang.String flagKey, double defaultValue)
Returns the double-precision floating-point numeric value of a feature flag for the current evaluation context, along with information about how it was calculated.void
flush()
Sends all pending events to LaunchDarkly.static LDClient
get()
Returns theLDClient
instance that was previously created withinit(Application, LDConfig, LDContext, int)
orinit(Application, LDConfig, LDContext)
.ConnectionInformation
getConnectionInformation()
Gets aConnectionInformation
object from the client representing the current state of the clients connection.static LDClient
getForMobileKey(java.lang.String keyName)
Returns theLDClient
instance that was previously created withinit(Application, LDConfig, LDContext, int)
orinit(Application, LDConfig, LDContext)
, for a specific environment.java.lang.String
getVersion()
Returns the version of the SDK, for instance "2.7.0".java.util.concurrent.Future<java.lang.Void>
identify(LDContext context)
Changes the current evaluation context, requests flags for that context from LaunchDarkly if we are online, and generates an analytics event to tell LaunchDarkly about the context.static java.util.concurrent.Future<LDClient>
init(android.app.Application application, LDConfig config, LDContext context)
Initializes the singleton/primary instance.static LDClient
init(android.app.Application application, LDConfig config, LDContext context, int startWaitSeconds)
Initializes the singleton instance and blocks for up tostartWaitSeconds
seconds until the client has been initialized.int
intVariation(java.lang.String key, int defaultValue)
Returns the integer value of a feature flag for the current evaluation context.EvaluationDetail<java.lang.Integer>
intVariationDetail(java.lang.String key, int defaultValue)
Returns the integer value of a feature flag for the current evaluation context, along with information about how it was calculated.boolean
isDisableBackgroundPolling()
Checks whetherLDConfig.Builder.disableBackgroundUpdating(boolean)
was set totrue
in the configuration.boolean
isInitialized()
Checks whether the client is ready to return feature flag values.boolean
isOffline()
Checks whether the client has been put into offline mode.LDValue
jsonValueVariation(java.lang.String key, LDValue defaultValue)
Returns the value of a feature flag for the current evaluation context, which may be of any type.EvaluationDetail<LDValue>
jsonValueVariationDetail(java.lang.String key, LDValue defaultValue)
Returns the value of a feature flag for the current evaluation context, which may be of any type, along with information about how it was calculated.void
registerAllFlagsListener(LDAllFlagsListener allFlagsListener)
Registers aLDAllFlagsListener
to be called when a flag update is processed by the SDK.void
registerFeatureFlagListener(java.lang.String flagKey, FeatureFlagChangeListener listener)
Registers aFeatureFlagChangeListener
to be called when theflagKey
changes from its current value.void
registerStatusListener(LDStatusListener statusListener)
Registers aLDStatusListener
to be called on connection status updates.void
setOffline()
Shuts down any network connections maintained by the client and puts the client in offline mode, preventing the client from opening new network connections untilsetOnline()
is called.void
setOnline()
Restores network connectivity for the client, if the client was previously in offline mode.java.lang.String
stringVariation(java.lang.String key, java.lang.String defaultValue)
Returns the string value of a feature flag for the current evaluation context.EvaluationDetail<java.lang.String>
stringVariationDetail(java.lang.String key, java.lang.String defaultValue)
Returns the string value of a feature flag for the current evaluation context, along with information about how it was calculated.void
track(java.lang.String eventName)
Tracks that an application-defined event occurred.void
trackData(java.lang.String eventName, LDValue data)
Tracks that an application-defined event occurred, and provides additional custom data.void
trackMetric(java.lang.String eventName, LDValue data, double metricValue)
Tracks that an application-defined event occurred, and provides an additional numeric value for custom metrics.void
unregisterAllFlagsListener(LDAllFlagsListener allFlagsListener)
Unregisters aLDAllFlagsListener
so it will no longer be called on flag updates.void
unregisterFeatureFlagListener(java.lang.String flagKey, FeatureFlagChangeListener listener)
Unregisters aFeatureFlagChangeListener
for theflagKey
.void
unregisterStatusListener(LDStatusListener statusListener)
Unregisters aLDStatusListener
so it will no longer be called on connection status updates.
-
-
-
Constructor Detail
-
LDClient
protected LDClient(@NonNull com.launchdarkly.sdk.android.PlatformState platformState, @NonNull IEnvironmentReporter environmentReporter, @NonNull com.launchdarkly.sdk.android.TaskExecutor taskExecutor, @NonNull com.launchdarkly.sdk.android.PersistentDataStoreWrapper.PerEnvironmentData environmentStore, @NonNull LDContext initialContext, @NonNull LDConfig config, @NonNull java.lang.String mobileKey, @NonNull java.lang.String environmentName) throws LaunchDarklyException
- Throws:
LaunchDarklyException
-
-
Method Detail
-
init
public static java.util.concurrent.Future<LDClient> init(@NonNull android.app.Application application, @NonNull LDConfig config, @NonNull LDContext context)
Initializes the singleton/primary instance. The result is aFuture
which will complete once the client has been initialized with the latest feature flag values. For immediate access to the Client (possibly with out of date feature flags), it is safe to ignore the return value of this method, and afterward callget()
If the client has already been initialized, is configured for offline mode, or the device is not connected to the internet, this method will return a
Future
that is already in the completed state.- Parameters:
application
- your Android applicationconfig
- configuration used to set up the clientcontext
- the initial evaluation context; seeLDClient
for more information about setting the context and optionally requesting a unique key for it- Returns:
- a
Future
which will complete once the client has been initialized - Since:
- 3.0.0
- See Also:
init(Application, LDConfig, LDContext, int)
-
init
public static LDClient init(android.app.Application application, LDConfig config, LDContext context, int startWaitSeconds)
Initializes the singleton instance and blocks for up tostartWaitSeconds
seconds until the client has been initialized. If the client does not initialize withinstartWaitSeconds
seconds, it is returned anyway and can be used, but may not have fetched the most recent feature flag values.- Parameters:
application
- your Android applicationconfig
- configuration used to set up the clientcontext
- the initial evaluation context; seeLDClient
for more information about setting the context and optionally requesting a unique key for itstartWaitSeconds
- maximum number of seconds to wait for the client to initialize- Returns:
- the primary LDClient instance
- Since:
- 3.0.0
- See Also:
init(Application, LDConfig, LDContext)
-
get
public static LDClient get() throws LaunchDarklyException
Returns theLDClient
instance that was previously created withinit(Application, LDConfig, LDContext, int)
orinit(Application, LDConfig, LDContext)
.If you have configured multiple environments, this method returns the instance for the primary environment.
- Returns:
- the singleton instance
- Throws:
LaunchDarklyException
- ifinit
has not been called- See Also:
getForMobileKey(String)
-
getForMobileKey
public static LDClient getForMobileKey(java.lang.String keyName) throws LaunchDarklyException
Returns theLDClient
instance that was previously created withinit(Application, LDConfig, LDContext, int)
orinit(Application, LDConfig, LDContext)
, for a specific environment.This method is only relevant if you have configured multiple environments with
LDConfig.Builder.secondaryMobileKeys(Map)
.- Parameters:
keyName
- the name you gave to this environment (this must be one of the keys in the map you passed toLDConfig.Builder.secondaryMobileKeys(Map)
)- Returns:
- the singleton instance for the environment associated with the given name
- Throws:
LaunchDarklyException
- ifinit
has not been called- See Also:
get()
-
trackMetric
public void trackMetric(java.lang.String eventName, LDValue data, double metricValue)
Description copied from interface:LDClientInterface
Tracks that an application-defined event occurred, and provides an additional numeric value for custom metrics.This method creates a "custom" analytics event containing the specified event name (key) the current evaluation context, optional custom data, and a numeric metric value.
Note that event delivery is asynchronous, so the event may not actually be sent until later; see
LDClientInterface.flush()
.- Specified by:
trackMetric
in interfaceLDClientInterface
- Parameters:
eventName
- the name of the eventdata
- anLDValue
containing additional data associated with the event; if not applicable, you may pass eithernull
orLDValue.ofNull()
metricValue
- a numeric value used by the LaunchDarkly experimentation feature in numeric custom metrics; this field will also be returned as part of the custom event for Data Export- See Also:
LDClientInterface.track(String)
,LDClientInterface.trackData(String, LDValue)
-
trackData
public void trackData(java.lang.String eventName, LDValue data)
Description copied from interface:LDClientInterface
Tracks that an application-defined event occurred, and provides additional custom data.This method creates a "custom" analytics event containing the specified event name (key) the current evaluation context, and optional custom data. To specify a numeric metric, use
LDClientInterface.trackMetric(String, LDValue, double)
instead.Note that event delivery is asynchronous, so the event may not actually be sent until later; see
LDClientInterface.flush()
.- Specified by:
trackData
in interfaceLDClientInterface
- Parameters:
eventName
- the name of the eventdata
- anLDValue
containing additional data associated with the event; if not applicable, you may pass eithernull
orLDValue.ofNull()
- See Also:
LDClientInterface.track(String)
,LDClientInterface.trackMetric(String, LDValue, double)
-
track
public void track(java.lang.String eventName)
Description copied from interface:LDClientInterface
Tracks that an application-defined event occurred.This method creates a "custom" analytics event containing the specified event name (key) and the current evaluation context. You may attach other data to the event by calling
LDClientInterface.trackData(String, LDValue)
orLDClientInterface.trackMetric(String, LDValue, double)
instead.Note that event delivery is asynchronous, so the event may not actually be sent until later; see
LDClientInterface.flush()
.- Specified by:
track
in interfaceLDClientInterface
- Parameters:
eventName
- the name of the event- See Also:
LDClientInterface.trackData(String, LDValue)
,LDClientInterface.trackMetric(String, LDValue, double)
-
identify
public java.util.concurrent.Future<java.lang.Void> identify(LDContext context)
Description copied from interface:LDClientInterface
Changes the current evaluation context, requests flags for that context from LaunchDarkly if we are online, and generates an analytics event to tell LaunchDarkly about the context.If the SDK is online, the returned
Future
is completed once the SDK has received feature flag values for the new context from LaunchDarkly, or received an unrecoverable error. If the SDK is offline, the returnedFuture
is completed immediately.The SDK normally caches flag settings for recently used evaluation contexts; this behavior can be configured with
LDConfig.Builder.maxCachedContexts(int)
.- Specified by:
identify
in interfaceLDClientInterface
- Parameters:
context
- the new evaluation context; seeLDClient
for more about setting the context and optionally requesting a unique key for it- Returns:
- a Future whose success indicates the flag values for the new evaluation context have been stored locally and are ready for use
-
allFlags
public java.util.Map<java.lang.String,LDValue> allFlags()
Description copied from interface:LDClientInterface
Returns a map of all feature flags for the current evaluation context. No events are sent to LaunchDarkly.- Specified by:
allFlags
in interfaceLDClientInterface
- Returns:
- a map of all feature flags
-
boolVariation
public boolean boolVariation(@NonNull java.lang.String key, boolean defaultValue)
Description copied from interface:LDClientInterface
Returns the boolean value of a feature flag for the current evaluation context.If the flag variation does not have a boolean value, or if an error makes it impossible to evaluate the flag (for instance, if
flagKey
does not match any existing flag),defaultValue
is returned.- Specified by:
boolVariation
in interfaceLDClientInterface
- Parameters:
key
- key for the flag to evaluatedefaultValue
- default value in case of errors evaluating the flag- Returns:
- value of the flag or the default value
-
boolVariationDetail
public EvaluationDetail<java.lang.Boolean> boolVariationDetail(@NonNull java.lang.String key, boolean defaultValue)
Description copied from interface:LDClientInterface
Returns the boolean value of a feature flag for the current evaluation context, along with information about how it was calculated.Note that this will only work if you have set
evaluationReasons
to true withLDConfig.Builder.evaluationReasons(boolean)
. Otherwise, thereason
property of the result will be null.The evaluation reason will also be included in analytics events, if you are capturing detailed event data for this flag.
- Specified by:
boolVariationDetail
in interfaceLDClientInterface
- Parameters:
key
- key for the flag to evaluatedefaultValue
- default value in case of errors evaluating the flag (seeLDClientInterface.boolVariation(String, boolean)
)- Returns:
- an
EvaluationDetail
object containing the value and other information
-
intVariation
public int intVariation(@NonNull java.lang.String key, int defaultValue)
Description copied from interface:LDClientInterface
Returns the integer value of a feature flag for the current evaluation context.If the flag variation has a numeric value that is not an integer, it is rounded toward zero.
If the flag variation does not have a numeric value, or if an error makes it impossible to evaluate the flag (for instance, if
flagKey
does not match any existing flag),defaultValue
is returned.- Specified by:
intVariation
in interfaceLDClientInterface
- Parameters:
key
- key for the flag to evaluatedefaultValue
- default value in case of errors evaluating the flag- Returns:
- value of the flag or the default value
-
intVariationDetail
public EvaluationDetail<java.lang.Integer> intVariationDetail(@NonNull java.lang.String key, int defaultValue)
Description copied from interface:LDClientInterface
Returns the integer value of a feature flag for the current evaluation context, along with information about how it was calculated.Note that this will only work if you have set
evaluationReasons
to true withLDConfig.Builder.evaluationReasons(boolean)
. Otherwise, thereason
property of the result will be null.The evaluation reason will also be included in analytics events, if you are capturing detailed event data for this flag.
The behavior is otherwise identical to
LDClientInterface.intVariation(java.lang.String, int)
.- Specified by:
intVariationDetail
in interfaceLDClientInterface
- Parameters:
key
- key for the flag to evaluatedefaultValue
- default value in case of errors evaluating the flag (seeLDClientInterface.intVariation(String, int)
)- Returns:
- an
EvaluationDetail
object containing the value and other information
-
doubleVariation
public double doubleVariation(java.lang.String flagKey, double defaultValue)
Description copied from interface:LDClientInterface
Returns the double-precision floating-point numeric value of a feature flag for the current evaluation context.If the flag variation does not have a numeric value, or if an error makes it impossible to evaluate the flag (for instance, if
flagKey
does not match any existing flag),defaultValue
is returned.- Specified by:
doubleVariation
in interfaceLDClientInterface
- Parameters:
flagKey
- key for the flag to evaluatedefaultValue
- default value in case of errors evaluating the flag- Returns:
- value of the flag or the default value
-
doubleVariationDetail
public EvaluationDetail<java.lang.Double> doubleVariationDetail(java.lang.String flagKey, double defaultValue)
Description copied from interface:LDClientInterface
Returns the double-precision floating-point numeric value of a feature flag for the current evaluation context, along with information about how it was calculated. Note that this will only work if you have setevaluationReasons
to true withLDConfig.Builder.evaluationReasons(boolean)
. Otherwise, thereason
property of the result will be null.The evaluation reason will also be included in analytics events, if you are capturing detailed event data for this flag.
The behavior is otherwise identical to
LDClientInterface.doubleVariation(java.lang.String, double)
.- Specified by:
doubleVariationDetail
in interfaceLDClientInterface
- Parameters:
flagKey
- key for the flag to evaluatedefaultValue
- default value in case of errors evaluating the flag (seeLDClientInterface.doubleVariation(String, double)
)- Returns:
- an
EvaluationDetail
object containing the value and other information.
-
stringVariation
public java.lang.String stringVariation(@NonNull java.lang.String key, java.lang.String defaultValue)
Description copied from interface:LDClientInterface
Returns the string value of a feature flag for the current evaluation context.If the flag variation does not have a string value, or if an error makes it impossible to evaluate the flag (for instance, if
flagKey
does not match any existing flag),defaultValue
is returned.- Specified by:
stringVariation
in interfaceLDClientInterface
- Parameters:
key
- key for the flag to evaluatedefaultValue
- default value in case of errors evaluating the flag- Returns:
- value of the flag or the default value
-
stringVariationDetail
public EvaluationDetail<java.lang.String> stringVariationDetail(@NonNull java.lang.String key, java.lang.String defaultValue)
Description copied from interface:LDClientInterface
Returns the string value of a feature flag for the current evaluation context, along with information about how it was calculated.Note that this will only work if you have set
evaluationReasons
to true withLDConfig.Builder.evaluationReasons(boolean)
. Otherwise, thereason
property of the result will be null.The evaluation reason will also be included in analytics events, if you are capturing detailed event data for this flag.
The behavior is otherwise identical to
LDClientInterface.stringVariation(java.lang.String, java.lang.String)
.- Specified by:
stringVariationDetail
in interfaceLDClientInterface
- Parameters:
key
- key for the flag to evaluatedefaultValue
- default value in case of errors evaluating the flag (seeLDClientInterface.stringVariation(String, String)
)- Returns:
- an
EvaluationDetail
object containing the value and other information.
-
jsonValueVariation
public LDValue jsonValueVariation(@NonNull java.lang.String key, LDValue defaultValue)
Description copied from interface:LDClientInterface
Returns the value of a feature flag for the current evaluation context, which may be of any type.The type
LDValue
is used to represent any of the value types that can exist in JSON. UseLDValue
methods to examine its type and value.- Specified by:
jsonValueVariation
in interfaceLDClientInterface
- Parameters:
key
- key for the flag to evaluatedefaultValue
- default value in case of errors evaluating the flag- Returns:
- value of the flag or the default value. Result will never be null, but may be LDValue#ofNull()
-
jsonValueVariationDetail
public EvaluationDetail<LDValue> jsonValueVariationDetail(@NonNull java.lang.String key, LDValue defaultValue)
Description copied from interface:LDClientInterface
Returns the value of a feature flag for the current evaluation context, which may be of any type, along with information about how it was calculated.The type
LDValue
is used to represent any of the value types that can exist in JSON. UseLDValue
methods to examine its type and value.Note that this will only work if you have set
evaluationReasons
to true withLDConfig.Builder.evaluationReasons(boolean)
. Otherwise, thereason
property of the result will be null.The evaluation reason will also be included in analytics events, if you are capturing detailed event data for this flag.
The behavior is otherwise identical to
LDClientInterface.jsonValueVariation(java.lang.String, com.launchdarkly.sdk.LDValue)
.- Specified by:
jsonValueVariationDetail
in interfaceLDClientInterface
- Parameters:
key
- key for the flag to evaluatedefaultValue
- default value in case of errors evaluating the flag (seeLDClientInterface.jsonValueVariation(String, LDValue)
)- Returns:
- an
EvaluationDetail
object containing the value and other information.
-
close
public void close() throws java.io.IOException
Closes the client. This should only be called at the end of a client's lifecycle.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
- declared by the Closeable interface, but will not be thrown by the client
-
flush
public void flush()
Description copied from interface:LDClientInterface
Sends all pending events to LaunchDarkly.- Specified by:
flush
in interfaceLDClientInterface
-
isInitialized
public boolean isInitialized()
Description copied from interface:LDClientInterface
Checks whether the client is ready to return feature flag values. This is true if either the client has successfully connected to LaunchDarkly and received feature flags, or the client has been put into offline mode (in which case it will return only default flag values).- Specified by:
isInitialized
in interfaceLDClientInterface
- Returns:
- true if the client is initialized or offline
-
isOffline
public boolean isOffline()
Description copied from interface:LDClientInterface
Checks whether the client has been put into offline mode. This is true only ifLDClientInterface.setOffline()
was called, or if the configuration hadLDConfig.Builder.offline(boolean)
set to true, not if the client is simply offline due to a loss of network connectivity.- Specified by:
isOffline
in interfaceLDClientInterface
- Returns:
- true if the client is in offline mode
-
setOffline
public void setOffline()
Description copied from interface:LDClientInterface
Shuts down any network connections maintained by the client and puts the client in offline mode, preventing the client from opening new network connections untilsetOnline()
is called.Note: The client automatically monitors the device's network connectivity and app foreground status, so calling
setOffline()
orsetOnline()
is normally unnecessary in most situations.- Specified by:
setOffline
in interfaceLDClientInterface
-
setOnline
public void setOnline()
Description copied from interface:LDClientInterface
Restores network connectivity for the client, if the client was previously in offline mode. This operation may be throttled if it is called too frequently.Note: The client automatically monitors the device's network connectivity and app foreground status, so calling
setOffline()
orsetOnline()
is normally unnecessary in most situations.- Specified by:
setOnline
in interfaceLDClientInterface
-
registerFeatureFlagListener
public void registerFeatureFlagListener(java.lang.String flagKey, FeatureFlagChangeListener listener)
Description copied from interface:LDClientInterface
Registers aFeatureFlagChangeListener
to be called when theflagKey
changes from its current value. If the feature flag is deleted, thelistener
will be unregistered.- Specified by:
registerFeatureFlagListener
in interfaceLDClientInterface
- Parameters:
flagKey
- the flag key to attach the listener tolistener
- the listener to attach to the flag key- See Also:
LDClientInterface.unregisterFeatureFlagListener(String, FeatureFlagChangeListener)
-
unregisterFeatureFlagListener
public void unregisterFeatureFlagListener(java.lang.String flagKey, FeatureFlagChangeListener listener)
Description copied from interface:LDClientInterface
Unregisters aFeatureFlagChangeListener
for theflagKey
.- Specified by:
unregisterFeatureFlagListener
in interfaceLDClientInterface
- Parameters:
flagKey
- the flag key to remove the listener fromlistener
- the listener to remove from the flag key- See Also:
LDClientInterface.registerFeatureFlagListener(String, FeatureFlagChangeListener)
-
isDisableBackgroundPolling
public boolean isDisableBackgroundPolling()
Description copied from interface:LDClientInterface
Checks whetherLDConfig.Builder.disableBackgroundUpdating(boolean)
was set totrue
in the configuration.- Specified by:
isDisableBackgroundPolling
in interfaceLDClientInterface
- Returns:
- true if background polling is disabled
-
getConnectionInformation
public ConnectionInformation getConnectionInformation()
Description copied from interface:LDClientInterface
Gets aConnectionInformation
object from the client representing the current state of the clients connection.- Specified by:
getConnectionInformation
in interfaceLDClientInterface
- Returns:
- An object representing the status of the connection to LaunchDarkly.
-
registerStatusListener
public void registerStatusListener(LDStatusListener statusListener)
Description copied from interface:LDClientInterface
Registers aLDStatusListener
to be called on connection status updates.- Specified by:
registerStatusListener
in interfaceLDClientInterface
- Parameters:
statusListener
- the listener to be called on a connection status update
-
unregisterStatusListener
public void unregisterStatusListener(LDStatusListener statusListener)
Description copied from interface:LDClientInterface
Unregisters aLDStatusListener
so it will no longer be called on connection status updates.- Specified by:
unregisterStatusListener
in interfaceLDClientInterface
- Parameters:
statusListener
- the listener to be removed
-
registerAllFlagsListener
public void registerAllFlagsListener(LDAllFlagsListener allFlagsListener)
Description copied from interface:LDClientInterface
Registers aLDAllFlagsListener
to be called when a flag update is processed by the SDK.- Specified by:
registerAllFlagsListener
in interfaceLDClientInterface
- Parameters:
allFlagsListener
- the listener to be called with a list of flag keys on a flag update
-
unregisterAllFlagsListener
public void unregisterAllFlagsListener(LDAllFlagsListener allFlagsListener)
Description copied from interface:LDClientInterface
Unregisters aLDAllFlagsListener
so it will no longer be called on flag updates.- Specified by:
unregisterAllFlagsListener
in interfaceLDClientInterface
- Parameters:
allFlagsListener
- the listener to be removed
-
getVersion
public java.lang.String getVersion()
Description copied from interface:LDClientInterface
Returns the version of the SDK, for instance "2.7.0".- Specified by:
getVersion
in interfaceLDClientInterface
- Returns:
- the version string
-
-