Skip to content

Commit 23d590e

Browse files
author
Marco
committed
minor javadoc changes
1 parent 2d8d0fd commit 23d590e

13 files changed

Lines changed: 55 additions & 24 deletions

src/com/brein/api/BreinActivity.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public String getBreinActivityType() {
5252
* Sets activity type
5353
*
5454
* @param breinActivityType to set
55+
* @return self
5556
*/
5657
public BreinActivity setBreinActivityType(final String breinActivityType) {
5758
this.breinActivityType = breinActivityType;
@@ -76,6 +77,7 @@ public String getBreinCategoryType() {
7677
* sets brein category
7778
*
7879
* @param breinCategoryType object
80+
* @return self
7981
*/
8082
public BreinActivity setBreinCategoryType(final String breinCategoryType) {
8183
this.breinCategoryType = breinCategoryType;
@@ -95,6 +97,7 @@ public String getDescription() {
9597
* sets the description
9698
*
9799
* @param description string to set as description
100+
* @return self
98101
*/
99102
public BreinActivity setDescription(final String description) {
100103
this.description = description;
@@ -153,6 +156,7 @@ public BreinActivity set(final Map<String, Object> dataActivityMap) {
153156
/**
154157
* sets the activity map
155158
*
159+
* @param key contains the key
156160
* @param dataActivityMap containing additional values
157161
* @return self
158162
*/

src/com/brein/api/BreinBase.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public class BreinBase implements ISecretStrategy {
5151
/**
5252
* returns the map for the base section
5353
*
54-
* @return map <String, Object>
54+
* @return map
5555
*/
5656
public Map<String, Object> getBase() {
5757
return baseMap;
@@ -79,6 +79,7 @@ public BreinConfig getConfig() {
7979
* sets the brein config
8080
*
8181
* @param breinConfig object
82+
* @return self
8283
*/
8384
public BreinBase setConfig(final BreinConfig breinConfig) {
8485
this.breinConfig = breinConfig;
@@ -96,9 +97,9 @@ public BreinUser getBreinUser() {
9697

9798
/**
9899
* sets the brein user
99-
* ~
100100
*
101101
* @param breinUser user data
102+
* @return self
102103
*/
103104
public BreinBase setBreinUser(final BreinUser breinUser) {
104105
this.breinUser = breinUser;
@@ -136,6 +137,7 @@ public long getUnixTimestamp() {
136137
* sets the timestamp
137138
*
138139
* @param unixTimestamp value from 1.1.1970
140+
* @return self
139141
*/
140142
public BreinBase setUnixTimestamp(final long unixTimestamp) {
141143
this.unixTimestamp = unixTimestamp;
@@ -192,6 +194,7 @@ public Function<String, Void> getErrorCallback() {
192194
* sets the error callback function
193195
*
194196
* @param errorCallback function to callback
197+
* @return self
195198
*/
196199
public BreinBase setErrorCallback(final Function<String, Void> errorCallback) {
197200
this.errorCallback = errorCallback;
@@ -210,10 +213,12 @@ public Gson getGson() {
210213
/**
211214
* sets an map for the base section
212215
*
213-
* @param baseMap map of <String, Object></String,>
216+
* @param baseMap map of String, Object
217+
* @return self
214218
*/
215-
public void setBase(final Map<String, Object> baseMap) {
219+
public BreinBase setBase(final Map<String, Object> baseMap) {
216220
this.baseMap = baseMap;
221+
return this;
217222
}
218223

219224
/**

src/com/brein/api/BreinLookup.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public BreinDimension getBreinDimension() {
3030
* sets the breindimension object - will be used for lookup
3131
*
3232
* @param breinDimension object to set
33+
* @return self
3334
*/
3435
public BreinLookup setBreinDimension(final BreinDimension breinDimension) {
3536
this.breinDimension = breinDimension;

src/com/brein/api/Breinify.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import java.util.function.Function;
1010

11-
/**
11+
/*
1212
* Static Implementation of Breinify activity & lookup calls
1313
*/
1414
public class Breinify {
@@ -168,7 +168,6 @@ public static void activity(final BreinUser user,
168168
* // invoke this method
169169
* Breinify.activity();
170170
* <p>
171-
* <p>
172171
* This request is asynchronous.
173172
*/
174173
public static void activity() {
@@ -307,19 +306,20 @@ public static BreinResult temporalData(final BreinTemporalData breinTemporalData
307306
* Sends a recommendation request to the engine utilizing the API. The call is done synchronously as a POST request. It is
308307
* important that a valid API-key is configured prior to using this function.
309308
*
310-
* @param breinRecommenationPara contains the brein recommendation object
309+
* @param breinRecommendationPara contains the brein recommendation object
310+
* @return BreinResult object
311311
*/
312-
public static BreinResult recommendation(final BreinRecommendation breinRecommenationPara) {
312+
public static BreinResult recommendation(final BreinRecommendation breinRecommendationPara) {
313313

314-
if (breinRecommenationPara == null) {
314+
if (breinRecommendationPara == null) {
315315
throw new BreinException("BreinRecommendation is null");
316316
}
317317

318318
// apply the current configuration
319-
breinRecommenationPara.setConfig(getBreinRecommendation().getConfig());
319+
breinRecommendationPara.setConfig(getBreinRecommendation().getConfig());
320320

321321
// create a clone in order to prevent concurrency issues
322-
final BreinRecommendation newBreinRecommendation = BreinRecommendation.clone(breinRecommenationPara);
322+
final BreinRecommendation newBreinRecommendation = BreinRecommendation.clone(breinRecommendationPara);
323323
return newBreinRecommendation.getBreinEngine().invokeRecommendation(newBreinRecommendation);
324324
}
325325

src/com/brein/api/BreinifyExecutor.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77

88
import java.util.function.Function;
99

10-
/**
11-
* Static Implementation of Breinify activity & lookup calls
12-
*/
10+
// Static Implementation of Breinify activity & lookup calls
1311
public class BreinifyExecutor {
1412

1513
/**

src/com/brein/domain/BreinConfig.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ public BreinConfig() {
149149

150150
/**
151151
* initializes the rest client
152+
* @return self
152153
*/
153154
public BreinConfig initEngine() {
154155
BreinEngineType engine = getRestEngineType();
@@ -299,6 +300,7 @@ public long getConnectionTimeout() {
299300
* set the connection timeout
300301
*
301302
* @param connectionTimeout value
303+
* @return self
302304
*/
303305
public BreinConfig setConnectionTimeout(final long connectionTimeout) {
304306
this.connectionTimeout = connectionTimeout;
@@ -318,6 +320,7 @@ public long getSocketTimeout() {
318320
* set the socket timeout
319321
*
320322
* @param socketTimeout value
323+
* @return self
321324
*/
322325
public BreinConfig setSocketTimeout(final long socketTimeout) {
323326
this.socketTimeout = socketTimeout;
@@ -415,6 +418,7 @@ public String getSecret() {
415418
* set the secret
416419
*
417420
* @param secret raw secret
421+
* @return self
418422
*/
419423
public BreinConfig setSecret(final String secret) {
420424
this.secret = secret;
@@ -434,6 +438,7 @@ public String getDefaultCategory() {
434438
* sets the default category
435439
*
436440
* @param defaultCategory default to set
441+
* @return self
437442
*/
438443
public BreinConfig setDefaultCategory(final String defaultCategory) {
439444
this.defaultCategory = defaultCategory;

src/com/brein/domain/BreinDimension.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public String[] getDimensionFields() {
3232
* sets dimension array
3333
*
3434
* @param dimensionFields data of dimensions
35+
* @return self
3536
*/
3637
public BreinDimension setDimensionFields(final String... dimensionFields) {
3738
this.dimensionFields = dimensionFields;

src/com/brein/domain/BreinResult.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public boolean has(final String key) {
5757
/**
5858
* provides the map containing the results
5959
*
60-
* @return map of <String, Object>
60+
* @return map of String, Object
6161
*/
6262
public Map<String, Object> getMap() {
6363
return map;
@@ -72,10 +72,18 @@ public String getMessage() {
7272
return null;
7373
}
7474

75+
/**
76+
* returns the http request status
77+
* @return valus like 200, 403...
78+
*/
7579
public int getStatus() {
7680
return status;
7781
}
7882

83+
/**
84+
* sets the http request status
85+
* @param status contains the value
86+
*/
7987
public void setStatus(final int status) {
8088
this.status = status;
8189
}

src/com/brein/domain/BreinUser.java

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ public BreinUser() {
100100
}
101101

102102
/**
103-
* setter & getter of the properties
103+
* get the email of the user
104+
* @return email
104105
*/
105106
public String getEmail() {
106107
return email;
@@ -110,7 +111,7 @@ public String getEmail() {
110111
* sets the email of the user
111112
*
112113
* @param email to set (will not be checked)
113-
* @return this -> allows chaining
114+
* @return this
114115
*/
115116
public BreinUser setEmail(final String email) {
116117
this.email = email;
@@ -130,7 +131,7 @@ public String getFirstName() {
130131
* set the first name of the user
131132
*
132133
* @param firstName name to set
133-
* @return this -> allows chaining
134+
* @return this
134135
*/
135136
public BreinUser setFirstName(final String firstName) {
136137
this.firstName = firstName;
@@ -150,7 +151,7 @@ public String getLastName() {
150151
* set the last name of the user
151152
*
152153
* @param lastName last name
153-
* @return thi -> allows chaining
154+
* @return thi
154155
*/
155156
public BreinUser setLastName(final String lastName) {
156157
this.lastName = lastName;
@@ -170,6 +171,7 @@ public String getSessionId() {
170171
* sets the sessionId
171172
*
172173
* @param sessionId value of the sessionId
174+
* @return self
173175
*/
174176
public BreinUser setSessionId(final String sessionId) {
175177
this.sessionId = sessionId;
@@ -189,6 +191,7 @@ public String getUserAgent() {
189191
* sets the additional user agent value
190192
*
191193
* @param userAgent value
194+
* @return self
192195
*/
193196
public BreinUser setUserAgent(final String userAgent) {
194197
this.userAgent = userAgent;
@@ -208,6 +211,7 @@ public String getIpAddress() {
208211
* sets the ipAddress
209212
*
210213
* @param ipAddress value
214+
* @return self
211215
*/
212216
public BreinUser setIpAddress(final String ipAddress) {
213217
this.ipAddress = ipAddress;
@@ -227,6 +231,7 @@ public String getReferrer() {
227231
* sets the additional referrer value
228232
*
229233
* @param referrer value
234+
* @return self
230235
*/
231236
public BreinUser setReferrer(final String referrer) {
232237
this.referrer = referrer;
@@ -292,6 +297,7 @@ public BreinUser setDateOfBirth(final int month, final int day, final int year)
292297
* Sets the value of dateOfBirth as String. This is only used internally.
293298
*
294299
* @param dateOfBirthString contains the date of birth string
300+
* @return self
295301
*/
296302
private BreinUser setDateOfBirthString(final String dateOfBirthString) {
297303
this.dateOfBirth = dateOfBirthString;
@@ -398,6 +404,7 @@ public Map<String, Object> get() {
398404
* sets the user map
399405
*
400406
* @param userMap map
407+
* @return self
401408
*/
402409
public BreinUser set(final Map<String, Object> userMap) {
403410
if (userMap == null) {
@@ -415,6 +422,7 @@ public BreinUser set(final Map<String, Object> userMap) {
415422
*
416423
* @param key contains the key for the nested map
417424
* @param userMap map of fields
425+
* @return self
418426
*/
419427
public BreinUser set(final String key, final Map<String, Object> userMap) {
420428
if (userMap == null) {
@@ -436,6 +444,7 @@ public Map<String, Object> getAdditional() {
436444
* sets the user additional map
437445
*
438446
* @param additional map
447+
* @return self
439448
*/
440449
public BreinUser setAdditional(final Map<String, Object> additional) {
441450
if (additional == null) {
@@ -454,6 +463,7 @@ public BreinUser setAdditional(final Map<String, Object> additional) {
454463
*
455464
* @param key contains the key for the nested map
456465
* @param additional map of fields
466+
* @return self
457467
*/
458468
public BreinUser setAdditional(final String key, final Map<String, Object> additional) {
459469
if (additional == null) {
@@ -564,7 +574,6 @@ public void prepareAdditionalFields(final BreinUser breinUser, final Map<String,
564574
if (BreinUtil.containsValue(breinUser.getTimezone())) {
565575
jsonObject.put("timezone", breinUser.getTimezone());
566576
}
567-
568577
}
569578

570579
/**

src/com/brein/engine/IRestEngine.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ static boolean isUrlValid(final String url) {
9191
}
9292

9393
/**
94-
* checks if the url is valid -> if not an exception will be thrown
94+
* checks if the url is valid. If not an exception will be thrown
9595
*
9696
* @param fullyQualifiedUrl url with endpoint
9797
*/

0 commit comments

Comments
 (0)