com.sun.jersey.api.client
Interface RequestBuilder<T extends RequestBuilder>

Type Parameters:
T - the type than implements RequestBuilder.
All Known Implementing Classes:
AsyncViewResource, AsyncViewResource.Builder, AsyncWebResource, AsyncWebResource.Builder, ClientRequest.Builder, PartialRequestBuilder, ViewResource, ViewResource.Builder, WebResource, WebResource.Builder

public interface RequestBuilder<T extends RequestBuilder>

An interface for building requests. The build methods for constructing the request from the built information are left undefined and implementations must define such methods.

Author:
Paul.Sandoz@Sun.Com

Method Summary
 T accept(MediaType... types)
          Add acceptable media types.
 T accept(java.lang.String... types)
          Add acceptable media types.
 T acceptLanguage(java.util.Locale... locales)
          Add acceptable languages
 T acceptLanguage(java.lang.String... locales)
          Add acceptable languages
 T cookie(Cookie cookie)
          Add a cookie to be set.
 T entity(java.lang.Object entity)
          Set the request entity.
 T entity(java.lang.Object entity, MediaType type)
          Set the request entity with its media type.
 T entity(java.lang.Object entity, java.lang.String type)
          Set the request entity with its media type.
 T header(java.lang.String name, java.lang.Object value)
          Add an HTTP header and value.
 T type(MediaType type)
          Set the media type.
 T type(java.lang.String type)
          Set the media type.
 

Method Detail

entity

T entity(java.lang.Object entity)
Set the request 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.

Parameters:
entity - the request entity
Returns:
the builder.

entity

T entity(java.lang.Object entity,
         MediaType type)
Set the request entity with its media type.

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.

Parameters:
entity - the request entity
type - the media type
Returns:
the builder.

entity

T entity(java.lang.Object entity,
         java.lang.String type)
Set the request entity with its media type.

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.

Parameters:
entity - the request entity
type - the media type
Returns:
the builder.

type

T type(MediaType type)
Set the media type.

Parameters:
type - the media type
Returns:
the builder.

type

T type(java.lang.String type)
Set the media type.

Parameters:
type - the media type
Returns:
the builder.

accept

T accept(MediaType... types)
Add acceptable media types.

Parameters:
types - an array of the acceptable media types
Returns:
the builder.

accept

T accept(java.lang.String... types)
Add acceptable media types.

Parameters:
types - an array of the acceptable media types
Returns:
the builder.

acceptLanguage

T acceptLanguage(java.util.Locale... locales)
Add acceptable languages

Parameters:
locales - an array of the acceptable languages
Returns:
the builder.

acceptLanguage

T acceptLanguage(java.lang.String... locales)
Add acceptable languages

Parameters:
locales - an array of the acceptable languages
Returns:
the builder.

cookie

T cookie(Cookie cookie)
Add a cookie to be set.

Parameters:
cookie - to be set.
Returns:
the builder

header

T header(java.lang.String name,
         java.lang.Object value)
Add an HTTP header and value.

Parameters:
name - the HTTP header name.
value - the HTTP header value.
Returns:
the builder.


Copyright © 2013 Oracle Corporation. All Rights Reserved.