public final class ResponseBuilderImpl extends Response.ResponseBuilder
Response.ResponseBuilder
.Constructor and Description |
---|
ResponseBuilderImpl() |
Modifier and Type | Method and Description |
---|---|
Response |
build()
Create a Response instance from the current ResponseBuilder.
|
Response.ResponseBuilder |
cacheControl(CacheControl cacheControl)
Set the cache control data on the ResponseBuilder.
|
Response.ResponseBuilder |
clone()
Create a copy of the ResponseBuilder preserving its state.
|
Response.ResponseBuilder |
contentLocation(java.net.URI location)
Set the content location on the ResponseBuilder.
|
Response.ResponseBuilder |
cookie(NewCookie... cookies)
Add cookies to the ResponseBuilder.
|
Response.ResponseBuilder |
encoding(java.lang.String encoding) |
Response.ResponseBuilder |
entity(java.lang.Object entity)
Set the entity on the ResponseBuilder.
|
Response.ResponseBuilder |
entityWithType(java.lang.Object entity,
java.lang.reflect.Type entityType) |
Response.ResponseBuilder |
expires(java.util.Date expires)
Set the expires date on the ResponseBuilder.
|
Response.ResponseBuilder |
header(java.lang.String name,
java.lang.Object value)
Add a header to the ResponseBuilder.
|
Response.ResponseBuilder |
header(java.lang.String name,
java.lang.Object value,
boolean single) |
Response.ResponseBuilder |
headerSingle(java.lang.String name,
java.lang.Object value) |
Response.ResponseBuilder |
language(java.util.Locale language)
Set the language on the ResponseBuilder.
|
Response.ResponseBuilder |
language(java.lang.String language)
Set the language on the ResponseBuilder.
|
Response.ResponseBuilder |
lastModified(java.util.Date lastModified)
Set the last modified date on the ResponseBuilder.
|
Response.ResponseBuilder |
location(java.net.URI location)
Set the location on the ResponseBuilder.
|
Response.ResponseBuilder |
status(int status)
Set the status on the ResponseBuilder.
|
Response.ResponseBuilder |
status(Response.StatusType status)
Set the status on the ResponseBuilder.
|
Response.ResponseBuilder |
tag(EntityTag tag)
Set an entity tag on the ResponseBuilder.
|
Response.ResponseBuilder |
tag(java.lang.String tag)
Set a strong entity tag on the ResponseBuilder.
|
Response.ResponseBuilder |
type(MediaType type)
Set the response media type on the ResponseBuilder.
|
Response.ResponseBuilder |
type(java.lang.String type)
Set the response media type on the ResponseBuilder.
|
Response.ResponseBuilder |
variant(Variant variant)
Set representation metadata on the ResponseBuilder.
|
Response.ResponseBuilder |
variants(java.util.List<Variant> variants)
Add a Vary header that lists the available variants.
|
newInstance, status
public Response.ResponseBuilder entityWithType(java.lang.Object entity, java.lang.reflect.Type entityType)
public Response build()
Response.ResponseBuilder
build
in class Response.ResponseBuilder
public Response.ResponseBuilder clone()
Response.ResponseBuilder
clone
in class Response.ResponseBuilder
public Response.ResponseBuilder status(Response.StatusType status)
Response.ResponseBuilder
status
in class Response.ResponseBuilder
status
- the response statuspublic Response.ResponseBuilder status(int status)
Response.ResponseBuilder
status
in class Response.ResponseBuilder
status
- the response statuspublic Response.ResponseBuilder entity(java.lang.Object entity)
Response.ResponseBuilder
GenericEntity
if preservation of its generic type is required.entity
in class Response.ResponseBuilder
entity
- the response entitypublic Response.ResponseBuilder type(MediaType type)
Response.ResponseBuilder
type
in class Response.ResponseBuilder
type
- the media type of the response entity, if null any
existing value for type will be removedpublic Response.ResponseBuilder type(java.lang.String type)
Response.ResponseBuilder
type
in class Response.ResponseBuilder
type
- the media type of the response entity, if null any
existing value for type will be removedpublic Response.ResponseBuilder variant(Variant variant)
Response.ResponseBuilder
variant
in class Response.ResponseBuilder
variant
- metadata of the response entity, a null value is
equivalent to a variant with all null properties.public Response.ResponseBuilder variants(java.util.List<Variant> variants)
Response.ResponseBuilder
variants
in class Response.ResponseBuilder
variants
- a list of available representation variants, a null
value will remove an existing value for vary.public Response.ResponseBuilder language(java.lang.String language)
Response.ResponseBuilder
language
in class Response.ResponseBuilder
language
- the language of the response entity, if null any
existing value for language will be removedpublic Response.ResponseBuilder language(java.util.Locale language)
Response.ResponseBuilder
language
in class Response.ResponseBuilder
language
- the language of the response entity, if null any
existing value for type will be removedpublic Response.ResponseBuilder location(java.net.URI location)
Response.ResponseBuilder
location
in class Response.ResponseBuilder
location
- the location. If a relative URI is
supplied it will be converted into an absolute URI by resolving it
relative to the base URI of the application (see
UriInfo.getBaseUri()
). If null any
existing value for location will be removed.public Response.ResponseBuilder contentLocation(java.net.URI location)
Response.ResponseBuilder
contentLocation
in class Response.ResponseBuilder
location
- the content location. Relative or absolute URIs
may be used for the value of content location. If null any
existing value for content location will be removed.public Response.ResponseBuilder encoding(java.lang.String encoding)
public Response.ResponseBuilder tag(EntityTag tag)
Response.ResponseBuilder
tag
in class Response.ResponseBuilder
tag
- the entity tag, if null any
existing entity tag value will be removed.public Response.ResponseBuilder tag(java.lang.String tag)
Response.ResponseBuilder
tag(new EntityTag(value))
.tag
in class Response.ResponseBuilder
tag
- the string content of a strong entity tag. The JAX-RS
runtime will quote the supplied value when creating the header. If
null any existing entity tag value will be removed.public Response.ResponseBuilder lastModified(java.util.Date lastModified)
Response.ResponseBuilder
lastModified
in class Response.ResponseBuilder
lastModified
- the last modified date, if null any existing
last modified value will be removed.public Response.ResponseBuilder cacheControl(CacheControl cacheControl)
Response.ResponseBuilder
cacheControl
in class Response.ResponseBuilder
cacheControl
- the cache control directives, if null removes any
existing cache control directives.public Response.ResponseBuilder expires(java.util.Date expires)
Response.ResponseBuilder
expires
in class Response.ResponseBuilder
expires
- the expiration date, if null removes any existing
expires value.public Response.ResponseBuilder cookie(NewCookie... cookies)
Response.ResponseBuilder
cookie
in class Response.ResponseBuilder
cookies
- new cookies that will accompany the response. A null
value will remove all cookies, including those added via the
Response.ResponseBuilder.header(java.lang.String, java.lang.Object)
method.public Response.ResponseBuilder header(java.lang.String name, java.lang.Object value)
Response.ResponseBuilder
header
in class Response.ResponseBuilder
name
- the name of the headervalue
- the value of the header, the header will be serialized
using a RuntimeDelegate.HeaderDelegate
if
one is available via
RuntimeDelegate.createHeaderDelegate(java.lang.Class)
for the class of value
or using its toString
method if a
header delegate is not available. If value
is null then all
current headers of the same name will be removed.public Response.ResponseBuilder headerSingle(java.lang.String name, java.lang.Object value)
public Response.ResponseBuilder header(java.lang.String name, java.lang.Object value, boolean single)
Copyright © 2016 Oracle Corporation. All Rights Reserved.