Skip to content

Commit a1eed80

Browse files
committed
Javadoc
- Remove redundant parentheses - No need to nest into else clause - Add missing @OverRide
1 parent 648690f commit a1eed80

33 files changed

+382
-65
lines changed

httpclient5/src/main/java/org/apache/hc/client5/http/async/AsyncExecCallback.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ public interface AsyncExecCallback {
4949
* @param entityDetails the response entity details or {@code null} if the response
5050
* does not enclose an entity.
5151
* @return the data consumer to be used for processing of incoming response message body.
52+
* @throws HttpException If a protocol error occurs.
53+
* @throws IOException If an I/O error occurs.
5254
*/
5355
AsyncDataConsumer handleResponse(
5456
HttpResponse response,
@@ -58,6 +60,8 @@ AsyncDataConsumer handleResponse(
5860
* Triggered to signal receipt of an intermediate response message.
5961
*
6062
* @param response the intermediate response message.
63+
* @throws HttpException If a protocol error occurs.
64+
* @throws IOException If an I/O error occurs.
6165
*/
6266
void handleInformationResponse(HttpResponse response) throws HttpException, IOException;
6367

httpclient5/src/main/java/org/apache/hc/client5/http/async/AsyncExecChainHandler.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ public interface AsyncExecChainHandler {
7272
* @param scope the execution scope .
7373
* @param chain the next element in the request execution chain.
7474
* @param asyncExecCallback the execution callback.
75+
* @throws HttpException If a protocol error occurs.
76+
* @throws IOException If an I/O error occurs.
7577
*/
7678
void execute(
7779
HttpRequest request,

httpclient5/src/main/java/org/apache/hc/client5/http/async/AsyncExecRuntime.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ default void upgradeTls(HttpClientContext context,
135135
}
136136

137137
/**
138-
* Returns information about the underlying endpoint when connected or {@code null} otherwise.
138+
* Gets information about the underlying endpoint when connected or {@code null} otherwise.
139+
*
140+
* @return the underlying endpoint or {@code null}
139141
*/
140142
default EndpointInfo getEndpointInfo() {
141143
return null;

httpclient5/src/main/java/org/apache/hc/client5/http/async/methods/AbstractBinPushConsumer.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ public abstract class AbstractBinPushConsumer extends AbstractBinDataConsumer im
5252
* @param response the response message head
5353
* @param contentType the content type of the response body,
5454
* or {@code null} if the response does not enclose a response entity.
55+
* @throws HttpException If a protocol error occurs.
56+
* @throws IOException If an I/O error occurs.
5557
*/
5658
protected abstract void start(HttpRequest promise, HttpResponse response, ContentType contentType) throws HttpException, IOException;
5759

httpclient5/src/main/java/org/apache/hc/client5/http/async/methods/AbstractBinResponseConsumer.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ public abstract class AbstractBinResponseConsumer<T> extends AbstractBinDataCons
5656
* @param response the response message head
5757
* @param contentType the content type of the response body,
5858
* or {@code null} if the response does not enclose a response entity.
59+
* @throws HttpException If a protocol error occurs.
60+
* @throws IOException If an I/O error occurs.
5961
*/
6062
protected abstract void start(HttpResponse response, ContentType contentType) throws HttpException, IOException;
6163

httpclient5/src/main/java/org/apache/hc/client5/http/async/methods/AbstractCharPushConsumer.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ protected AbstractCharPushConsumer(final int bufSize,
6868
* @param response the response message head
6969
* @param contentType the content type of the response body,
7070
* or {@code null} if the response does not enclose a response entity.
71+
* @throws HttpException If a protocol error occurs.
72+
* @throws IOException If an I/O error occurs.
7173
*/
7274
protected abstract void start(HttpRequest promise, HttpResponse response, ContentType contentType) throws HttpException, IOException;
7375

httpclient5/src/main/java/org/apache/hc/client5/http/async/methods/AbstractCharResponseConsumer.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ protected AbstractCharResponseConsumer(final int bufSize,
7171
* @param response the response message head
7272
* @param contentType the content type of the response body,
7373
* or {@code null} if the response does not enclose a response entity.
74+
* @throws HttpException If a protocol error occurs.
75+
* @throws IOException If an I/O error occurs.
7476
*/
7577
protected abstract void start(HttpResponse response, ContentType contentType) throws HttpException, IOException;
7678

httpclient5/src/main/java/org/apache/hc/client5/http/async/methods/BasicHttpRequests.java

Lines changed: 160 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,125 +65,280 @@ public static BasicHttpRequest create(final String method, final URI uri) {
6565
return create(Method.normalizedValueOf(method), uri);
6666
}
6767

68+
/**
69+
* Creates a new DELETE {@link BasicHttpRequest}.
70+
*
71+
* @param uri a non-null URI.
72+
* @return a new BasicHttpRequest
73+
*/
6874
public static BasicHttpRequest delete(final String uri) {
6975
return delete(URI.create(uri));
7076
}
7177

78+
/**
79+
* Creates a new DELETE {@link BasicHttpRequest}.
80+
*
81+
* @param uri a non-null URI.
82+
* @return a new BasicHttpRequest
83+
*/
7284
public static BasicHttpRequest delete(final URI uri) {
7385
return create(Method.DELETE, uri);
7486
}
7587

88+
/**
89+
* Creates a new DELETE {@link BasicHttpRequest}.
90+
*
91+
* @param host HTTP host.
92+
* @param path request path.
93+
* @return a new BasicHttpRequest
94+
*/
7695
public static BasicHttpRequest delete(final HttpHost host, final String path) {
7796
return create(Method.DELETE, host, path);
7897
}
7998

99+
/**
100+
* Creates a new GET {@link BasicHttpRequest}.
101+
*
102+
* @param uri a non-null URI.
103+
* @return a new BasicHttpRequest
104+
*/
80105
public static BasicHttpRequest get(final String uri) {
81106
return get(URI.create(uri));
82107
}
83108

109+
/**
110+
* Creates a new GET {@link BasicHttpRequest}.
111+
*
112+
* @param uri a non-null URI.
113+
* @return a new BasicHttpRequest
114+
*/
84115
public static BasicHttpRequest get(final URI uri) {
85116
return create(Method.GET, uri);
86117
}
87118

119+
/**
120+
* Creates a new HEAD {@link BasicHttpRequest}.
121+
*
122+
* @param host HTTP host.
123+
* @param path request path.
124+
* @return a new BasicHttpRequest
125+
*/
88126
public static BasicHttpRequest get(final HttpHost host, final String path) {
89127
return create(Method.GET, host, path);
90128
}
91129

130+
/**
131+
* Creates a new HEAD {@link BasicHttpRequest}.
132+
*
133+
* @param uri a non-null URI.
134+
* @return a new BasicHttpRequest
135+
*/
92136
public static BasicHttpRequest head(final String uri) {
93137
return head(URI.create(uri));
94138
}
95139

140+
/**
141+
* Creates a new HEAD {@link BasicHttpRequest}.
142+
*
143+
* @param uri a non-null URI.
144+
* @return a new BasicHttpRequest
145+
*/
96146
public static BasicHttpRequest head(final URI uri) {
97147
return create(Method.HEAD, uri);
98148
}
99149

150+
/**
151+
* Creates a new HEAD {@link BasicHttpRequest}.
152+
*
153+
* @param host HTTP host.
154+
* @param path request path.
155+
* @return a new BasicHttpRequest
156+
*/
100157
public static BasicHttpRequest head(final HttpHost host, final String path) {
101158
return create(Method.HEAD, host, path);
102159
}
103160

161+
/**
162+
* Creates a new OPTIONS {@link BasicHttpRequest}.
163+
*
164+
* @param uri a non-null URI.
165+
* @return a new BasicHttpRequest
166+
*/
104167
public static BasicHttpRequest options(final String uri) {
105168
return options(URI.create(uri));
106169
}
107170

171+
/**
172+
* Creates a new OPTIONS {@link BasicHttpRequest}.
173+
*
174+
* @param uri a non-null URI.
175+
* @return a new BasicHttpRequest
176+
*/
108177
public static BasicHttpRequest options(final URI uri) {
109178
return create(Method.OPTIONS, uri);
110179
}
111180

181+
/**
182+
* Creates a new OPTIONS {@link BasicHttpRequest}.
183+
*
184+
* @param host HTTP host.
185+
* @param path request path.
186+
* @return a new BasicHttpRequest
187+
*/
112188
public static BasicHttpRequest options(final HttpHost host, final String path) {
113189
return create(Method.OPTIONS, host, path);
114190
}
115191

192+
/**
193+
* Creates a new PATCH {@link BasicHttpRequest}.
194+
*
195+
* @param uri a non-null URI.
196+
* @return a new BasicHttpRequest
197+
*/
116198
public static BasicHttpRequest patch(final String uri) {
117199
return patch(URI.create(uri));
118200
}
119201

202+
/**
203+
* Creates a new PATCH {@link BasicHttpRequest}.
204+
*
205+
* @param uri a non-null URI.
206+
* @return a new BasicHttpRequest
207+
*/
120208
public static BasicHttpRequest patch(final URI uri) {
121209
return create(Method.PATCH, uri);
122210
}
123211

212+
/**
213+
* Creates a new PATCH {@link BasicHttpRequest}.
214+
*
215+
* @param host HTTP host.
216+
* @param path request path.
217+
* @return a new BasicHttpRequest
218+
*/
124219
public static BasicHttpRequest patch(final HttpHost host, final String path) {
125220
return create(Method.PATCH, host, path);
126221
}
127222

223+
/**
224+
* Creates a new POST {@link BasicHttpRequest}.
225+
*
226+
* @param uri a non-null URI.
227+
* @return a new BasicHttpRequest
228+
*/
128229
public static BasicHttpRequest post(final String uri) {
129230
return post(URI.create(uri));
130231
}
131232

233+
/**
234+
* Creates a new POST {@link BasicHttpRequest}.
235+
*
236+
* @param uri a non-null URI.
237+
* @return a new BasicHttpRequest
238+
*/
132239
public static BasicHttpRequest post(final URI uri) {
133240
return create(Method.POST, uri);
134241
}
135242

243+
/**
244+
* Creates a new POST {@link BasicHttpRequest}.
245+
*
246+
* @param host HTTP host.
247+
* @param path request path.
248+
* @return a new BasicHttpRequest
249+
*/
136250
public static BasicHttpRequest post(final HttpHost host, final String path) {
137251
return create(Method.POST, host, path);
138252
}
139253

254+
/**
255+
* Creates a new PUT {@link BasicHttpRequest}.
256+
*
257+
* @param uri a non-null URI.
258+
* @return a new BasicHttpRequest
259+
*/
140260
public static BasicHttpRequest put(final String uri) {
141261
return put(URI.create(uri));
142262
}
143263

264+
/**
265+
* Creates a new PUT {@link BasicHttpRequest}.
266+
*
267+
* @param uri a non-null URI.
268+
* @return a new BasicHttpRequest
269+
*/
144270
public static BasicHttpRequest put(final URI uri) {
145271
return create(Method.PUT, uri);
146272
}
147273

274+
/**
275+
* Creates a new PUT {@link BasicHttpRequest}.
276+
*
277+
* @param host HTTP host.
278+
* @param path request path.
279+
* @return a new BasicHttpRequest
280+
*/
148281
public static BasicHttpRequest put(final HttpHost host, final String path) {
149282
return create(Method.PUT, host, path);
150283
}
151284

285+
/**
286+
* Creates a new TRACE {@link BasicHttpRequest}.
287+
*
288+
* @param uri a non-null URI.
289+
* @return a new BasicHttpRequest
290+
*/
152291
public static BasicHttpRequest trace(final String uri) {
153292
return trace(URI.create(uri));
154293
}
155294

295+
/**
296+
* Creates a new TRACE {@link BasicHttpRequest}.
297+
*
298+
* @param uri a non-null URI.
299+
* @return a new BasicHttpRequest
300+
*/
156301
public static BasicHttpRequest trace(final URI uri) {
157302
return create(Method.TRACE, uri);
158303
}
159304

305+
/**
306+
* Creates a new TRACE {@link BasicHttpRequest}.
307+
*
308+
* @param host HTTP host.
309+
* @param path request path.
310+
* @return a new BasicHttpRequest
311+
*/
160312
public static BasicHttpRequest trace(final HttpHost host, final String path) {
161313
return create(Method.TRACE, host, path);
162314
}
163315

164316
/**
165-
* Creates a request object of the exact subclass of {@link BasicHttpRequest}.
317+
* Creates a new {@link BasicHttpRequest}.
166318
*
319+
* @param method a non-null HTTP method.
167320
* @param uri a non-null URI String.
168-
* @return a new subclass of BasicHttpRequest
321+
* @return a new BasicHttpRequest
169322
*/
170323
public static BasicHttpRequest create(final Method method, final String uri) {
171324
return create(method, URI.create(uri));
172325
}
173326

174327
/**
175-
* Creates a request object of the exact subclass of {@link BasicHttpRequest}.
328+
* Creates a new {@link BasicHttpRequest}.
176329
*
330+
* @param method a non-null HTTP method.
177331
* @param uri a non-null URI.
178-
* @return a new subclass of BasicHttpRequest
332+
* @return a new BasicHttpRequest
179333
*/
180334
public static BasicHttpRequest create(final Method method, final URI uri) {
181335
return new BasicHttpRequest(method, uri);
182336
}
183337

184338
/**
185-
* Creates a request object of the exact subclass of {@link BasicHttpRequest}.
339+
* Creates a new {@link BasicHttpRequest}.
186340
*
341+
* @param method a non-null HTTP method.
187342
* @param host HTTP host.
188343
* @param path request path.
189344
* @return a new subclass of BasicHttpRequest

0 commit comments

Comments
 (0)