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 |
build()
Returns the configured
LDConfig object. |
LDConfig.Builder |
setAdditionalHeaders(java.util.Map<java.lang.String,java.lang.String> additionalHeaders)
Additional headers that should be added to all HTTP requests from SDK components to
LaunchDarkly services
|
LDConfig.Builder |
setBackgroundPollingIntervalMillis(int backgroundPollingIntervalMillis)
Sets how often the client will poll for flag updates when your application is in the background.
|
LDConfig.Builder |
setBaseUri(android.net.Uri baseUri)
Deprecated.
Please use
setPollUri(Uri) instead. |
LDConfig.Builder |
setConnectionTimeoutMillis(int connectionTimeoutMillis)
Sets the timeout when connecting to LaunchDarkly.
|
LDConfig.Builder |
setDiagnosticOptOut(boolean diagnosticOptOut)
Set to true to opt out of sending diagnostics data.
|
LDConfig.Builder |
setDiagnosticRecordingIntervalMillis(int diagnosticRecordingIntervalMillis)
Sets the interval at which periodic diagnostic data is sent.
|
LDConfig.Builder |
setDisableBackgroundUpdating(boolean disableBackgroundUpdating)
Sets whether feature flag updates should be disabled when your app is in the background.
|
LDConfig.Builder |
setEvaluationReasons(boolean evaluationReasons)
If enabled, LaunchDarkly will provide additional information about how flag values were
calculated.
|
LDConfig.Builder |
setEventsCapacity(int eventsCapacity)
Set the capacity of the event buffer.
|
LDConfig.Builder |
setEventsFlushIntervalMillis(int eventsFlushIntervalMillis)
Sets the maximum amount of time to wait in between sending analytics events to LaunchDarkly.
|
LDConfig.Builder |
setEventsUri(android.net.Uri eventsUri)
Set the events URI for sending analytics to LaunchDarkly.
|
LDConfig.Builder |
setInlineUsersInEvents(boolean inlineUsersInEvents)
If enabled, events to the server will be created containing the entire User object.
|
LDConfig.Builder |
setMaxCachedUsers(int maxCachedUsers)
Sets the maximum number of users to cache the flag values for locally in the device's
SharedPreferences.
|
LDConfig.Builder |
setMobileKey(java.lang.String mobileKey)
Sets the key for authenticating with LaunchDarkly.
|
LDConfig.Builder |
setOffline(boolean offline)
Disables all network calls from the LaunchDarkly client.
|
LDConfig.Builder |
setPollingIntervalMillis(int pollingIntervalMillis)
Sets the interval in between feature flag updates, when streaming mode is disabled.
|
LDConfig.Builder |
setPollUri(android.net.Uri pollUri)
Set the base URI for polling requests to LaunchDarkly.
|
LDConfig.Builder |
setPrivateAttributeNames(java.util.Set<java.lang.String> privateAttributeNames)
Marks a set of attributes private.
|
LDConfig.Builder |
setSecondaryMobileKeys(java.util.Map<java.lang.String,java.lang.String> secondaryMobileKeys)
Sets the secondary keys for authenticating to additional LaunchDarkly environments.
|
LDConfig.Builder |
setStream(boolean enabled)
Enables or disables real-time streaming flag updates.
|
LDConfig.Builder |
setStreamUri(android.net.Uri streamUri)
Set the stream URI for connecting to the flag update stream.
|
LDConfig.Builder |
setUseReport(boolean useReport)
Sets the flag for choosing the REPORT api call.
|
LDConfig.Builder |
setWrapperName(java.lang.String wrapperName)
For use by wrapper libraries to set an identifying name for the wrapper being used.
|
LDConfig.Builder |
setWrapperVersion(java.lang.String wrapperVersion)
For use by wrapper libraries to report the version of the library in use.
|
public LDConfig.Builder allAttributesPrivate()
setPrivateAttributeNames(Set)
.public LDConfig.Builder setPrivateAttributeNames(java.util.Set<java.lang.String> privateAttributeNames)
LDUser.Builder
methods like
LDUser.Builder.privateName(String)
.privateAttributeNames
- a set of names that will be removed from user data sent to LaunchDarklypublic LDConfig.Builder setMobileKey(java.lang.String mobileKey)
mobileKey
- Get this from the LaunchDarkly web app under Team Settings.public LDConfig.Builder setSecondaryMobileKeys(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 setUseReport(boolean useReport)
useReport
- true if HTTP requests should use the REPORT verb@Deprecated public LDConfig.Builder setBaseUri(android.net.Uri baseUri)
setPollUri(Uri)
instead.baseUri
- the URI of the main LaunchDarkly servicepublic LDConfig.Builder setPollUri(android.net.Uri pollUri)
pollUri
- the URI of the main LaunchDarkly servicepublic LDConfig.Builder setEventsUri(android.net.Uri eventsUri)
eventsUri
- the URI of the LaunchDarkly analytics event servicepublic LDConfig.Builder setStreamUri(android.net.Uri streamUri)
streamUri
- the URI of the LaunchDarkly streaming servicepublic LDConfig.Builder setEventsCapacity(int eventsCapacity)
The default value is .
eventsCapacity
- the capacity of the event buffersetEventsFlushIntervalMillis(int)
public LDConfig.Builder setEventsFlushIntervalMillis(int eventsFlushIntervalMillis)
The default value is .
eventsFlushIntervalMillis
- the interval between event flushes, in millisecondssetEventsCapacity(int)
public LDConfig.Builder setConnectionTimeoutMillis(int connectionTimeoutMillis)
The default value is .
connectionTimeoutMillis
- the connection timeout, in millisecondspublic LDConfig.Builder setStream(boolean enabled)
enabled
- true if streaming should be enabledpublic LDConfig.Builder setPollingIntervalMillis(int pollingIntervalMillis)
setStream(boolean)
is set to true
. When set, it
will also change the default value for setEventsFlushIntervalMillis(int)
to the
same value.
The default value is LDConfig.DEFAULT_POLLING_INTERVAL_MILLIS
.
pollingIntervalMillis
- the feature flag polling interval, in millisecondspublic LDConfig.Builder setBackgroundPollingIntervalMillis(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 setDisableBackgroundUpdating(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 setOffline(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 setInlineUsersInEvents(boolean inlineUsersInEvents)
Defaults to false in order to reduce network bandwidth.
inlineUsersInEvents
- true if all user properties should be included in eventspublic LDConfig.Builder setEvaluationReasons(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 setDiagnosticOptOut(boolean diagnosticOptOut)
diagnosticOptOut
- true if you want to opt out of sending any diagnostics data.public LDConfig.Builder setDiagnosticRecordingIntervalMillis(int diagnosticRecordingIntervalMillis)
diagnosticRecordingIntervalMillis
- the diagnostics interval in millisecondsfor more information on the diagnostics data being sent.
public LDConfig.Builder setWrapperName(java.lang.String wrapperName)
wrapperName
- An identifying name for the wrapper librarypublic LDConfig.Builder setWrapperVersion(java.lang.String wrapperVersion)
setWrapperName(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 setMaxCachedUsers(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 setAdditionalHeaders(java.util.Map<java.lang.String,java.lang.String> additionalHeaders)
additionalHeaders
- A map of header keys to header values