Skip to content

Commit 1aebc9c

Browse files
committed
fix javadoc warnings and errors
1 parent a532b32 commit 1aebc9c

32 files changed

Lines changed: 144 additions & 121 deletions

src/main/java/com/auth0/client/auth/AuthAPI.java

Lines changed: 101 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ public void doNotSendTelemetry() {
7272
}
7373

7474
/**
75-
* Whether to enable or not the current Http Logger for every Request, Response and other sensitive information.
75+
* Whether to enable or not the current HTTP Logger for every Request, Response and other sensitive information.
76+
*
77+
* @param enabled whether to enable the HTTP logger or not.
7678
*/
7779
public void setLoggingEnabled(boolean enabled) {
7880
logging.setLevel(enabled ? Level.BODY : Level.NONE);
@@ -100,15 +102,16 @@ private String createBaseUrl(String domain) {
100102
/**
101103
* Creates a new instance of the {@link AuthorizeUrlBuilder} with the given redirect url.
102104
* i.e.:
103-
* <p>
104105
* <pre>
105-
* AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfkaBne");
106-
* String url = auth.authorizeUrl("https://me.auth0.com/callback")
107-
* .withConnection("facebook")
108-
* .withAudience("https://api.me.auth0.com/users")
109-
* .withScope("openid contacts")
110-
* .withState("my-custom-state")
111-
* .build();
106+
* {@code
107+
* AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfkaBne");
108+
* String url = auth.authorizeUrl("https://me.auth0.com/callback")
109+
* .withConnection("facebook")
110+
* .withAudience("https://api.me.auth0.com/users")
111+
* .withScope("openid contacts")
112+
* .withState("my-custom-state")
113+
* .build();
114+
* }
112115
* </pre>
113116
*
114117
* @param redirectUri the redirect_uri value to set, white-listed in the client settings. Must be already URL Encoded.
@@ -123,12 +126,13 @@ public AuthorizeUrlBuilder authorizeUrl(String redirectUri) {
123126
/**
124127
* Creates a new instance of the {@link LogoutUrlBuilder} with the given return-to url.
125128
* i.e.:
126-
* <p>
127129
* <pre>
128-
* AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfkaBne");
129-
* String url = auth.logoutUrl("https://me.auth0.com/home", true)
130-
* .useFederated(true)
131-
* .withAccessToken("A9CvPwFojaBIA9CvI");
130+
* {@code
131+
* AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfkaBne");
132+
* String url = auth.logoutUrl("https://me.auth0.com/home", true)
133+
* .useFederated(true)
134+
* .withAccessToken("A9CvPwFojaBIA9CvI");
135+
* }
132136
* </pre>
133137
*
134138
* @param returnToUrl the redirect_uri value to set, white-listed in the client settings. Must be already URL Encoded.
@@ -145,14 +149,15 @@ public LogoutUrlBuilder logoutUrl(String returnToUrl, boolean setClientId) {
145149
/**
146150
* Request the user information related to the access token.
147151
* i.e.:
148-
* <p>
149152
* <pre>
150-
* AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfkaBne");
151-
* try {
152-
* UserInfo result = auth.userInfo("A9CvPwFojaBIA9CvI").execute();
153-
* } catch (Auth0Exception e) {
154-
* //Something happened
155-
* }
153+
* {@code
154+
* AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfkaBne");
155+
* try {
156+
* UserInfo result = auth.userInfo("A9CvPwFojaBIA9CvI").execute();
157+
* } catch (Auth0Exception e) {
158+
* //Something happened
159+
* }
160+
* }
156161
* </pre>
157162
*
158163
* @param accessToken a valid access token belonging to an API signed with RS256 algorithm and containing the scope 'openid'.
@@ -176,14 +181,15 @@ public Request<UserInfo> userInfo(String accessToken) {
176181
* Request a password reset for the given email and database connection. The response will always be successful even if
177182
* there's no user associated to the given email for that database connection.
178183
* i.e.:
179-
* <p>
180184
* <pre>
181-
* AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfkaBne");
182-
* try {
183-
* auth.resetPassword("me@auth0.com", "db-connection").execute();
184-
* } catch (Auth0Exception e) {
185-
* //Something happened
186-
* }
185+
* {@code
186+
* AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfkaBne");
187+
* try {
188+
* auth.resetPassword("me@auth0.com", "db-connection").execute();
189+
* } catch (Auth0Exception e) {
190+
* //Something happened
191+
* }
192+
* }
187193
* </pre>
188194
*
189195
* @param email the email associated to the database user.
@@ -211,19 +217,20 @@ public Request resetPassword(String email, String connection) {
211217
* Creates a new sign up request with the given credentials and database connection.
212218
* "Requires Username" option must be turned on in the Connection's configuration first.
213219
* i.e.:
214-
* <p>
215220
* <pre>
216-
* AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfkaBne");
217-
* try {
218-
* Map<String, String> fields = new HashMap<String, String>();
219-
* fields.put("age", "25);
220-
* fields.put("city", "Buenos Aires");
221-
* auth.signUp("me@auth0.com", "myself", "topsecret", "db-connection")
222-
* .setCustomFields(fields)
223-
* .execute();
224-
* } catch (Auth0Exception e) {
225-
* //Something happened
226-
* }
221+
* {@code
222+
* AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfkaBne");
223+
* try {
224+
* Map<String, String> fields = new HashMap<String, String>();
225+
* fields.put("age", "25);
226+
* fields.put("city", "Buenos Aires");
227+
* auth.signUp("me@auth0.com", "myself", "topsecret", "db-connection")
228+
* .setCustomFields(fields)
229+
* .execute();
230+
* } catch (Auth0Exception e) {
231+
* //Something happened
232+
* }
233+
* }
227234
* </pre>
228235
*
229236
* @param email the desired user's email.
@@ -243,19 +250,20 @@ public SignUpRequest signUp(String email, String username, String password, Stri
243250
/**
244251
* Creates a new sign up request with the given credentials and database connection.
245252
* i.e.:
246-
* <p>
247253
* <pre>
248-
* AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfkaBne");
249-
* try {
250-
* Map<String, String> fields = new HashMap<String, String>();
251-
* fields.put("age", "25);
252-
* fields.put("city", "Buenos Aires");
253-
* auth.signUp("me@auth0.com", "topsecret", "db-connection")
254-
* .setCustomFields(fields)
255-
* .execute();
256-
* } catch (Auth0Exception e) {
257-
* //Something happened
258-
* }
254+
* {@code
255+
* AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfkaBne");
256+
* try {
257+
* Map<String, String> fields = new HashMap<String, String>();
258+
* fields.put("age", "25);
259+
* fields.put("city", "Buenos Aires");
260+
* auth.signUp("me@auth0.com", "topsecret", "db-connection")
261+
* .setCustomFields(fields)
262+
* .execute();
263+
* } catch (Auth0Exception e) {
264+
* //Something happened
265+
* }
266+
* }
259267
* </pre>
260268
*
261269
* @param email the desired user's email.
@@ -285,16 +293,17 @@ public SignUpRequest signUp(String email, String password, String connection) {
285293
/**
286294
* Creates a new log in request using the 'Password' grant and the given credentials.
287295
* i.e.:
288-
* <p>
289296
* <pre>
290-
* AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfkaBne");
291-
* try {
292-
* TokenHolder result = auth.login("me@auth0.com", "topsecret")
293-
* .setScope("openid email nickname")
294-
* .execute();
295-
* } catch (Auth0Exception e) {
296-
* //Something happened
297-
* }
297+
* {@code
298+
* AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfkaBne");
299+
* try {
300+
* TokenHolder result = auth.login("me@auth0.com", "topsecret")
301+
* .setScope("openid email nickname")
302+
* .execute();
303+
* } catch (Auth0Exception e) {
304+
* //Something happened
305+
* }
306+
* }
298307
* </pre>
299308
*
300309
* @param emailOrUsername the identity of the user.
@@ -323,20 +332,22 @@ public AuthRequest login(String emailOrUsername, String password) {
323332
/**
324333
* Creates a new log in request using the 'Password Realm' grant and the given credentials.
325334
* Default used realm and audience are defined in the "API Authorization Settings" in the account's advanced settings in the Auth0 Dashboard.
326-
* <p>
327335
* <pre>
328-
* AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfkaBne");
329-
* try {
330-
* TokenHolder result = auth.login("me@auth0.com", "topsecret", "my-realm")
331-
* .setAudience("https://myapi.me.auth0.com/users")
332-
* .execute();
333-
* } catch (Auth0Exception e) {
334-
* //Something happened
335-
* }
336+
* {@code
337+
* AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfkaBne");
338+
* try {
339+
* TokenHolder result = auth.login("me@auth0.com", "topsecret", "my-realm")
340+
* .setAudience("https://myapi.me.auth0.com/users")
341+
* .execute();
342+
* } catch (Auth0Exception e) {
343+
* //Something happened
344+
* }
345+
* }
336346
* </pre>
337347
*
338348
* @param emailOrUsername the identity of the user.
339349
* @param password the password of the user.
350+
* @param realm the realm to use.
340351
* @return a Request to configure and execute.
341352
*/
342353
public AuthRequest login(String emailOrUsername, String password, String realm) {
@@ -363,16 +374,17 @@ public AuthRequest login(String emailOrUsername, String password, String realm)
363374
/**
364375
* Creates a new request to get a Token for the given audience using the 'Client Credentials' grant.
365376
* Default used realm is defined in the "API Authorization Settings" in the account's advanced settings in the Auth0 Dashboard.
366-
* <p>
367377
* <pre>
368-
* AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfkaBne");
369-
* try {
370-
* TokenHolder result = auth.requestToken("https://myapi.me.auth0.com/users")
371-
* .setRealm("my-realm")
372-
* .execute();
373-
* } catch (Auth0Exception e) {
374-
* //Something happened
375-
* }
378+
* {@code
379+
* AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfkaBne");
380+
* try {
381+
* TokenHolder result = auth.requestToken("https://myapi.me.auth0.com/users")
382+
* .setRealm("my-realm")
383+
* .execute();
384+
* } catch (Auth0Exception e) {
385+
* //Something happened
386+
* }
387+
* }
376388
* </pre>
377389
*
378390
* @param audience the audience of the API to request access to.
@@ -397,16 +409,17 @@ public AuthRequest requestToken(String audience) {
397409

398410
/**
399411
* Creates a new request to exchange the code obtained in the /authorize call using the 'Authorization Code' grant.
400-
* <p>
401412
* <pre>
402-
* AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfkaBne");
403-
* try {
404-
* TokenHolder result = auth.exchangeCode("SnWoFLMzApDskr", "https://me.auth0.com/callback")
405-
* .setScope("openid name nickname")
406-
* .execute();
407-
* } catch (Auth0Exception e) {
408-
* //Something happened
409-
* }
413+
* {@code
414+
* AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfkaBne");
415+
* try {
416+
* TokenHolder result = auth.exchangeCode("SnWoFLMzApDskr", "https://me.auth0.com/callback")
417+
* .setScope("openid name nickname")
418+
* .execute();
419+
* } catch (Auth0Exception e) {
420+
* //Something happened
421+
* }
422+
* }
410423
* </pre>
411424
*
412425
* @param code the authorization code received from the /authorize call.

src/main/java/com/auth0/client/mgmt/GuardianEntity.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ public Request<List<Factor>> listFactors() {
147147
* Update an existing Guardian Factor. A token with scope update:guardian_factors is needed.
148148
* See https://auth0.com/docs/api/management/v2#!/Guardian/put_factors_by_name
149149
*
150+
* @param name the name of the Factor to update.
151+
* @param enabled whether to enable or disable the Factor.
150152
* @return a Request to execute.
151153
*/
152154
public Request<Factor> updateFactor(String name, Boolean enabled) {

src/main/java/com/auth0/client/mgmt/ManagementAPI.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ public void doNotSendTelemetry() {
5353
}
5454

5555
/**
56-
* Whether to enable or not the current Http Logger for every Request, Response and other sensitive information.
56+
* Whether to enable or not the current HTTP Logger for every Request, Response and other sensitive information.
57+
*
58+
* @param enabled whether to enable the HTTP logger or not.
5759
*/
5860
public void setLoggingEnabled(boolean enabled) {
5961
logging.setLevel(enabled ? Level.BODY : Level.NONE);

src/main/java/com/auth0/client/mgmt/filter/ConnectionFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.auth0.client.mgmt.filter;
22

33
/**
4-
* Class used to filter the results received when calling the Connections endpoint. Related to the {@link com.auth0.client.mgmt.ConnectionsEntity()} entity.
4+
* Class used to filter the results received when calling the Connections endpoint. Related to the {@link com.auth0.client.mgmt.ConnectionsEntity} entity.
55
*/
66
public class ConnectionFilter extends FieldsFilter {
77

src/main/java/com/auth0/client/mgmt/filter/DeviceCredentialsFilter.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
package com.auth0.client.mgmt.filter;
22

33
/**
4-
* Class used to filter the results received when calling the Device Credentials endpoint. Related to the {@link com.auth0.client.mgmt.DeviceCredentialsEntity()} entity.
4+
* Class used to filter the results received when calling the Device Credentials endpoint. Related to the {@link com.auth0.client.mgmt.DeviceCredentialsEntity} entity.
55
*/
66
public class DeviceCredentialsFilter extends FieldsFilter {
77

88
/**
99
* Filter by user id
1010
*
1111
* @param userId only retrieve items with this user id.
12+
* @return this filter instance.
1213
*/
1314
public DeviceCredentialsFilter withUserId(String userId) {
1415
parameters.put("user_id", userId);
@@ -19,6 +20,7 @@ public DeviceCredentialsFilter withUserId(String userId) {
1920
* Filter by client id
2021
*
2122
* @param clientId only retrieve items with this client id.
23+
* @return this filter instance.
2224
*/
2325
public DeviceCredentialsFilter withClientId(String clientId) {
2426
parameters.put("client_id", clientId);
@@ -29,6 +31,7 @@ public DeviceCredentialsFilter withClientId(String clientId) {
2931
* Filter by type
3032
*
3133
* @param type only retrieve items with this type.
34+
* @return this filter instance.
3235
*/
3336
public DeviceCredentialsFilter withType(String type) {
3437
parameters.put("type", type);

src/main/java/com/auth0/client/mgmt/filter/LogEventFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.auth0.client.mgmt.filter;
22

33
/**
4-
* Class used to filter the results received when calling the Logs endpoint. Related to the {@link com.auth0.client.mgmt.LogEventsEntity()} entity.
4+
* Class used to filter the results received when calling the Logs endpoint. Related to the {@link com.auth0.client.mgmt.LogEventsEntity} entity.
55
*/
66
public class LogEventFilter extends QueryFilter {
77

src/main/java/com/auth0/client/mgmt/filter/RulesFilter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
package com.auth0.client.mgmt.filter;
22

33
/**
4-
* Class used to filter the results received when calling the Rules endpoint. Related to the {@link com.auth0.client.mgmt.RulesEntity()} entity.
4+
* Class used to filter the results received when calling the Rules endpoint. Related to the {@link com.auth0.client.mgmt.RulesEntity} entity.
55
*/
66
public class RulesFilter extends FieldsFilter {
77

88
/**
99
* Filter by enabled value
1010
*
1111
* @param enabled only retrieve items that are enabled or disabled.
12+
* @return this filter instance.
1213
*/
1314
public RulesFilter withEnabled(boolean enabled) {
1415
parameters.put("enabled", enabled);

src/main/java/com/auth0/client/mgmt/filter/UserFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.auth0.client.mgmt.filter;
22

33
/**
4-
* Class used to filter the results received when calling the Users endpoint. Related to the {@link com.auth0.client.mgmt.UsersEntity()} entity.
4+
* Class used to filter the results received when calling the Users endpoint. Related to the {@link com.auth0.client.mgmt.UsersEntity} entity.
55
*/
66
public class UserFilter extends QueryFilter {
77

src/main/java/com/auth0/exception/APIException.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44

55
/**
66
* Class that represents an Auth0 Server error captured from a http response. Provides different methods to get a clue of why the request failed.
7-
* <p>
7+
* i.e.:
88
* <pre>
99
* {@code
10-
* Sample exception data.
1110
* {
12-
* statusCode: 400,
13-
* description: "Query validation error: 'String 'users' does not match pattern. Must be a comma separated list of the following values: name,strategy,options,enabled_clients,id,provisioning_ticket_url' on property fields (A comma separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields).",
14-
* error: "invalid_query_string"
11+
* statusCode: 400,
12+
* description: "Query validation error: 'String 'users' does not match pattern. Must be a comma separated list of the following values: name,strategy,options,enabled_clients,id,provisioning_ticket_url' on property fields (A comma separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields).",
13+
* error: "invalid_query_string"
1514
* }
1615
* }
1716
* </pre>

0 commit comments

Comments
 (0)