Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.

Commit ca35d98

Browse files
authored
Merge pull request #49 from launchdarkly/eb/javadoc-fixes
misc javadoc fixes
2 parents 2310855 + 7919ac2 commit ca35d98

File tree

11 files changed

+37
-79
lines changed

11 files changed

+37
-79
lines changed

src/main/java/com/launchdarkly/client/FeatureStore.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public interface FeatureStore extends Closeable {
1919
* null if the key is not associated or the associated object has
2020
* been deleted.
2121
*
22+
* @param <T> class of the object that will be returned
2223
* @param kind the kind of object to get
2324
* @param key the key whose associated object is to be returned
2425
* @return the object to which the specified key is mapped, or
@@ -30,6 +31,7 @@ public interface FeatureStore extends Closeable {
3031
/**
3132
* Returns a {@link java.util.Map} of all associated objects of a given kind.
3233
*
34+
* @param <T> class of the objects that will be returned in the map
3335
* @param kind the kind of objects to get
3436
* @return a map of all associated object.
3537
*/
@@ -49,6 +51,7 @@ public interface FeatureStore extends Closeable {
4951
* Deletes the object associated with the specified key, if it exists and its version
5052
* is less than or equal to the specified version.
5153
*
54+
* @param <T> class of the object to be deleted
5255
* @param kind the kind of object to delete
5356
* @param key the key of the object to be deleted
5457
* @param version the version for the delete operation
@@ -59,8 +62,9 @@ public interface FeatureStore extends Closeable {
5962
* Update or insert the object associated with the specified key, if its version
6063
* is less than or equal to the version specified in the argument object.
6164
*
65+
* @param <T> class of the object to be updated
6266
* @param kind the kind of object to update
63-
* @param item
67+
* @param item the object to update or insert
6468
*/
6569
<T extends VersionedData> void upsert(VersionedDataKind<T> kind, T item);
6670

src/main/java/com/launchdarkly/client/InMemoryFeatureStore.java

Lines changed: 3 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
import java.util.concurrent.locks.ReentrantReadWriteLock;
1010

1111
/**
12-
* A thread-safe, versioned store for {@link FeatureFlag} objects based on a
13-
* {@link HashMap}
12+
* A thread-safe, versioned store for {@link FeatureFlag} objects and related data based on a
13+
* {@link HashMap}.
1414
*/
1515
public class InMemoryFeatureStore implements FeatureStore {
1616
private static final Logger logger = LoggerFactory.getLogger(InMemoryFeatureStore.class);
@@ -19,17 +19,6 @@ public class InMemoryFeatureStore implements FeatureStore {
1919
private final Map<VersionedDataKind<?>, Map<String, VersionedData>> allData = new HashMap<>();
2020
private volatile boolean initialized = false;
2121

22-
23-
/**
24-
* Returns the {@link FeatureFlag} to which the specified key is mapped, or
25-
* null if the key is not associated or the associated {@link FeatureFlag} has
26-
* been deleted.
27-
*
28-
* @param key the key whose associated {@link FeatureFlag} is to be returned
29-
* @return the {@link FeatureFlag} to which the specified key is mapped, or
30-
* null if the key is not associated or the associated {@link FeatureFlag} has
31-
* been deleted.
32-
*/
3322
@Override
3423
public <T extends VersionedData> T get(VersionedDataKind<T> kind, String key) {
3524
try {
@@ -61,11 +50,6 @@ public <T extends VersionedData> T get(VersionedDataKind<T> kind, String key) {
6150
}
6251
}
6352

64-
/**
65-
* Returns a {@link java.util.Map} of all associated features.
66-
*
67-
* @return a map of all associated features.
68-
*/
6953
@Override
7054
public <T extends VersionedData> Map<String, T> all(VersionedDataKind<T> kind) {
7155
try {
@@ -85,13 +69,6 @@ public <T extends VersionedData> Map<String, T> all(VersionedDataKind<T> kind) {
8569
}
8670
}
8771

88-
89-
/**
90-
* Initializes (or re-initializes) the store with the specified set of features. Any existing entries
91-
* will be removed.
92-
*
93-
* @param features the features to set the store
94-
*/
9572
@SuppressWarnings("unchecked")
9673
@Override
9774
public void init(Map<VersionedDataKind<?>, Map<String, ? extends VersionedData>> allData) {
@@ -107,13 +84,6 @@ public void init(Map<VersionedDataKind<?>, Map<String, ? extends VersionedData>>
10784
}
10885
}
10986

110-
/**
111-
* Deletes the feature associated with the specified key, if it exists and its version
112-
* is less than or equal to the specified version.
113-
*
114-
* @param key the key of the feature to be deleted
115-
* @param version the version for the delete operation
116-
*/
11787
@Override
11888
public <T extends VersionedData> void delete(VersionedDataKind<T> kind, String key, int version) {
11989
try {
@@ -132,13 +102,6 @@ public <T extends VersionedData> void delete(VersionedDataKind<T> kind, String k
132102
}
133103
}
134104

135-
/**
136-
* Update or insert the feature associated with the specified key, if its version
137-
* is less than or equal to the version specified in the argument feature.
138-
*
139-
* @param key
140-
* @param feature
141-
*/
142105
@Override
143106
public <T extends VersionedData> void upsert(VersionedDataKind<T> kind, T item) {
144107
try {
@@ -158,11 +121,6 @@ public <T extends VersionedData> void upsert(VersionedDataKind<T> kind, T item)
158121
}
159122
}
160123

161-
/**
162-
* Returns true if this store has been initialized
163-
*
164-
* @return true if this store has been initialized
165-
*/
166124
@Override
167125
public boolean initialized() {
168126
return initialized;
@@ -171,7 +129,7 @@ public boolean initialized() {
171129
/**
172130
* Does nothing; this class does not have any resources to release
173131
*
174-
* @throws IOException
132+
* @throws IOException will never happen
175133
*/
176134
@Override
177135
public void close() throws IOException {

src/main/java/com/launchdarkly/client/LDClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ private JsonElement evaluate(String featureKey, LDUser user, JsonElement default
384384
* Closes the LaunchDarkly client event processing thread. This should only
385385
* be called on application shutdown.
386386
*
387-
* @throws IOException
387+
* @throws IOException if an exception is thrown by one of the underlying network services
388388
*/
389389
@Override
390390
public void close() throws IOException {

src/main/java/com/launchdarkly/client/LDConfig.java

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ Request.Builder getRequestBuilder(String sdkKey) {
136136
/**
137137
* A <a href="http://en.wikipedia.org/wiki/Builder_pattern">builder</a> that helps construct {@link com.launchdarkly.client.LDConfig} objects. Builder
138138
* calls can be chained, enabling the following pattern:
139-
* <p>
140139
* <pre>
141140
* LDConfig config = new LDConfig.Builder()
142141
* .connectTimeoutMillis(3)
@@ -227,7 +226,6 @@ public Builder stream(boolean stream) {
227226
/**
228227
* Set the connection timeout in seconds for the configuration. This is the time allowed for the underlying HTTP client to connect
229228
* to the LaunchDarkly server. The default is 2 seconds.
230-
* <p>
231229
* <p>Both this method and {@link #connectTimeoutMillis(int) connectTimeoutMillis} affect the same property internally.</p>
232230
*
233231
* @param connectTimeout the connection timeout in seconds
@@ -241,7 +239,6 @@ public Builder connectTimeout(int connectTimeout) {
241239
/**
242240
* Set the socket timeout in seconds for the configuration. This is the number of seconds between successive packets that the
243241
* client will tolerate before flagging an error. The default is 10 seconds.
244-
* <p>
245242
* <p>Both this method and {@link #socketTimeoutMillis(int) socketTimeoutMillis} affect the same property internally.</p>
246243
*
247244
* @param socketTimeout the socket timeout in seconds
@@ -255,7 +252,6 @@ public Builder socketTimeout(int socketTimeout) {
255252
/**
256253
* Set the connection timeout in milliseconds for the configuration. This is the time allowed for the underlying HTTP client to connect
257254
* to the LaunchDarkly server. The default is 2000 ms.
258-
* <p>
259255
* <p>Both this method and {@link #connectTimeout(int) connectTimeoutMillis} affect the same property internally.</p>
260256
*
261257
* @param connectTimeoutMillis the connection timeout in milliseconds
@@ -269,7 +265,6 @@ public Builder connectTimeoutMillis(int connectTimeoutMillis) {
269265
/**
270266
* Set the socket timeout in milliseconds for the configuration. This is the number of milliseconds between successive packets that the
271267
* client will tolerate before flagging an error. The default is 10,000 milliseconds.
272-
* <p>
273268
* <p>Both this method and {@link #socketTimeout(int) socketTimeoutMillis} affect the same property internally.</p>
274269
*
275270
* @param socketTimeoutMillis the socket timeout in milliseconds
@@ -312,7 +307,7 @@ public Builder capacity(int capacity) {
312307
* a proxy will not be used, and {@link LDClient} will connect to LaunchDarkly directly.
313308
* </p>
314309
*
315-
* @param host
310+
* @param host the proxy hostname
316311
* @return the builder
317312
*/
318313
public Builder proxyHost(String host) {
@@ -323,7 +318,7 @@ public Builder proxyHost(String host) {
323318
/**
324319
* Set the port to use for an HTTP proxy for making connections to LaunchDarkly. This is required for proxied HTTP connections.
325320
*
326-
* @param port
321+
* @param port the proxy port
327322
* @return the builder
328323
*/
329324
public Builder proxyPort(int port) {
@@ -335,7 +330,7 @@ public Builder proxyPort(int port) {
335330
* Sets the username for the optional HTTP proxy. Only used when {@link LDConfig.Builder#proxyPassword(String)}
336331
* is also called.
337332
*
338-
* @param username
333+
* @param username the proxy username
339334
* @return the builder
340335
*/
341336
public Builder proxyUsername(String username) {
@@ -347,7 +342,7 @@ public Builder proxyUsername(String username) {
347342
* Sets the password for the optional HTTP proxy. Only used when {@link LDConfig.Builder#proxyUsername(String)}
348343
* is also called.
349344
*
350-
* @param password
345+
* @param password the proxy password
351346
* @return the builder
352347
*/
353348
public Builder proxyPassword(String password) {
@@ -358,7 +353,7 @@ public Builder proxyPassword(String password) {
358353
/**
359354
* Deprecated. Only HTTP proxies are currently supported.
360355
*
361-
* @param unused
356+
* @param unused the proxy scheme
362357
* @return the builder
363358
*/
364359
@Deprecated
@@ -367,10 +362,10 @@ public Builder proxyScheme(String unused) {
367362
}
368363

369364
/**
370-
* Set whether this client should subscribe to the streaming API, or whether the LaunchDarkly daemon is in use
371-
* instead
365+
* Set whether this client should use the <a href="https://docs.launchdarkly.com/docs/the-relay-proxy">LaunchDarkly
366+
* relay</a> in daemon mode, versus subscribing to the streaming or polling API.
372367
*
373-
* @param useLdd
368+
* @param useLdd true to use the relay in daemon mode; false to use streaming or polling
374369
* @return the builder
375370
*/
376371
public Builder useLdd(boolean useLdd) {
@@ -381,7 +376,7 @@ public Builder useLdd(boolean useLdd) {
381376
/**
382377
* Set whether this client is offline.
383378
*
384-
* @param offline when set to true no calls to LaunchDarkly will be made.
379+
* @param offline when set to true no calls to LaunchDarkly will be made
385380
* @return the builder
386381
*/
387382
public Builder offline(boolean offline) {
@@ -390,10 +385,10 @@ public Builder offline(boolean offline) {
390385
}
391386

392387
/**
393-
* Set whether or not user attributes (other than the key) should be sent back to LaunchDarkly. If this is true, all
388+
* Set whether or not user attributes (other than the key) should be hidden from LaunchDarkly. If this is true, all
394389
* user attribute values will be private, not just the attributes specified in {@link #privateAttributeNames(String...)}. By default,
395390
* this is false.
396-
* @param allPrivate
391+
* @param allPrivate true if all user attributes should be private
397392
* @return the builder
398393
*/
399394
public Builder allAttributesPrivate(boolean allPrivate) {
@@ -406,7 +401,7 @@ public Builder allAttributesPrivate(boolean allPrivate) {
406401
* events. This differs from {@link offline} in that it only affects sending
407402
* analytics events, not streaming or polling for events from the server.
408403
*
409-
* @param sendEvents when set to false, no events will be sent to LaunchDarkly.
404+
* @param sendEvents when set to false, no events will be sent to LaunchDarkly
410405
* @return the builder
411406
*/
412407
public Builder sendEvents(boolean sendEvents) {
@@ -418,7 +413,7 @@ public Builder sendEvents(boolean sendEvents) {
418413
* Set the polling interval (when streaming is disabled). Values less than the default of
419414
* 30000 will be set to the default.
420415
*
421-
* @param pollingIntervalMillis rule update polling interval in milliseconds.
416+
* @param pollingIntervalMillis rule update polling interval in milliseconds
422417
* @return the builder
423418
*/
424419
public Builder pollingIntervalMillis(long pollingIntervalMillis) {
@@ -443,7 +438,6 @@ public Builder startWaitMillis(long startWaitMillis) {
443438
* Enable event sampling. When set to the default of zero, sampling is disabled and all events
444439
* are sent back to LaunchDarkly. When set to greater than zero, there is a 1 in
445440
* <code>samplingInterval</code> chance events will be will be sent.
446-
* <p>
447441
* <p>Example: if you want 5% sampling rate, set <code>samplingInterval</code> to 20.
448442
*
449443
* @param samplingInterval the sampling interval.

src/main/java/com/launchdarkly/client/LDCountryCode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2257,7 +2257,7 @@ public Assignment getAssignment()
22572257
* </p>
22582258
*
22592259
* <table border="1" style="border-collapse: collapse;" cellpadding="5" summary="">
2260-
* <tr bgcolor="#FF8C00">
2260+
* <tr style="background-color: #ff8c00;">
22612261
* <th>CountryCode</th>
22622262
* <th>Locale</th>
22632263
* </tr>

src/main/java/com/launchdarkly/client/LDUser.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,6 @@ public LDUser read(JsonReader in) throws IOException {
290290
/**
291291
* A <a href="http://en.wikipedia.org/wiki/Builder_pattern">builder</a> that helps construct {@link LDUser} objects. Builder
292292
* calls can be chained, enabling the following pattern:
293-
* <p>
294293
* <pre>
295294
* LDUser user = new LDUser.Builder("key")
296295
* .country("US")

src/main/java/com/launchdarkly/client/RedisFeatureStore.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -339,11 +339,6 @@ public <T extends VersionedData> void upsert(VersionedDataKind<T> kind, T item)
339339
}
340340
}
341341

342-
/**
343-
* Returns true if this store has been initialized
344-
*
345-
* @return true if this store has been initialized
346-
*/
347342
@Override
348343
public boolean initialized() {
349344
// The LoadingCache takes care of both coalescing multiple simultaneous requests and memoizing
@@ -355,7 +350,7 @@ public boolean initialized() {
355350
/**
356351
* Releases all resources associated with the store. The store must no longer be used once closed.
357352
*
358-
* @throws IOException
353+
* @throws IOException if an underlying service threw an exception
359354
*/
360355
public void close() throws IOException {
361356
logger.info("Closing LaunchDarkly RedisFeatureStore");

src/main/java/com/launchdarkly/client/RedisFeatureStoreBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public RedisFeatureStoreBuilder(URI uri, long cacheTimeSecs) {
5252
* @param host the hostname to connect to
5353
* @param port the port to connect to
5454
* @param cacheTimeSecs the cache time in seconds. See {@link RedisFeatureStoreBuilder#cacheTime(long, TimeUnit)} for more information.
55-
* @throws URISyntaxException
55+
* @throws URISyntaxException if the URI is not valid
5656
*/
5757
public RedisFeatureStoreBuilder(String scheme, String host, int port, long cacheTimeSecs) throws URISyntaxException {
5858
this.uri = new URI(scheme, null, host, port, null, null, null);
@@ -110,7 +110,7 @@ public RedisFeatureStoreBuilder asyncRefresh(boolean enabled) {
110110
/**
111111
* Optionally configures the namespace prefix for all keys stored in Redis.
112112
*
113-
* @param prefix
113+
* @param prefix the namespace prefix
114114
* @return the builder
115115
*/
116116
public RedisFeatureStoreBuilder prefix(String prefix) {

src/main/java/com/launchdarkly/client/TestFeatureStore.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,15 @@ public void setBooleanValue(String key, Boolean value) {
4444
* Turns a feature, identified by key, to evaluate to true for every user. If the feature rules already exist in the store then it will override it to be true for every {@link LDUser}.
4545
* If the feature rule is not currently in the store, it will create one that is true for every {@link LDUser}.
4646
*
47-
* @param key the key of the feature flag to evaluate to true.
47+
* @param key the key of the feature flag to evaluate to true
4848
*/
4949
public void setFeatureTrue(String key) {
5050
setBooleanValue(key, true);
5151
}
5252

5353
/**
5454
* @deprecated use {@link #setFeatureTrue(String key)}
55+
* @param key the feature key
5556
*/
5657
@Deprecated
5758
public void turnFeatureOn(String key) {
@@ -62,14 +63,15 @@ public void turnFeatureOn(String key) {
6263
* Turns a feature, identified by key, to evaluate to false for every user. If the feature rules already exist in the store then it will override it to be false for every {@link LDUser}.
6364
* If the feature rule is not currently in the store, it will create one that is false for every {@link LDUser}.
6465
*
65-
* @param key the key of the feature flag to evaluate to false.
66+
* @param key the key of the feature flag to evaluate to false
6667
*/
6768
public void setFeatureFalse(String key) {
6869
setBooleanValue(key, false);
6970
}
7071

7172
/**
7273
* @deprecated use {@link #setFeatureFalse(String key)}
74+
* @param key the feature key
7375
*/
7476
@Deprecated
7577
public void turnFeatureOff(String key) {

src/main/java/com/launchdarkly/client/UpdateProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public interface UpdateProcessor extends Closeable {
1414

1515
/**
1616
* Returns true once the client has been initialized and will never return false again.
17-
* @return
17+
* @return true if the client has been initialized
1818
*/
1919
boolean initialized();
2020

0 commit comments

Comments
 (0)