@Immutable public interface RequestURI
Instance of this interface is returned by Request.uri()
,
and can be modified using one of the methods below. When modification
is done, method back()
returns a modified instance of
Request
, for example:
new JdkRequest("http://my.example.com") .header("Accept", "application/json") .uri() .path("/users") .queryParam("name", "Jeff Lebowski") .back() // returns a modified instance of Request .fetch()
Instances of this interface are immutable and thread-safe.
Modifier and Type | Method and Description |
---|---|
Request |
back()
Get back to the request it's related to.
|
URI |
get()
Get URI.
|
RequestURI |
path(String segment)
Add URI path.
|
RequestURI |
queryParam(String name,
Object value)
Add query param.
|
RequestURI |
queryParams(Map<String,String> map)
Add query params.
|
RequestURI |
set(URI uri)
Set URI.
|
RequestURI |
userInfo(String info)
Set user info.
|
@NotNull(message="request is never NULL") Request back()
@NotNull(message="URI is never NULL") URI get()
@NotNull(message="URI is never NULL") RequestURI set(@NotNull(message="URI can\'t be NULL") URI uri)
uri
- URI to set@NotNull(message="request URI is never NULL") RequestURI queryParam(@NotNull(message="query param name can\'t be NULL") String name, @NotNull(message="query param value can\'t be NULL") Object value)
name
- Query param namevalue
- Value of the query param to set@NotNull(message="request URI is never NULL") RequestURI queryParams(@NotNull(message="map of params can\'t be NULL") Map<String,String> map)
map
- Map of params to add@NotNull(message="request URI is never NULL") RequestURI path(@NotNull(message="path can\'t be NULL") String segment)
segment
- Path segment to addCopyright © 2012–2014 jcabi.com. All rights reserved.