public class ViewResource extends Filterable implements RequestBuilder<ViewResource.Builder>, ViewUniformInterface
Modifier and Type | Class and Description |
---|---|
class |
ViewResource.Builder
The builder for building a
ClientRequest instance and
handling the request using the UniformInterface . |
Modifier and Type | Method and Description |
---|---|
ViewResource.Builder |
accept(MediaType... types)
Add acceptable media types.
|
ViewResource.Builder |
accept(java.lang.String... types)
Add acceptable media types.
|
ViewResource.Builder |
acceptLanguage(java.util.Locale... locales)
Add acceptable languages
|
ViewResource.Builder |
acceptLanguage(java.lang.String... locales)
Add acceptable languages
|
ViewResource.Builder |
cookie(Cookie cookie)
Add a cookie to be set.
|
<T> T |
delete(java.lang.Class<T> c) |
<T> T |
delete(java.lang.Class<T> c,
java.lang.Object requestEntity) |
<T> T |
delete(T t) |
<T> T |
delete(T t,
java.lang.Object requestEntity) |
ViewResource.Builder |
entity(java.lang.Object entity)
Set the request entity.
|
ViewResource.Builder |
entity(java.lang.Object entity,
MediaType type)
Set the request entity with its media type.
|
ViewResource.Builder |
entity(java.lang.Object entity,
java.lang.String type)
Set the request entity with its media type.
|
boolean |
equals(java.lang.Object obj)
Compares this resource to the specified object.
|
<T> T |
get(java.lang.Class<T> c) |
<T> T |
get(T t) |
ViewResource.Builder |
getRequestBuilder()
Get the ClientRequest builder.
|
java.net.URI |
getURI()
Get the URI to the resource.
|
UriBuilder |
getUriBuilder()
Get the URI builder to the resource.
|
int |
hashCode()
Returns a hash code for this
WebResource . |
<T> T |
head(java.lang.Class<T> c) |
<T> T |
head(T t) |
ViewResource.Builder |
header(java.lang.String name,
java.lang.Object value)
Add an HTTP header and value.
|
<T> T |
method(java.lang.String method,
java.lang.Class<T> c) |
<T> T |
method(java.lang.String method,
java.lang.Class<T> c,
java.lang.Object requestEntity) |
<T> T |
method(java.lang.String method,
T t) |
<T> T |
method(java.lang.String method,
T t,
java.lang.Object requestEntity) |
<T> T |
options(java.lang.Class<T> c) |
<T> T |
options(T t) |
ViewResource |
path(java.lang.String path)
Create a new WebResource from this web resource with an additional path
added to the URI of this web resource.
|
<T> T |
post(java.lang.Class<T> c) |
<T> T |
post(java.lang.Class<T> c,
java.lang.Object requestEntity) |
<T> T |
post(T t) |
<T> T |
post(T t,
java.lang.Object requestEntity) |
<T> T |
put(java.lang.Class<T> c) |
<T> T |
put(java.lang.Class<T> c,
java.lang.Object requestEntity) |
<T> T |
put(T t) |
<T> T |
put(T t,
java.lang.Object requestEntity) |
ViewResource |
queryParam(java.lang.String key,
java.lang.String value)
Create a new WebResource from this web resource with an additional
query parameter added to the URI of this web resource.
|
ViewResource |
queryParams(MultivaluedMap<java.lang.String,java.lang.String> params)
Create a new WebResource from this web resource with additional
query parameters added to the URI of this web resource.
|
java.lang.String |
toString() |
ViewResource.Builder |
type(MediaType type)
Set the media type.
|
ViewResource.Builder |
type(java.lang.String type)
Set the media type.
|
ViewResource |
uri(java.net.URI uri)
Create a new WebResource from this web resource.
|
addFilter, getHeadHandler, isFilterPresent, isFilterPreset, removeAllFilters, removeFilter
public java.net.URI getURI()
public UriBuilder getUriBuilder()
public ViewResource.Builder getRequestBuilder()
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
WebResource
.
The hash code is the hash code of URI of this
WebResource
.
hashCode
in class java.lang.Object
WebResource
.public boolean equals(java.lang.Object obj)
The result is true if and only if the argument is not null and is a
WebResource
object whose URI is equal to the URI of this
WebResource
.
equals
in class java.lang.Object
obj
- the object to compare this WebResource
against.WebResource
are equal; false otherwise.public <T> T head(java.lang.Class<T> c)
head
in interface ViewUniformInterface
public <T> T head(T t)
head
in interface ViewUniformInterface
public <T> T options(java.lang.Class<T> c)
options
in interface ViewUniformInterface
public <T> T options(T t)
options
in interface ViewUniformInterface
public <T> T get(java.lang.Class<T> c)
get
in interface ViewUniformInterface
public <T> T get(T t)
get
in interface ViewUniformInterface
public <T> T put(java.lang.Class<T> c)
put
in interface ViewUniformInterface
public <T> T put(T t)
put
in interface ViewUniformInterface
public <T> T put(java.lang.Class<T> c, java.lang.Object requestEntity)
put
in interface ViewUniformInterface
public <T> T put(T t, java.lang.Object requestEntity)
put
in interface ViewUniformInterface
public <T> T post(java.lang.Class<T> c)
post
in interface ViewUniformInterface
public <T> T post(T t)
post
in interface ViewUniformInterface
public <T> T post(java.lang.Class<T> c, java.lang.Object requestEntity)
post
in interface ViewUniformInterface
public <T> T post(T t, java.lang.Object requestEntity)
post
in interface ViewUniformInterface
public <T> T delete(java.lang.Class<T> c)
delete
in interface ViewUniformInterface
public <T> T delete(T t)
delete
in interface ViewUniformInterface
public <T> T delete(java.lang.Class<T> c, java.lang.Object requestEntity)
delete
in interface ViewUniformInterface
public <T> T delete(T t, java.lang.Object requestEntity)
delete
in interface ViewUniformInterface
public <T> T method(java.lang.String method, java.lang.Class<T> c)
method
in interface ViewUniformInterface
public <T> T method(java.lang.String method, T t)
method
in interface ViewUniformInterface
public <T> T method(java.lang.String method, java.lang.Class<T> c, java.lang.Object requestEntity)
method
in interface ViewUniformInterface
public <T> T method(java.lang.String method, T t, java.lang.Object requestEntity)
method
in interface ViewUniformInterface
public ViewResource.Builder entity(java.lang.Object entity)
RequestBuilder
Any Java type instance for a request entity, that is supported by the client
configuration of the client, can be passed. If generic information is
required then an instance of GenericEntity
may
be used.
entity
in interface RequestBuilder<ViewResource.Builder>
entity
- the request entitypublic ViewResource.Builder entity(java.lang.Object entity, MediaType type)
RequestBuilder
Any Java type instance for a request entity, that is supported by the client
configuration of the client, can be passed. If generic information is
required then an instance of GenericEntity
may
be used.
entity
in interface RequestBuilder<ViewResource.Builder>
entity
- the request entitytype
- the media typepublic ViewResource.Builder entity(java.lang.Object entity, java.lang.String type)
RequestBuilder
Any Java type instance for a request entity, that is supported by the client
configuration of the client, can be passed. If generic information is
required then an instance of GenericEntity
may
be used.
entity
in interface RequestBuilder<ViewResource.Builder>
entity
- the request entitytype
- the media typepublic ViewResource.Builder type(MediaType type)
RequestBuilder
type
in interface RequestBuilder<ViewResource.Builder>
type
- the media typepublic ViewResource.Builder type(java.lang.String type)
RequestBuilder
type
in interface RequestBuilder<ViewResource.Builder>
type
- the media typepublic ViewResource.Builder accept(MediaType... types)
RequestBuilder
accept
in interface RequestBuilder<ViewResource.Builder>
types
- an array of the acceptable media typespublic ViewResource.Builder accept(java.lang.String... types)
RequestBuilder
accept
in interface RequestBuilder<ViewResource.Builder>
types
- an array of the acceptable media typespublic ViewResource.Builder acceptLanguage(java.util.Locale... locales)
RequestBuilder
acceptLanguage
in interface RequestBuilder<ViewResource.Builder>
locales
- an array of the acceptable languagespublic ViewResource.Builder acceptLanguage(java.lang.String... locales)
RequestBuilder
acceptLanguage
in interface RequestBuilder<ViewResource.Builder>
locales
- an array of the acceptable languagespublic ViewResource.Builder cookie(Cookie cookie)
RequestBuilder
cookie
in interface RequestBuilder<ViewResource.Builder>
cookie
- to be set.public ViewResource.Builder header(java.lang.String name, java.lang.Object value)
RequestBuilder
header
in interface RequestBuilder<ViewResource.Builder>
name
- the HTTP header name.value
- the HTTP header value.public ViewResource path(java.lang.String path)
Any filters on this web resource are inherited. Removal of filters may cause undefined behaviour.
path
- the additional path.public ViewResource uri(java.net.URI uri)
If the URI contains a path component and the path starts with a '/' then the path of this web resource URI is replaced. Otherwise the path is appended.
If the URI contains query parameters then those query parameters will replace the query parameters (if any) of this web resource.
Any filters on this web resource are inherited. Removal of filters may cause undefined behaviour.
uri
- the URI.public ViewResource queryParam(java.lang.String key, java.lang.String value)
key
- the query parameter namevalue
- the query parameter valuepublic ViewResource queryParams(MultivaluedMap<java.lang.String,java.lang.String> params)
params
- the query parameters.Copyright © 2016 Oracle Corporation. All Rights Reserved.