Skip to content

Commit 0eaf61b

Browse files
authored
fix: clean up all javadoc warnings (#426)
1 parent 3527724 commit 0eaf61b

20 files changed

+200
-33
lines changed

core-api/src/main/java/com/optimizely/ab/Optimizely.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1354,34 +1354,51 @@ public NotificationCenter getNotificationCenter() {
13541354

13551355
/**
13561356
* Convenience method for adding DecisionNotification Handlers
1357+
*
1358+
* @param handler DicisionNotification handler
1359+
* @return A handler Id (greater than 0 if succeeded)
13571360
*/
13581361
public int addDecisionNotificationHandler(NotificationHandler<DecisionNotification> handler) {
13591362
return addNotificationHandler(DecisionNotification.class, handler);
13601363
}
13611364

13621365
/**
13631366
* Convenience method for adding TrackNotification Handlers
1367+
*
1368+
* @param handler TrackNotification handler
1369+
* @return A handler Id (greater than 0 if succeeded)
13641370
*/
13651371
public int addTrackNotificationHandler(NotificationHandler<TrackNotification> handler) {
13661372
return addNotificationHandler(TrackNotification.class, handler);
13671373
}
13681374

13691375
/**
13701376
* Convenience method for adding UpdateConfigNotification Handlers
1377+
*
1378+
* @param handler UpdateConfigNotification handler
1379+
* @return A handler Id (greater than 0 if succeeded)
13711380
*/
13721381
public int addUpdateConfigNotificationHandler(NotificationHandler<UpdateConfigNotification> handler) {
13731382
return addNotificationHandler(UpdateConfigNotification.class, handler);
13741383
}
13751384

13761385
/**
13771386
* Convenience method for adding LogEvent Notification Handlers
1387+
*
1388+
* @param handler NotificationHandler handler
1389+
* @return A handler Id (greater than 0 if succeeded)
13781390
*/
13791391
public int addLogEventNotificationHandler(NotificationHandler<LogEvent> handler) {
13801392
return addNotificationHandler(LogEvent.class, handler);
13811393
}
13821394

13831395
/**
13841396
* Convenience method for adding NotificationHandlers
1397+
*
1398+
* @param clazz The class of NotificationHandler
1399+
* @param handler NotificationHandler handler
1400+
* @param <T> This is the type parameter
1401+
* @return A handler Id (greater than 0 if succeeded)
13851402
*/
13861403
public <T> int addNotificationHandler(Class<T> clazz, NotificationHandler<T> handler) {
13871404
return notificationCenter.addNotificationHandler(clazz, handler);
@@ -1403,6 +1420,10 @@ public <T> int addNotificationHandler(Class<T> clazz, NotificationHandler<T> han
14031420
* .withEventHandler(eventHandler)
14041421
* .build();
14051422
* </pre>
1423+
*
1424+
* @param datafile A datafile
1425+
* @param eventHandler An EventHandler
1426+
* @return An Optimizely builder
14061427
*/
14071428
@Deprecated
14081429
public static Builder builder(@Nonnull String datafile,
@@ -1460,6 +1481,9 @@ public Builder withErrorHandler(ErrorHandler errorHandler) {
14601481
* method.
14611482
* {@link com.optimizely.ab.event.BatchEventProcessor.Builder#withEventHandler(com.optimizely.ab.event.EventHandler)} label}
14621483
* Please use that builder method instead.
1484+
*
1485+
* @param eventHandler An EventHandler
1486+
* @return An Optimizely builder
14631487
*/
14641488
@Deprecated
14651489
public Builder withEventHandler(EventHandler eventHandler) {
@@ -1469,6 +1493,9 @@ public Builder withEventHandler(EventHandler eventHandler) {
14691493

14701494
/**
14711495
* You can instantiate a BatchEventProcessor or a ForwardingEventProcessor or supply your own.
1496+
*
1497+
* @param eventProcessor An EventProcessor
1498+
* @return An Optimizely builder
14721499
*/
14731500
public Builder withEventProcessor(EventProcessor eventProcessor) {
14741501
this.eventProcessor = eventProcessor;

core-api/src/main/java/com/optimizely/ab/OptimizelyUserContext.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public Map<String, OptimizelyDecision> decideAll() {
155155
*
156156
* @param eventName The event name.
157157
* @param eventTags A map of event tag names to event tag values.
158-
* @throws UnknownEventTypeException
158+
* @throws UnknownEventTypeException when event type is unknown
159159
*/
160160
public void trackEvent(@Nonnull String eventName,
161161
@Nonnull Map<String, ?> eventTags) throws UnknownEventTypeException {
@@ -166,7 +166,7 @@ public void trackEvent(@Nonnull String eventName,
166166
* Track an event.
167167
*
168168
* @param eventName The event name.
169-
* @throws UnknownEventTypeException
169+
* @throws UnknownEventTypeException when event type is unknown
170170
*/
171171
public void trackEvent(@Nonnull String eventName) throws UnknownEventTypeException {
172172
trackEvent(eventName, Collections.emptyMap());

core-api/src/main/java/com/optimizely/ab/config/DatafileProjectConfig.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
*
3-
* Copyright 2016-2020, Optimizely and contributors
3+
* Copyright 2016-2021, Optimizely and contributors
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -278,7 +278,7 @@ private List<Experiment> aggregateGroupExperiments(List<Group> groups) {
278278
/**
279279
* Checks is attributeKey is reserved or not and if it exist in attributeKeyMapping
280280
*
281-
* @param attributeKey
281+
* @param attributeKey The attribute key
282282
* @return AttributeId corresponding to AttributeKeyMapping, AttributeKey when it's a reserved attribute and
283283
* null when attributeKey is equal to BOT_FILTERING_ATTRIBUTE key.
284284
*/
@@ -484,6 +484,7 @@ public Builder withDatafile(String datafile) {
484484

485485
/**
486486
* @return a {@link DatafileProjectConfig} instance given a JSON string datafile
487+
* @throws ConfigParseException when parsing datafile fails
487488
*/
488489
public ProjectConfig build() throws ConfigParseException {
489490
if (datafile == null) {

core-api/src/main/java/com/optimizely/ab/config/ProjectConfigUtils.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
*
3-
* Copyright 2016-2017, 2019, Optimizely and contributors
3+
* Copyright 2016-2017,2019,2021, Optimizely and contributors
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -26,6 +26,10 @@ public class ProjectConfigUtils {
2626

2727
/**
2828
* Helper method for creating convenience mappings from key to entity
29+
*
30+
* @param nameables The list of IdMapped entities
31+
* @param <T> This is the type parameter
32+
* @return The map of key to entity
2933
*/
3034
public static <T extends IdKeyMapped> Map<String, T> generateNameMapping(List<T> nameables) {
3135
Map<String, T> nameMapping = new HashMap<String, T>();
@@ -38,6 +42,10 @@ public static <T extends IdKeyMapped> Map<String, T> generateNameMapping(List<T>
3842

3943
/**
4044
* Helper method for creating convenience mappings from ID to entity
45+
*
46+
* @param nameables The list of IdMapped entities
47+
* @param <T> This is the type parameter
48+
* @return The map of ID to entity
4149
*/
4250
public static <T extends IdMapped> Map<String, T> generateIdMapping(List<T> nameables) {
4351
Map<String, T> nameMapping = new HashMap<String, T>();
@@ -50,6 +58,9 @@ public static <T extends IdMapped> Map<String, T> generateIdMapping(List<T> name
5058

5159
/**
5260
* Helper method for creating convenience mappings of ExperimentID to featureFlags it is included in.
61+
*
62+
* @param featureFlags The list of feture flags
63+
* @return The mapping of ExperimentID to featureFlags
5364
*/
5465
public static Map<String, List<String>> generateExperimentFeatureMapping(List<FeatureFlag> featureFlags) {
5566
Map<String, List<String>> experimentFeatureMap = new HashMap<>();

core-api/src/main/java/com/optimizely/ab/config/audience/AudienceIdCondition.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
*
3-
* Copyright 2018-2020, Optimizely and contributors
3+
* Copyright 2018-2021, Optimizely and contributors
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -45,7 +45,7 @@ public class AudienceIdCondition<T> implements Condition<T> {
4545
/**
4646
* Constructor used in json parsing to store the audienceId parsed from Experiment.audienceConditions.
4747
*
48-
* @param audienceId
48+
* @param audienceId The audience id
4949
*/
5050
@JsonCreator
5151
public AudienceIdCondition(String audienceId) {

core-api/src/main/java/com/optimizely/ab/config/audience/match/MatchRegistry.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
*
3-
* Copyright 2020, Optimizely and contributors
3+
* Copyright 2020-2021, Optimizely and contributors
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -72,8 +72,8 @@ public static Match getMatch(String name) throws UnknownMatchTypeException {
7272
* register registers a Match implementation with it's name.
7373
* NOTE: This does not check for existence so default implementations can
7474
* be overridden.
75-
* @param name
76-
* @param match
75+
* @param name The match name
76+
* @param match The match implementation
7777
*/
7878
public static void register(String name, Match match) {
7979
registry.put(name, match);

core-api/src/main/java/com/optimizely/ab/config/audience/match/SemanticVersion.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
*
3-
* Copyright 2020, Optimizely and contributors
3+
* Copyright 2020-2021, Optimizely and contributors
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -44,6 +44,11 @@ public SemanticVersion(String version) {
4444
/**
4545
* compare takes object inputs and coerces them into SemanticVersion objects before performing the comparison.
4646
* If the input values cannot be coerced then an {@link UnexpectedValueTypeException} is thrown.
47+
*
48+
* @param o1 The object to be compared
49+
* @param o2 The object to be compared to
50+
* @return The compare result
51+
* @throws UnexpectedValueTypeException when an error is detected while comparing
4752
*/
4853
public static int compare(Object o1, Object o2) throws UnexpectedValueTypeException {
4954
if (o1 instanceof String && o2 instanceof String) {

core-api/src/main/java/com/optimizely/ab/config/parser/ConfigParser.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
*
3-
* Copyright 2016-2017, Optimizely and contributors
3+
* Copyright 2016-2017,2021, Optimizely and contributors
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -33,14 +33,18 @@
3333
public interface ConfigParser {
3434

3535
/**
36-
* @param json the json to parse
37-
* @return generates a {@code ProjectConfig} configuration from the provided json
36+
* @param json The json to parse
37+
* @return The {@code ProjectConfig} configuration from the provided json
3838
* @throws ConfigParseException when there's an issue parsing the provided project config
3939
*/
4040
ProjectConfig parseProjectConfig(@Nonnull String json) throws ConfigParseException;
4141

4242
/**
4343
* OptimizelyJSON parsing
44+
*
45+
* @param src The OptimizelyJSON
46+
* @return The serialized String
47+
* @throws JsonParseException when parsing JSON fails
4448
*/
4549
String toJson(Object src) throws JsonParseException;
4650
<T> T fromJson(String json, Class<T> clazz) throws JsonParseException;

core-api/src/main/java/com/optimizely/ab/event/BatchEventProcessor.java

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
*
3-
* Copyright 2019, Optimizely and contributors
3+
* Copyright 2019,2021, Optimizely and contributors
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -246,6 +246,9 @@ public static class Builder {
246246

247247
/**
248248
* {@link EventHandler} implementation used to dispatch events to Optimizely.
249+
*
250+
* @param eventHandler The event handler
251+
* @return The BatchEventProcessor builder
249252
*/
250253
public Builder withEventHandler(EventHandler eventHandler) {
251254
this.eventHandler = eventHandler;
@@ -254,6 +257,9 @@ public Builder withEventHandler(EventHandler eventHandler) {
254257

255258
/**
256259
* EventQueue is the underlying BlockingQueue used to buffer events before being added to the batch payload.
260+
*
261+
* @param eventQueue The event queue
262+
* @return The BatchEventProcessor builder
257263
*/
258264
public Builder withEventQueue(BlockingQueue<Object> eventQueue) {
259265
this.eventQueue = eventQueue;
@@ -262,6 +268,9 @@ public Builder withEventQueue(BlockingQueue<Object> eventQueue) {
262268

263269
/**
264270
* BatchSize is the maximum number of events contained within a single event batch.
271+
*
272+
* @param batchSize The batch size
273+
* @return The BatchEventProcessor builder
265274
*/
266275
public Builder withBatchSize(Integer batchSize) {
267276
this.batchSize = batchSize;
@@ -271,6 +280,9 @@ public Builder withBatchSize(Integer batchSize) {
271280
/**
272281
* FlushInterval is the maximum duration, in milliseconds, that an event will remain in flight before
273282
* being flushed to the event dispatcher.
283+
*
284+
* @param flushInterval The flush interval
285+
* @return The BatchEventProcessor builder
274286
*/
275287
public Builder withFlushInterval(Long flushInterval) {
276288
this.flushInterval = flushInterval;
@@ -279,6 +291,9 @@ public Builder withFlushInterval(Long flushInterval) {
279291

280292
/**
281293
* ExecutorService used to execute the {@link EventConsumer} thread.
294+
*
295+
* @param executor The ExecutorService
296+
* @return The BatchEventProcessor builder
282297
*/
283298
public Builder withExecutor(ExecutorService executor) {
284299
this.executor = executor;
@@ -287,6 +302,10 @@ public Builder withExecutor(ExecutorService executor) {
287302

288303
/**
289304
* Timeout is the maximum time to wait for the EventProcessor to close.
305+
*
306+
* @param duration The max time to wait for the EventProcessor to close
307+
* @param timeUnit The time unit
308+
* @return The BatchEventProcessor builder
290309
*/
291310
public Builder withTimeout(long duration, TimeUnit timeUnit) {
292311
this.timeoutMillis = timeUnit.toMillis(duration);
@@ -295,6 +314,9 @@ public Builder withTimeout(long duration, TimeUnit timeUnit) {
295314

296315
/**
297316
* NotificationCenter used to notify when event batches are flushed.
317+
*
318+
* @param notificationCenter The NotificationCenter
319+
* @return The BatchEventProcessor builder
298320
*/
299321
public Builder withNotificationCenter(NotificationCenter notificationCenter) {
300322
this.notificationCenter = notificationCenter;

core-api/src/main/java/com/optimizely/ab/internal/ConditionUtils.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
*
3-
* Copyright 2018-2019, Optimizely and contributors
3+
* Copyright 2018-2019,2021, Optimizely and contributors
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -122,7 +122,9 @@ static public <T> Condition parseConditions(Class<T> clazz, Object object) throw
122122
/**
123123
* parse conditions using List and Map
124124
*
125+
* @param clazz the class of parsed condition
125126
* @param rawObjectList list of conditions
127+
* @param <T> This is the type parameter
126128
* @return audienceCondition
127129
*/
128130
static public <T> Condition parseConditions(Class<T> clazz, List<Object> rawObjectList) throws InvalidAudienceCondition {
@@ -183,7 +185,9 @@ static public String operand(Object object) {
183185
/**
184186
* Parse conditions from org.json.JsonArray
185187
*
188+
* @param clazz the class of parsed condition
186189
* @param conditionJson jsonArray to parse
190+
* @param <T> This is the type parameter
187191
* @return condition parsed from conditionJson.
188192
*/
189193
static public <T> Condition parseConditions(Class<T> clazz, org.json.JSONArray conditionJson) throws InvalidAudienceCondition {

core-api/src/main/java/com/optimizely/ab/internal/EventTagUtils.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
*
3-
* Copyright 2016-2019, Optimizely and contributors
3+
* Copyright 2016-2019,2021, Optimizely and contributors
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -29,8 +29,8 @@ public final class EventTagUtils {
2929
/**
3030
* Grab the revenue value from the event tags. "revenue" is a reserved keyword.
3131
*
32-
* @param eventTags
33-
* @return Long
32+
* @param eventTags The event tags
33+
* @return Long The revenue value
3434
*/
3535
public static Long getRevenueValue(@Nonnull Map<String, ?> eventTags) {
3636
Long eventValue = null;
@@ -51,6 +51,9 @@ public static Long getRevenueValue(@Nonnull Map<String, ?> eventTags) {
5151

5252
/**
5353
* Fetch the numeric metric value from event tags. "value" is a reserved keyword.
54+
*
55+
* @param eventTags The event tags
56+
* @return The numeric metric value
5457
*/
5558
public static Double getNumericValue(@Nonnull Map<String, ?> eventTags) {
5659
Double eventValue = null;

0 commit comments

Comments
 (0)