public static class LDConfig.Builder
extends java.lang.Object
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
LDConfig.Builder |
allAttributesPrivate()
Specifies that user attributes (other than the key) should be hidden from LaunchDarkly.
|
LDConfig.Builder |
autoAliasingOptOut(boolean autoAliasingOptOut)
Enable this opt-out to disable sending an automatic alias event when
LDClient.identify(LDUser) is
called with a non-anonymous user when the current user is anonymous. |
LDConfig.Builder |
backgroundPollingIntervalMillis(int backgroundPollingIntervalMillis)
Sets how often the client will poll for flag updates when your application is in the background.
|
LDConfig |
build()
Returns the configured
LDConfig object. |
LDConfig.Builder |
connectionTimeoutMillis(int connectionTimeoutMillis)
Sets the timeout when connecting to LaunchDarkly.
|
LDConfig.Builder |
diagnosticOptOut(boolean diagnosticOptOut)
Set to true to opt out of sending diagnostics data.
|
LDConfig.Builder |
diagnosticRecordingIntervalMillis(int diagnosticRecordingIntervalMillis)
Sets the interval at which periodic diagnostic data is sent.
|
LDConfig.Builder |
disableBackgroundUpdating(boolean disableBackgroundUpdating)
Sets whether feature flag updates should be disabled when your app is in the background.
|
LDConfig.Builder |
evaluationReasons(boolean evaluationReasons)
If enabled, LaunchDarkly will provide additional information about how flag values were
calculated.
|
LDConfig.Builder |
eventsCapacity(int eventsCapacity)
Set the capacity of the event buffer.
|
LDConfig.Builder |
eventsFlushIntervalMillis(int eventsFlushIntervalMillis)
Sets the maximum amount of time to wait in between sending analytics events to LaunchDarkly.
|
LDConfig.Builder |
eventsUri(android.net.Uri eventsUri)
Set the events URI for sending analytics to LaunchDarkly.
|
LDConfig.Builder |
headerTransform(LDHeaderUpdater headerTransform)
Provides a callback for dynamically modifying headers used on requests to the LaunchDarkly service.
|
LDConfig.Builder |
inlineUsersInEvents(boolean inlineUsersInEvents)
If enabled, events to the server will be created containing the entire User object.
|
LDConfig.Builder |
maxCachedUsers(int maxCachedUsers)
Sets the maximum number of users to cache the flag values for locally in the device's
SharedPreferences.
|
LDConfig.Builder |
mobileKey(java.lang.String mobileKey)
Sets the key for authenticating with LaunchDarkly.
|
LDConfig.Builder |
offline(boolean offline)
Disables all network calls from the LaunchDarkly client.
|
LDConfig.Builder |
pollingIntervalMillis(int pollingIntervalMillis)
Sets the interval in between feature flag updates, when streaming mode is disabled.
|
LDConfig.Builder |
pollUri(android.net.Uri pollUri)
Set the base URI for polling requests to LaunchDarkly.
|
LDConfig.Builder |
privateAttributes(UserAttribute... privateAttributes)
Marks a set of attributes private.
|
LDConfig.Builder |
secondaryMobileKeys(java.util.Map<java.lang.String,java.lang.String> secondaryMobileKeys)
Sets the secondary keys for authenticating to additional LaunchDarkly environments.
|
LDConfig.Builder |
stream(boolean enabled)
Enables or disables real-time streaming flag updates.
|
LDConfig.Builder |
streamUri(android.net.Uri streamUri)
Set the stream URI for connecting to the flag update stream.
|
LDConfig.Builder |
useReport(boolean useReport)
Sets the flag for choosing the REPORT api call.
|
LDConfig.Builder |
wrapperName(java.lang.String wrapperName)
For use by wrapper libraries to set an identifying name for the wrapper being used.
|
LDConfig.Builder |
wrapperVersion(java.lang.String wrapperVersion)
For use by wrapper libraries to report the version of the library in use.
|
public LDConfig.Builder allAttributesPrivate()
privateAttributes(UserAttribute...)
.public LDConfig.Builder privateAttributes(UserAttribute... privateAttributes)
LDUser.Builder
methods like
LDUser.Builder#privateName(String)
.privateAttributes
- a set of names that will be removed from user data sent to LaunchDarklypublic LDConfig.Builder mobileKey(java.lang.String mobileKey)
mobileKey
- Get this from the LaunchDarkly web app under Team Settings.public LDConfig.Builder secondaryMobileKeys(java.util.Map<java.lang.String,java.lang.String> secondaryMobileKeys)
secondaryMobileKeys
- A map of identifying names to unique mobile keys to access secondary environmentspublic LDConfig.Builder useReport(boolean useReport)
useReport
- true if HTTP requests should use the REPORT verbpublic LDConfig.Builder pollUri(android.net.Uri pollUri)
pollUri
- the URI of the main LaunchDarkly servicepublic LDConfig.Builder eventsUri(android.net.Uri eventsUri)
eventsUri
- the URI of the LaunchDarkly analytics event servicepublic LDConfig.Builder streamUri(android.net.Uri streamUri)
streamUri
- the URI of the LaunchDarkly streaming servicepublic LDConfig.Builder eventsCapacity(int eventsCapacity)
The default value is LDConfig.DEFAULT_EVENTS_CAPACITY
.
eventsCapacity
- the capacity of the event buffereventsFlushIntervalMillis(int)
public LDConfig.Builder eventsFlushIntervalMillis(int eventsFlushIntervalMillis)
The default value is LDConfig.DEFAULT_FLUSH_INTERVAL_MILLIS
.
eventsFlushIntervalMillis
- the interval between event flushes, in millisecondseventsCapacity(int)
public LDConfig.Builder connectionTimeoutMillis(int connectionTimeoutMillis)
The default value is LDConfig.DEFAULT_CONNECTION_TIMEOUT_MILLIS
.
connectionTimeoutMillis
- the connection timeout, in millisecondspublic LDConfig.Builder stream(boolean enabled)
enabled
- true if streaming should be enabledpublic LDConfig.Builder pollingIntervalMillis(int pollingIntervalMillis)
stream(boolean)
is set to true
. When set, it
will also change the default value for eventsFlushIntervalMillis(int)
to the
same value.
The default value is LDConfig.DEFAULT_POLLING_INTERVAL_MILLIS
.
pollingIntervalMillis
- the feature flag polling interval, in millisecondspublic LDConfig.Builder backgroundPollingIntervalMillis(int backgroundPollingIntervalMillis)
The default value is LDConfig.DEFAULT_BACKGROUND_POLLING_INTERVAL_MILLIS
.
backgroundPollingIntervalMillis
- the feature flag polling interval when in the background,
in millisecondspublic LDConfig.Builder disableBackgroundUpdating(boolean disableBackgroundUpdating)
The default value is false (flag updates will be done in the background).
disableBackgroundUpdating
- true if the client should skip updating flags when in the backgroundpublic LDConfig.Builder offline(boolean offline)
This can also be specified after the client has been created, using
LDClientInterface.setOffline()
.
The default value is true (the client will make network calls).
offline
- true if the client should run in offline modepublic LDConfig.Builder inlineUsersInEvents(boolean inlineUsersInEvents)
Defaults to false in order to reduce network bandwidth.
inlineUsersInEvents
- true if all user properties should be included in eventspublic LDConfig.Builder evaluationReasons(boolean evaluationReasons)
LDClientInterface.boolVariationDetail(String, boolean)
, etc.).
Since this increases the size of network requests, the default is false (detail
information will not be sent).evaluationReasons
- true if detail/reason information should be made availablepublic LDConfig.Builder diagnosticOptOut(boolean diagnosticOptOut)
diagnosticOptOut
- true if you want to opt out of sending any diagnostics data.public LDConfig.Builder diagnosticRecordingIntervalMillis(int diagnosticRecordingIntervalMillis)
diagnosticRecordingIntervalMillis
- the diagnostics interval in millisecondsfor more information on the diagnostics data being sent.
public LDConfig.Builder wrapperName(java.lang.String wrapperName)
wrapperName
- An identifying name for the wrapper librarypublic LDConfig.Builder wrapperVersion(java.lang.String wrapperVersion)
wrapperName(String)
this field will be ignored.
Otherwise the version string will be included in the User-Agent headers along with the
wrapperName during requests to the LaunchDarkly servers.wrapperVersion
- Version string for the wrapper librarypublic LDConfig.Builder maxCachedUsers(int maxCachedUsers)
Note that the active user is not considered part of this limit, as it will always be served from the backing SharedPreferences.
maxCachedUsers
- The maximum number of users to cache, negative values represent
allowing an unlimited number of cached users.public LDConfig.Builder autoAliasingOptOut(boolean autoAliasingOptOut)
LDClient.identify(LDUser)
is
called with a non-anonymous user when the current user is anonymous.autoAliasingOptOut
- Whether the automatic aliasing feature should be disabledpublic LDConfig.Builder headerTransform(LDHeaderUpdater headerTransform)
headerTransform
- the transformation to apply to requests