Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ private Components() {}
* Passing this to {@link LDConfig.Builder#applicationInfo(com.launchdarkly.sdk.android.integrations.ApplicationInfoBuilder)},
* after setting any desired properties on the builder, applies this configuration to the SDK.
* <pre><code>
* LDConfig config = new LDConfig.Builder()
* LDConfig config = new LDConfig.Builder(AutoEnvAttributes.Enabled)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it need to be LDConfig.Builder.AutoEnvAttributes.Disabled or is AutoEnvAttributes.Enabled fine?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example app (example/MainActivity.java) uses the short form with an import:

import com.launchdarkly.sdk.android.LDConfig.Builder.AutoEnvAttributes;
// ...
LDConfig ldConfig = new LDConfig.Builder(AutoEnvAttributes.Enabled)

Since these are Javadoc examples, the short form AutoEnvAttributes.Enabled is consistent with how users would write it after importing the enum.

That said, I'm happy to change all occurrences to LDConfig.Builder.AutoEnvAttributes.Enabled if you'd prefer the fully-qualified form for clarity in the doc examples — just let me know.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tanderson-ld I will leave this choice to you.

* .applicationInfo(
* Components.applicationInfo()
* .applicationId("authentication-service")
Expand All @@ -57,7 +57,7 @@ public static ApplicationInfoBuilder applicationInfo() {
* Passing this to {@link LDConfig.Builder#http(ComponentConfigurer)} applies this configuration
* to all HTTP/HTTPS requests made by the SDK.
* <pre><code>
* LDConfig config = new LDConfig.Builder()
* LDConfig config = new LDConfig.Builder(AutoEnvAttributes.Enabled)
* .http(
* Components.httpConfiguration()
* .connectTimeoutMillis(3000)
Expand All @@ -79,7 +79,7 @@ public static HttpConfigurationBuilder httpConfiguration() {
* Passing this to {@link LDConfig.Builder#events(ComponentConfigurer)} causes the SDK
* to discard all analytics events and not send them to LaunchDarkly, regardless of any other configuration.
* <pre><code>
* LDConfig config = new LDConfig.Builder()
* LDConfig config = new LDConfig.Builder(AutoEnvAttributes.Enabled)
* .events(Components.noEvents())
* .build();
* </code></pre>
Expand All @@ -100,7 +100,7 @@ public static ComponentConfigurer<EventProcessor> noEvents() {
* the connection, call this method to obtain a builder, change its properties with the
* {@link PollingDataSourceBuilder} methods, and pass it to {@link LDConfig.Builder#dataSource(ComponentConfigurer)}:
* <pre><code>
* LDConfig config = new LDConfig.Builder()
* LDConfig config = new LDConfig.Builder(AutoEnvAttributes.Enabled)
* .dataSource(Components.pollingDataSource().initialReconnectDelayMillis(500))
* .build();
* </code></pre>
Expand All @@ -122,7 +122,7 @@ public static PollingDataSourceBuilder pollingDataSource() {
* customize this behavior, call this method to obtain a builder, change its properties
* with the {@link EventProcessorBuilder} properties, and pass it to {@link LDConfig.Builder#events(ComponentConfigurer)}:
* <pre><code>
* LDConfig config = new LDConfig.Builder()
* LDConfig config = new LDConfig.Builder(AutoEnvAttributes.Enabled)
* .events(Components.sendEvents().capacity(500).flushIntervalMillis(2000))
* .build();
* </code></pre>
Expand All @@ -145,7 +145,7 @@ public static EventProcessorBuilder sendEvents() {
* Passing this to {@link LDConfig.Builder#serviceEndpoints(com.launchdarkly.sdk.android.integrations.ServiceEndpointsBuilder)},
* after setting any desired properties on the builder, applies this configuration to the SDK.
* <pre><code>
* LDConfig config = new LDConfig.Builder()
* LDConfig config = new LDConfig.Builder(AutoEnvAttributes.Enabled)
* .serviceEndpoints(
* Components.serviceEndpoints()
* .relayProxy("http://my-relay-hostname:80")
Expand All @@ -168,7 +168,7 @@ public static ServiceEndpointsBuilder serviceEndpoints() {
* the connection, call this method to obtain a builder, change its properties with the
* {@link StreamingDataSourceBuilder} methods, and pass it to {@link LDConfig.Builder#dataSource(ComponentConfigurer)}:
* <pre><code>
* LDConfig config = new LDConfig.Builder()
* LDConfig config = new LDConfig.Builder(AutoEnvAttributes.Enabled)
* .dataSource(Components.streamingDataSource().initialReconnectDelayMillis(500))
* .build();
* </code></pre>
Expand All @@ -189,7 +189,7 @@ public static StreamingDataSourceBuilder streamingDataSource() {
* after setting any desired hooks on the builder, applies this configuration to the SDK.
* <pre><code>
* List hooks = myCreateHooksFunc();
* LDConfig config = new LDConfig.Builder()
* LDConfig config = new LDConfig.Builder(AutoEnvAttributes.Enabled)
* .hooks(
* Components.hooks()
* .setHooks(hooks)
Expand All @@ -208,7 +208,7 @@ public static HooksConfigurationBuilder hooks() {
* after setting any desired plugins on the builder, applies this configuration to the SDK.
* <pre><code>
* List plugins = getPluginsFunc();
* LDConfig config = new LDConfig.Builder()
* LDConfig config = new LDConfig.Builder(AutoEnvAttributes.Enabled)
* .plugins(
* Components.plugins()
* .setPlugins(plugins)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* By default, the SDK sends logging to Timber. If you want to bypass Timber and use Android
* logging directly instead, use this class with {@link LDConfig.Builder#logAdapter(LDLogAdapter)}:
* <pre><code>
* LDConfig config = new LDConfig.Builder()
* LDConfig config = new LDConfig.Builder(AutoEnvAttributes.Enabled)
* .logAdapter(LDAndroidLogging.adapter())
* .build();
* </code></pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public boolean isAutoEnvAttributes() {
* A <a href="http://en.wikipedia.org/wiki/Builder_pattern">builder</a> that helps construct
* {@link LDConfig} objects. Builder calls can be chained, enabling the following pattern:
* <pre>
* LDConfig config = new LDConfig.Builder()
* LDConfig config = new LDConfig.Builder(AutoEnvAttributes.Enabled)
* .mobileKey("mobile-key")
* .evaluationReasons(true)
* .build();
Expand Down Expand Up @@ -315,7 +315,7 @@ public Builder secondaryMobileKeys(Map<String, String> secondaryMobileKeys) {
* This object is a configuration builder obtained from {@link Components#serviceEndpoints()},
* which has methods for setting each external endpoint to a custom URI.
* <pre><code>
* LDConfig config = new LDConfig.Builder().mobileKey("key")
* LDConfig config = new LDConfig.Builder(AutoEnvAttributes.Enabled).mobileKey("key")
* .serviceEndpoints(
* Components.serviceEndpoints().relayProxy("http://my-relay-proxy-host")
* );
Expand Down Expand Up @@ -359,15 +359,15 @@ public Builder applicationInfo(ApplicationInfoBuilder applicationInfoBuilder) {
* and completely disable all data sources.
* <pre><code>
* // Setting custom options when using streaming mode
* LDConfig config = new LDConfig.Builder()
* LDConfig config = new LDConfig.Builder(AutoEnvAttributes.Enabled)
* .dataSource(
* Components.streamingDataSource()
* .initialReconnectDelayMillis(100)
* )
* .build();
*
* // Using polling mode instead of streaming, and setting custom options for polling
* LDConfig config = new LDConfig.Builder()
* LDConfig config = new LDConfig.Builder(AutoEnvAttributes.Enabled)
* .dataSource(
* Components.pollingDataSource()
* .pollingIntervalMillis(60_000)
Expand Down Expand Up @@ -398,12 +398,12 @@ public Builder dataSource(ComponentConfigurer<DataSource> dataSourceConfigurer)
* and completely disable network requests.
* <pre><code>
* // Setting custom event processing options
* LDConfig config = new LDConfig.Builder()
* LDConfig config = new LDConfig.Builder(AutoEnvAttributes.Enabled)
* .events(Components.sendEvents().capacity(100))
* .build();
*
* // Disabling events
* LDConfig config = new LDConfig.Builder()
* LDConfig config = new LDConfig.Builder(AutoEnvAttributes.Enabled)
* .events(Components.noEvents())
* .build();
* </code></pre>
Expand Down Expand Up @@ -458,7 +458,7 @@ public Builder plugins(PluginsConfigurationBuilder pluginsConfiguration) {
* obtained from {@link Components#httpConfiguration()}, and has methods for setting individual
* HTTP-related properties.
* <pre><code>
* LDConfig config = new LDConfig.Builder()
* LDConfig config = new LDConfig.Builder(AutoEnvAttributes.Enabled)
* .http(Components.httpConfiguration().connectTimeoutMillis(5000))
* .build();
* </code></pre>
Expand Down Expand Up @@ -639,7 +639,7 @@ public Builder logAdapter(LDLogAdapter logAdapter) {
* {@link LDLogLevel#INFO}, meaning that {@code INFO}, {@code WARN}, and {@code ERROR} levels
* are enabled, but {@code DEBUG} is disabled. To enable {@code DEBUG} level as well:
* <pre><code>
* LDConfig config = new LDConfig.Builder()
* LDConfig config = new LDConfig.Builder(AutoEnvAttributes.Enabled)
* .logAdapter(LDAndroidLogging.adapter())
* .level(LDLogLevel.DEBUG)
* .build();
Expand All @@ -648,7 +648,7 @@ public Builder logAdapter(LDLogAdapter logAdapter) {
* Or, to raise the logging threshold so that only WARN and ERROR levels are enabled, and
* DEBUG and INFO are disabled:
* <pre><code>
* LDConfig config = new LDConfig.Builder()
* LDConfig config = new LDConfig.Builder(AutoEnvAttributes.Enabled)
* .logAdapter(LDAndroidLogging.adapter())
* .level(LDLogLevel.WARN)
* .build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static final class Adapter implements LDLogAdapter, LDLogAdapter.IsConfig
* SDK will never create a {@code DebugTree} and the application is responsible for
* doing so if desired.
* <pre><code>
* LDConfig config = new LDConfig.Builder()
* LDConfig config = new LDConfig.Builder(AutoEnvAttributes.Enabled)
* .mobileKey("mobile-key")
* .logAdapter(LDTimberLogging.adapter().autoPlantDebugTree(false))
* .build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* {@link Components#applicationInfo()}, change its properties with the methods of this class,
* and pass it to {@link com.launchdarkly.sdk.android.LDConfig.Builder#applicationInfo(ApplicationInfoBuilder)}:
* <pre><code>
* LDConfig config = new LDConfig.Builder()
* LDConfig config = new LDConfig.Builder(AutoEnvAttributes.Enabled)
* .applicationInfo(
* Components.applicationInfo()
* .applicationId("authentication-service")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* to customize this behavior, create a builder with {@link Components#sendEvents()}, change its
* properties with the methods of this class, and pass it to {@link Builder#events(ComponentConfigurer)}:
* <pre><code>
* LDConfig config = new LDConfig.Builder()
* LDConfig config = new LDConfig.Builder(AutoEnvAttributes.Enabled)
* .events(Components.sendEvents().capacity(500).flushIntervalMillis(2000))
* .build();
* </code></pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* <pre><code>
* List hooks = createSomeHooks();
* LDConfig config = new LDConfig.Builder()
* LDConfig config = new LDConfig.Builder(AutoEnvAttributes.Enabled)
* .hooks(
* Components.hooks()
* .setHooks(hooks)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* {@link Components#httpConfiguration()}, change its properties with the methods of this class,
* and pass it to {@link com.launchdarkly.sdk.android.LDConfig.Builder#http(ComponentConfigurer)}:
* <pre><code>
* LDConfig config = new LDConfig.Builder()
* LDConfig config = new LDConfig.Builder(AutoEnvAttributes.Enabled)
* .http(
* Components.httpConfiguration()
* .connectTimeoutMillis(3000)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* <pre><code>
* List plugins = getPluginsFunc();
* LDConfig config = new LDConfig.Builder()
* LDConfig config = new LDConfig.Builder(AutoEnvAttributes.Enabled)
* .plugins(
* Components.plugins()
* .setPlugins(plugins)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* options if desired with the methods of this class, and pass it to
* {@link Builder#dataSource(ComponentConfigurer)}:
* <pre><code>
* LDConfig config = new LDConfig.Builder()
* LDConfig config = new LDConfig.Builder(AutoEnvAttributes.Enabled)
* .dataSource(Components.pollingDataSource().pollIntervalMillis(30000))
* .build();
* </code></pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@
*
* <pre><code>
* // Example of specifying a Relay Proxy instance
* LDConfig config = new LDConfig.Builder()
* LDConfig config = new LDConfig.Builder(AutoEnvAttributes.Enabled)
* .serviceEndpoints(
* Components.serviceEndpoints()
* .relayProxy("http://my-relay-hostname:80")
* )
* .build();
*
* // Example of specifying a private LaunchDarkly instance
* LDConfig config = new LDConfig.Builder()
* LDConfig config = new LDConfig.Builder(AutoEnvAttributes.Enabled)
* .serviceEndpoints(
* Components.serviceEndpoints()
* .streaming("https://stream.mycompany.launchdarkly.com")
Expand Down Expand Up @@ -79,7 +79,7 @@ public abstract class ServiceEndpointsBuilder {
* (see {@link ServiceEndpointsBuilder}). If you are using the LaunchDarkly Relay Proxy,
* call {@link #relayProxy(URI)} instead.
* <pre><code>
* LDConfig config = new LDConfig.Builder()
* LDConfig config = new LDConfig.Builder(AutoEnvAttributes.Enabled)
* .serviceEndpoints(
* Components.serviceEndpoints()
* .streaming("https://stream.mycompany.launchdarkly.com")
Expand Down Expand Up @@ -113,7 +113,7 @@ public ServiceEndpointsBuilder events(String eventsBaseUri) {
* (see {@link ServiceEndpointsBuilder}). If you are using the LaunchDarkly Relay Proxy,
* call {@link #relayProxy(URI)} instead.
* <pre><code>
* LDConfig config = new LDConfig.Builder()
* LDConfig config = new LDConfig.Builder(AutoEnvAttributes.Enabled)
* .serviceEndpoints(
* Components.serviceEndpoints()
* .streaming("https://stream.mycompany.launchdarkly.com")
Expand Down Expand Up @@ -146,7 +146,7 @@ public ServiceEndpointsBuilder polling(String pollingBaseUri) {
* When using the LaunchDarkly Relay Proxy, the SDK only needs to know the single base URI
* of the Relay Proxy, which will provide all the proxied service endpoints.
* <pre><code>
* LDConfig config = new LDConfig.Builder()
* LDConfig config = new LDConfig.Builder(AutoEnvAttributes.Enabled)
* .serviceEndpoints(
* Components.serviceEndpoints()
* .relayProxy("http://my-relay-hostname:8080")
Expand Down Expand Up @@ -180,7 +180,7 @@ public ServiceEndpointsBuilder relayProxy(String relayProxyBaseUri) {
* (see {@link ServiceEndpointsBuilder}). If you are using the LaunchDarkly Relay Proxy,
* call {@link #relayProxy(URI)} instead.
* <pre><code>
* LDConfig config = new LDConfig.Builder()
* LDConfig config = new LDConfig.Builder(AutoEnvAttributes.Enabled)
* .serviceEndpoints(
* Components.serviceEndpoints()
* .streaming("https://stream.mycompany.launchdarkly.com")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* to customize the behavior of the connection, create a builder with {@link Components#streamingDataSource()},
* change its properties with the methods of this class, and pass it to {@link Builder#dataSource(ComponentConfigurer)}:
* <pre><code>
* LDConfig config = new LDConfig.Builder()
* LDConfig config = new LDConfig.Builder(AutoEnvAttributes.Enabled)
* .dataSource(Components.streamingDataSource().initialReconnectDelayMillis(500))
* .build();
* </code></pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* TestData td = TestData.dataSource();
* td.update(testData.flag("flag-key-1").booleanFlag().variation(true));
*
* LDConfig config = new LDConfig.Builder()
* LDConfig config = new LDConfig.Builder(AutoEnvAttributes.Enabled)
* .mobileKey("my-mobile-key")
* .dataSource(td)
* .build();
Expand Down
Loading