Skip to content

Commit d4c699e

Browse files
lazer-devAlex Danilenko
andauthored
javadoc fixes (#51)
Co-authored-by: Alex Danilenko <[email protected]>
1 parent 20d4b7c commit d4c699e

File tree

5 files changed

+25
-13
lines changed

5 files changed

+25
-13
lines changed

core/src/main/java/spotty/common/http/HttpHeaders.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,7 @@ public boolean hasNot(String name) {
391391
* Returns <tt>true</tt> if this HttpHeaders contains a header for the specified name and header value is equal with given.
392392
*
393393
* @param name header name
394+
* @param value header value
394395
* @return <tt>true</tt> if this HttpHeaders contains a header for the specified name and header value is equal with given.
395396
*/
396397
public boolean hasAndEqual(String name, String value) {

core/src/main/java/spotty/common/http/HttpStatus.java

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,6 @@ public enum HttpStatus {
223223
PRECONDITION_FAILED(412, Series.CLIENT_ERROR, "Precondition Failed"),
224224
/**
225225
* {@code 413 Payload Too Large}.
226-
* @since 4.1
227226
* @see <a href="https://tools.ietf.org/html/rfc7231#section-6.5.11">
228227
* HTTP/1.1: Semantics and Content, section 6.5.11</a>
229228
*/
@@ -238,7 +237,6 @@ public enum HttpStatus {
238237
REQUEST_ENTITY_TOO_LARGE(413, Series.CLIENT_ERROR, "Request Entity Too Large"),
239238
/**
240239
* {@code 414 URI Too Long}.
241-
* @since 4.1
242240
* @see <a href="https://tools.ietf.org/html/rfc7231#section-6.5.12">
243241
* HTTP/1.1: Semantics and Content, section 6.5.12</a>
244242
*/
@@ -310,7 +308,6 @@ public enum HttpStatus {
310308
FAILED_DEPENDENCY(424, Series.CLIENT_ERROR, "Failed Dependency"),
311309
/**
312310
* {@code 425 Too Early}.
313-
* @since 5.2
314311
* @see <a href="https://tools.ietf.org/html/rfc8470">RFC 8470</a>
315312
*/
316313
TOO_EARLY(425, Series.CLIENT_ERROR, "Too Early"),
@@ -338,7 +335,6 @@ public enum HttpStatus {
338335
* {@code 451 Unavailable For Legal Reasons}.
339336
* @see <a href="https://tools.ietf.org/html/draft-ietf-httpbis-legally-restricted-status-04">
340337
* An HTTP Status Code to Report Legal Obstacles</a>
341-
* @since 4.3
342338
*/
343339
UNAVAILABLE_FOR_LEGAL_REASONS(451, Series.CLIENT_ERROR, "Unavailable For Legal Reasons"),
344340

@@ -421,8 +417,8 @@ public enum HttpStatus {
421417
* Whether this status code is in the HTTP series
422418
* {@link spotty.common.http.HttpStatus.Series#INFORMATIONAL}.
423419
* <p>This is a shortcut for checking the value of {@link #series}.
424-
* @since 4.0
425420
* @see #series
421+
* @return true if series informational
426422
*/
427423
public boolean is1xxInformational() {
428424
return (series == Series.INFORMATIONAL);
@@ -432,8 +428,8 @@ public boolean is1xxInformational() {
432428
* Whether this status code is in the HTTP series
433429
* {@link spotty.common.http.HttpStatus.Series#SUCCESSFUL}.
434430
* <p>This is a shortcut for checking the value of {@link #series}.
435-
* @since 4.0
436431
* @see #series
432+
* @return true if series successful
437433
*/
438434
public boolean is2xxSuccessful() {
439435
return (series == Series.SUCCESSFUL);
@@ -443,8 +439,8 @@ public boolean is2xxSuccessful() {
443439
* Whether this status code is in the HTTP series
444440
* {@link spotty.common.http.HttpStatus.Series#REDIRECTION}.
445441
* <p>This is a shortcut for checking the value of {@link #series}.
446-
* @since 4.0
447442
* @see #series
443+
* @return true if series redirection
448444
*/
449445
public boolean is3xxRedirection() {
450446
return (series == Series.REDIRECTION);
@@ -454,8 +450,8 @@ public boolean is3xxRedirection() {
454450
* Whether this status code is in the HTTP series
455451
* {@link spotty.common.http.HttpStatus.Series#CLIENT_ERROR}.
456452
* <p>This is a shortcut for checking the value of {@link #series}.
457-
* @since 4.0
458453
* @see #series
454+
* @return true if series related to client errors
459455
*/
460456
public boolean is4xxClientError() {
461457
return (series == Series.CLIENT_ERROR);
@@ -465,8 +461,8 @@ public boolean is4xxClientError() {
465461
* Whether this status code is in the HTTP series
466462
* {@link spotty.common.http.HttpStatus.Series#SERVER_ERROR}.
467463
* <p>This is a shortcut for checking the value of {@link #series}.
468-
* @since 4.0
469464
* @see #series
465+
* @return true if series related to server errors
470466
*/
471467
public boolean is5xxServerError() {
472468
return (series == Series.SERVER_ERROR);
@@ -477,9 +473,9 @@ public boolean is5xxServerError() {
477473
* {@link spotty.common.http.HttpStatus.Series#CLIENT_ERROR} or
478474
* {@link spotty.common.http.HttpStatus.Series#SERVER_ERROR}.
479475
* <p>This is a shortcut for checking the value of {@link #series}.
480-
* @since 5.0
481476
* @see #is4xxClientError()
482477
* @see #is5xxServerError()
478+
* @return true if status related to 4xx or 5xx errors
483479
*/
484480
public boolean isError() {
485481
return (is4xxClientError() || is5xxServerError());
@@ -511,7 +507,6 @@ public static HttpStatus valueOf(int statusCode) {
511507
* Resolve the given status code to an {@code HttpStatus}, if possible.
512508
* @param statusCode the HTTP status code (potentially non-standard)
513509
* @return the corresponding {@code HttpStatus}, or {@code null} if not found
514-
* @since 5.0
515510
*/
516511
public static HttpStatus resolve(int statusCode) {
517512
// Use cached VALUES instead of values() to prevent array allocation.
@@ -545,6 +540,7 @@ public enum Series {
545540

546541
/**
547542
* Return the integer value of this status series. Ranges from 1 to 5.
543+
* @return series value
548544
*/
549545
public int value() {
550546
return this.value;
@@ -580,7 +576,6 @@ public static Series valueOf(int statusCode) {
580576
* Resolve the given status code to an {@code HttpStatus.Series}, if possible.
581577
* @param statusCode the HTTP status code (potentially non-standard)
582578
* @return the corresponding {@code Series}, or {@code null} if not found
583-
* @since 5.1.3
584579
*/
585580
public static Series resolve(int statusCode) {
586581
int seriesCode = statusCode / 100;

core/src/main/java/spotty/common/request/SpottyRequest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ public interface SpottyRequest {
106106
Set<String> queryParams();
107107

108108
/**
109+
* @param name query param name
109110
* @return query param values
110111
*/
111112
Set<String> queryParams(String name);
@@ -118,6 +119,7 @@ public interface SpottyRequest {
118119

119120
/**
120121
* set an attachment object (can be fetched in filters/routes later in the chain)
122+
* @param attachment attachment object
121123
*/
122124
void attach(Object attachment);
123125

core/src/main/java/spotty/common/response/SpottyResponse.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ public SpottyResponse cookie(Cookie cookie) {
219219
*
220220
* @param name name of the cookie
221221
* @param value value of the cookie
222+
* @return Response object
222223
*/
223224
public SpottyResponse cookie(String name, String value) {
224225
return cookie(Cookie.builder()
@@ -234,6 +235,7 @@ public SpottyResponse cookie(String name, String value) {
234235
* @param name name of the cookie
235236
* @param value value of the cookie
236237
* @param maxAge max age of the cookie in seconds (zero - deletes the cookie)
238+
* @return Response object
237239
*/
238240
public SpottyResponse cookie(String name, String value, int maxAge) {
239241
return cookie(Cookie.builder()
@@ -251,6 +253,7 @@ public SpottyResponse cookie(String name, String value, int maxAge) {
251253
* @param value value of the cookie
252254
* @param maxAge max age of the cookie in seconds (zero - deletes the cookie)
253255
* @param secured if true : cookie will be secured
256+
* @return Response object
254257
*/
255258
public SpottyResponse cookie(String name, String value, int maxAge, boolean secured) {
256259
return cookie(Cookie.builder()
@@ -270,6 +273,7 @@ public SpottyResponse cookie(String name, String value, int maxAge, boolean secu
270273
* @param maxAge max age of the cookie in seconds (zero - deletes the cookie)
271274
* @param secured if true : cookie will be secured
272275
* @param httpOnly if true: cookie will be marked as http only
276+
* @return Response object
273277
*/
274278
public SpottyResponse cookie(String name, String value, int maxAge, boolean secured, boolean httpOnly) {
275279
return cookie(Cookie.builder()
@@ -290,6 +294,7 @@ public SpottyResponse cookie(String name, String value, int maxAge, boolean secu
290294
* @param value value of the cookie
291295
* @param maxAge max age of the cookie in seconds (zero - deletes the cookie)
292296
* @param secured if true : cookie will be secured
297+
* @return Response object
293298
*/
294299
public SpottyResponse cookie(String path, String name, String value, int maxAge, boolean secured) {
295300
return cookie(Cookie.builder()
@@ -311,6 +316,7 @@ public SpottyResponse cookie(String path, String name, String value, int maxAge,
311316
* @param maxAge max age of the cookie in seconds (zero - deletes the cookie)
312317
* @param secured if true : cookie will be secured
313318
* @param httpOnly if true: cookie will be marked as http only
319+
* @return Response object
314320
*/
315321
public SpottyResponse cookie(String path, String name, String value, int maxAge, boolean secured, boolean httpOnly) {
316322
return cookie(Cookie.builder()
@@ -334,6 +340,7 @@ public SpottyResponse cookie(String path, String name, String value, int maxAge,
334340
* @param maxAge max age of the cookie in seconds (zero - deletes the cookie)
335341
* @param secured if true : cookie will be secured
336342
* @param httpOnly if true: cookie will be marked as http only
343+
* @return Response object
337344
*/
338345
public SpottyResponse cookie(String domain, String path, String name, String value, int maxAge, boolean secured, boolean httpOnly) {
339346
return cookie(Cookie.builder()
@@ -351,6 +358,7 @@ public SpottyResponse cookie(String domain, String path, String name, String val
351358
* Removes the cookie.
352359
*
353360
* @param name name of the cookie
361+
* @return Response object
354362
*/
355363
public SpottyResponse removeCookie(String name) {
356364
return removeCookie(null, name);
@@ -361,6 +369,7 @@ public SpottyResponse removeCookie(String name) {
361369
*
362370
* @param path path of the cookie
363371
* @param name name of the cookie
372+
* @return Response object
364373
*/
365374
public SpottyResponse removeCookie(String path, String name) {
366375
return cookie(

core/src/main/java/spotty/common/session/Session.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ public Session putIfAbsent(Object key, Object value) {
112112
*
113113
* @param key key with which the specified value is to be associated
114114
* @param mapper the function to compute a value
115+
* @param <T> return type
115116
* @return the current (existing or computed) value associated with
116117
* the specified key, or null if the computed value is null
117118
*/
@@ -131,6 +132,7 @@ public <T> T computeIfAbsent(Object key, Function<Object, T> mapper) {
131132
*
132133
* @param key key with which the specified value is to be associated
133134
* @param mapper the function to compute a value
135+
* @param <T> return type
134136
* @return the current (existing or computed) value associated with
135137
* the specified key, or null if the computed value is null
136138
*/
@@ -152,6 +154,7 @@ public <T> T computeIfPresent(Object key, BiFunction<Object, T, T> mapper) {
152154
*
153155
* @param key key with which the specified value is to be associated
154156
* @param mapper the function to compute a value
157+
* @param <T> return type
155158
* @return the new value associated with the specified key, or null if none
156159
*/
157160
@SuppressWarnings("all")
@@ -174,6 +177,7 @@ public Session putAll(Map<Object, Object> data) {
174177
* Returns the value by specified key, or {@code null} if no value for the key.
175178
*
176179
* @param key the key whose associated value is to be returned
180+
* @param <T> return type
177181
* @return the value to which the specified key is mapped, or
178182
* {@code null} if this session contains no mapping for the key
179183
*/
@@ -188,6 +192,7 @@ public <T> T get(Object key) {
188192
*
189193
* @param key the key whose associated value is to be returned
190194
* @param defaultValue the default mapping of the key
195+
* @param <T> return type
191196
* @return the value to which the specified key is mapped, or
192197
* {@code defaultValue} if this map contains no mapping for the key
193198
*/
@@ -197,7 +202,7 @@ public <T> T getOrDefault(Object key, T defaultValue) {
197202
}
198203

199204
/**
200-
* Returns the number of data in this session
205+
* @return Returns the number of data in this session
201206
*/
202207
public int size() {
203208
return data.size();

0 commit comments

Comments
 (0)