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, statuspublic Response.ResponseBuilder entityWithType(java.lang.Object entity, java.lang.reflect.Type entityType)
public Response build()
Response.ResponseBuilderbuild in class Response.ResponseBuilderpublic Response.ResponseBuilder clone()
Response.ResponseBuilderclone in class Response.ResponseBuilderpublic Response.ResponseBuilder status(Response.StatusType status)
Response.ResponseBuilderstatus in class Response.ResponseBuilderstatus - the response statuspublic Response.ResponseBuilder status(int status)
Response.ResponseBuilderstatus in class Response.ResponseBuilderstatus - the response statuspublic Response.ResponseBuilder entity(java.lang.Object entity)
Response.ResponseBuilderGenericEntity if preservation of its generic type is required.entity in class Response.ResponseBuilderentity - the response entitypublic Response.ResponseBuilder type(MediaType type)
Response.ResponseBuildertype in class Response.ResponseBuildertype - 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.ResponseBuildertype in class Response.ResponseBuildertype - the media type of the response entity, if null any
existing value for type will be removedpublic Response.ResponseBuilder variant(Variant variant)
Response.ResponseBuildervariant in class Response.ResponseBuildervariant - 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.ResponseBuildervariants in class Response.ResponseBuildervariants - 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.ResponseBuilderlanguage in class Response.ResponseBuilderlanguage - the language of the response entity, if null any
existing value for language will be removedpublic Response.ResponseBuilder language(java.util.Locale language)
Response.ResponseBuilderlanguage in class Response.ResponseBuilderlanguage - the language of the response entity, if null any
existing value for type will be removedpublic Response.ResponseBuilder location(java.net.URI location)
Response.ResponseBuilderlocation in class Response.ResponseBuilderlocation - 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.ResponseBuildercontentLocation in class Response.ResponseBuilderlocation - 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.ResponseBuildertag in class Response.ResponseBuildertag - the entity tag, if null any
existing entity tag value will be removed.public Response.ResponseBuilder tag(java.lang.String tag)
Response.ResponseBuildertag(new EntityTag(value)).tag in class Response.ResponseBuildertag - 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.ResponseBuilderlastModified in class Response.ResponseBuilderlastModified - the last modified date, if null any existing
last modified value will be removed.public Response.ResponseBuilder cacheControl(CacheControl cacheControl)
Response.ResponseBuildercacheControl in class Response.ResponseBuildercacheControl - the cache control directives, if null removes any
existing cache control directives.public Response.ResponseBuilder expires(java.util.Date expires)
Response.ResponseBuilderexpires in class Response.ResponseBuilderexpires - the expiration date, if null removes any existing
expires value.public Response.ResponseBuilder cookie(NewCookie... cookies)
Response.ResponseBuildercookie in class Response.ResponseBuildercookies - 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.ResponseBuilderheader in class Response.ResponseBuildername - 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.