Skip to content

Commit d694b5a

Browse files
committed
Fix Request's javadoc
1 parent 119a199 commit d694b5a

File tree

1 file changed

+42
-63
lines changed

1 file changed

+42
-63
lines changed

client/src/main/java/org/asynchttpclient/Request.java

Lines changed: 42 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -36,166 +36,145 @@
3636
/**
3737
* The Request class can be used to construct HTTP request:
3838
* <blockquote><pre>
39-
* Request r = new RequestBuilder().setUrl("url")
40-
* .setRealm((new Realm.RealmBuilder()).setPrincipal(user)
41-
* .setPassword(admin)
42-
* .setRealmName("MyRealm")
43-
* .setScheme(Realm.AuthScheme.DIGEST).build());
39+
* Request r = new RequestBuilder()
40+
* .setUrl("url")
41+
* .setRealm(
42+
* new Realm.Builder("principal", "password")
43+
* .setRealmName("MyRealm")
44+
* .setScheme(Realm.AuthScheme.BASIC)
45+
* ).build();
4446
* </pre></blockquote>
4547
*/
4648
public interface Request {
4749

4850
/**
49-
* Return the request's method name (GET, POST, etc.)
50-
*
51-
* @return the request's method name (GET, POST, etc.)
51+
* @return the request's HTTP method (GET, POST, etc.)
5252
*/
5353
String getMethod();
5454

55+
/**
56+
*
57+
* @return the uri
58+
*/
5559
Uri getUri();
5660

61+
/**
62+
* @return the url (the uri's String form)
63+
*/
5764
String getUrl();
5865

5966
/**
60-
* Return the InetAddress to override
61-
*
62-
* @return the InetAddress
67+
* @return the InetAddress to be used to bypass uri's hostname resolution
6368
*/
6469
InetAddress getAddress();
6570

71+
/**
72+
* @return the local address to bind from
73+
*/
6674
InetAddress getLocalAddress();
6775

6876
/**
69-
* Return the current set of Headers.
70-
*
71-
* @return a {@link HttpHeaders} contains headers.
77+
* @return the HTTP headers
7278
*/
7379
HttpHeaders getHeaders();
7480

7581
/**
76-
* Return cookies.
77-
*
78-
* @return an unmodifiable Collection of Cookies
82+
* @return the HTTP cookies
7983
*/
8084
List<Cookie> getCookies();
8185

8286
/**
83-
* Return the current request's body as a byte array
84-
*
85-
* @return a byte array of the current request's body.
87+
* @return the request's body byte array (only non null if it was set this way)
8688
*/
8789
byte[] getByteData();
8890

8991
/**
90-
* @return the current request's body as a composite of byte arrays
92+
* @return the request's body array of byte arrays (only non null if it was set this way)
9193
*/
9294
List<byte[]> getCompositeByteData();
9395

9496
/**
95-
* Return the current request's body as a string
96-
*
97-
* @return an String representation of the current request's body.
97+
* @return the request's body string (only non null if it was set this way)
9898
*/
9999
String getStringData();
100100

101101
/**
102-
* Return the current request's body as a ByteBuffer
103-
*
104-
* @return a ByteBuffer
102+
* @return the request's body ByteBuffer (only non null if it was set this way)
105103
*/
106104
ByteBuffer getByteBufferData();
107105

108106
/**
109-
* Return the current request's body as an InputStream
110-
*
111-
* @return an InputStream representation of the current request's body.
107+
* @return the request's body InputStream (only non null if it was set this way)
112108
*/
113109
InputStream getStreamData();
114110

115111
/**
116-
* Return the current request's body generator.
117-
*
118-
* @return A generator for the request body.
112+
* @return the request's body BodyGenerator (only non null if it was set this way)
119113
*/
120114
BodyGenerator getBodyGenerator();
121115

122116
/**
123-
* Return the current form parameters.
124-
*
125-
* @return the form parameters.
117+
* @return the request's form parameters
126118
*/
127119
List<Param> getFormParams();
128120

129121
/**
130-
* Return the current {@link Part}
131-
*
132-
* @return the current {@link Part}
122+
* @return the multipart parts
133123
*/
134124
List<Part> getBodyParts();
135125

136126
/**
137-
* Return the virtual host value.
138-
*
139-
* @return the virtual host value.
127+
* @return the virtual host to connect to
140128
*/
141129
String getVirtualHost();
142130

143131
/**
144-
* Return the query params.
145-
*
146-
* @return the query parameters
132+
* @return the query params resolved from the url/uri
147133
*/
148134
List<Param> getQueryParams();
149135

150136
/**
151-
* Return the {@link ProxyServer}
152-
*
153-
* @return the {@link ProxyServer}
137+
* @return the proxy server to be used to perform this request (overrides the one defined in config)
154138
*/
155139
ProxyServer getProxyServer();
156140

157141
/**
158-
* Return the {@link Realm}
159-
*
160-
* @return the {@link Realm}
142+
* @return the realm to be used to perform this request (overrides the one defined in config)
161143
*/
162144
Realm getRealm();
163145

164146
/**
165-
* Return the {@link File} to upload.
166-
*
167-
* @return the {@link File} to upload.
147+
* @return the file to be uploaded
168148
*/
169149
File getFile();
170150

171151
/**
172-
* Return follow redirect
173-
*
174-
* @return {@link Boolean#TRUE} to follow redirect, {@link Boolean#FALSE} if NOT to follow whatever the client config, null otherwise.
152+
* @return if this request is to follow redirects. Non null values means "override config value".
175153
*/
176154
Boolean getFollowRedirect();
177155

178156
/**
179-
* Overrides the config default value
180-
* @return the request timeout
157+
* @return the request timeout. Non zero values means "override config value".
181158
*/
182159
int getRequestTimeout();
183160

184161
/**
185-
* Return the HTTP Range header value, or
186-
*
187162
* @return the range header value, or 0 is not set.
188163
*/
189164
long getRangeOffset();
190165

191166
/**
192-
* Return the charset value used when decoding the request's body.
193-
*
194167
* @return the charset value used when decoding the request's body.
195168
*/
196169
Charset getCharset();
197170

171+
/**
172+
* @return the strategy to compute ChannelPool's keys
173+
*/
198174
ChannelPoolPartitioning getChannelPoolPartitioning();
199175

176+
/**
177+
* @return the NameResolver to be used to resolve hostnams's IP
178+
*/
200179
NameResolver<InetAddress> getNameResolver();
201180
}

0 commit comments

Comments
 (0)