public abstract class ClientRequest extends Object
Instances may be created by using the static method create()
and
methods on ClientRequest.Builder
.
Modifier and Type | Class and Description |
---|---|
static class |
ClientRequest.Builder
The builder for building a
ClientRequest instance. |
Constructor and Description |
---|
ClientRequest() |
Modifier and Type | Method and Description |
---|---|
abstract ClientRequest |
clone()
Clone the request.
|
static ClientRequest.Builder |
create()
Create a builder for building a new
ClientRequest instance. |
abstract ClientRequestAdapter |
getAdapter()
Get the client request adapter.
|
abstract Object |
getEntity()
Get the entity of the request.
|
abstract javax.ws.rs.core.MultivaluedMap<String,Object> |
getHeaders()
Get the HTTP headers of the request.
|
static String |
getHeaderValue(Object headerValue)
Convert a header value, represented as a general object, to the
string value.
|
abstract javax.ws.rs.core.MultivaluedMap<String,Object> |
getMetadata()
Deprecated.
|
abstract String |
getMethod()
Get the HTTP method of the request.
|
abstract Map<String,Object> |
getProperties()
Get the mutable property bag.
|
boolean |
getPropertyAsFeature(String name)
Get a feature that is boolean property of the property bag.
|
boolean |
getPropertyAsFeature(String name,
boolean defaultValue)
Get a feature that is boolean property of the property bag.
|
abstract URI |
getURI()
Get the URI of the request.
|
abstract void |
setAdapter(ClientRequestAdapter adapter)
Set the client request adapter.
|
abstract void |
setEntity(Object entity)
Set the entity of the request.
|
abstract void |
setMethod(String method)
Set the HTTP method of the request.
|
abstract void |
setProperties(Map<String,Object> properties)
Sets properties (replaces everything previously set).
|
abstract void |
setURI(URI uri)
Set the URI of the request.
|
public abstract Map<String,Object> getProperties()
public abstract void setProperties(Map<String,Object> properties)
public boolean getPropertyAsFeature(String name)
name
- the name of the feature;Boolean
and that value is true, otherwise false.public boolean getPropertyAsFeature(String name, boolean defaultValue)
name
- the name of the feature;defaultValue
- the default boolean value if the property is absent.Boolean
and that value is true, otherwise the
defaultValue
.public abstract URI getURI()
public abstract void setURI(URI uri)
uri
- the URI of the request.public abstract String getMethod()
public abstract void setMethod(String method)
method
- the HTTP method.public abstract Object getEntity()
public abstract void setEntity(Object entity)
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
- the entity of the request.@Deprecated public abstract javax.ws.rs.core.MultivaluedMap<String,Object> getMetadata()
public abstract javax.ws.rs.core.MultivaluedMap<String,Object> getHeaders()
public abstract ClientRequestAdapter getAdapter()
public abstract void setAdapter(ClientRequestAdapter adapter)
If an existing adapter is set then usually this adapter wrapped in the new adapter to be set such that the current adaption behavior is retained and augmented with the new adaptation behavior.
adapter
- the client request adapter.public abstract ClientRequest clone()
public static final ClientRequest.Builder create()
ClientRequest
instance.public static String getHeaderValue(Object headerValue)
This method defers to RuntimeDelegate.createHeaderDelegate(java.lang.Class<T>)
to
obtain a RuntimeDelegate.HeaderDelegate
to convert the value to a string. If
a RuntimeDelegate.HeaderDelegate
is not found then the toString
is utilized.
headerValue
- the header value as an objectCopyright © 2013 Oracle Corporation. All rights reserved.