Class AbstractRestResponseBuilder<T>
java.lang.Object
org.jboss.resteasy.reactive.RestResponse.ResponseBuilder<T>
org.jboss.resteasy.reactive.common.jaxrs.AbstractRestResponseBuilder<T>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Objectprotected Annotation[]protected MultivaluedTreeMap<String,Object> protected Stringprotected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSet the list of allowed methods for the resource.Set the list of allowed methods for the resource.build()Create a RestResponse instance from the current ResponseBuilder.build(boolean copyHeaders) cacheControl(jakarta.ws.rs.core.CacheControl cacheControl) Set the cache control data of the message.clone()cookie(jakarta.ws.rs.core.NewCookie... cookies) Add cookies to the response message.static StringcreateVaryHeader(List<jakarta.ws.rs.core.Variant> variants) protected abstract AbstractRestResponseBuilder<T>doClone()Set the message entity content encoding.Set the response entity in the builder.entity(T entity, Annotation[] annotations) Set the response entity in the builder.Set the response expiration date.static SimpleDateFormatintAdd an arbitrary header.Set the message entity language.Set the message entity language.lastModified(Date lastModified) Set the response entity last modification date.Add a link header.Add a link header.links(jakarta.ws.rs.core.Link... links) Add one or more link headers.<OtherT extends RestResponseImpl<T>>
OtherTpopulateResponse(OtherT response) Populates a response with the standard data<OtherT extends RestResponseImpl<T>>
OtherTpopulateResponse(OtherT response, boolean copyHeaders) replaceAll(jakarta.ws.rs.core.MultivaluedMap<String, Object> headers) Replaces all existing headers with the newly supplied headers.voidsetAllHeaders(jakarta.ws.rs.core.MultivaluedMap<String, String> values) voidsetEntityAnnotations(Annotation[] entityAnnotations) <Ret extends T>
RestResponse.ResponseBuilder<Ret>status(int status) Set the status on the ResponseBuilder.<Ret extends T>
RestResponse.ResponseBuilder<Ret>Set the status on the ResponseBuilder.tag(jakarta.ws.rs.core.EntityTag tag) Set a response entity tag.Set a strong response entity tag.type(jakarta.ws.rs.core.MediaType type) Set the message entity media type.Set the message entity media type.variant(jakarta.ws.rs.core.Variant variant) Set message entity representation metadata.variants(jakarta.ws.rs.core.Variant... variants) Add a Vary header that lists the available variants.Add a Vary header that lists the available variants.Methods inherited from class org.jboss.resteasy.reactive.RestResponse.ResponseBuilder
accepted, accepted, contentLocation, create, create, create, create, create, create, created, fromResponse, location, newInstance, noContent, notAcceptable, notFound, notModified, notModified, notModified, ok, ok, ok, ok, ok, seeOther, serverError, status, status, temporaryRedirect
-
Field Details
-
status
protected int status -
reasonPhrase
-
entity
-
metadata
-
entityAnnotations
-
-
Constructor Details
-
AbstractRestResponseBuilder
public AbstractRestResponseBuilder()
-
-
Method Details
-
getDateFormatRFC822
-
createVaryHeader
-
getStatus
public int getStatus() -
getReasonPhrase
-
getEntity
-
getEntityAnnotations
-
setEntityAnnotations
-
build
Description copied from class:RestResponse.ResponseBuilderCreate a RestResponse instance from the current ResponseBuilder. The builder is reset to a blank state equivalent to calling the ok method.- Specified by:
buildin classRestResponse.ResponseBuilder<T>- Returns:
- a RestResponse instance.
-
build
-
populateResponse
Populates a response with the standard data- Returns:
- The given response
-
populateResponse
public <OtherT extends RestResponseImpl<T>> OtherT populateResponse(OtherT response, boolean copyHeaders) -
setAllHeaders
-
doClone
-
clone
Description copied from class:RestResponse.ResponseBuilderCreate a copy of the ResponseBuilder preserving its state.
- Specified by:
clonein classRestResponse.ResponseBuilder<T>- Returns:
- a copy of the ResponseBuilder.
-
status
Description copied from class:RestResponse.ResponseBuilderSet the status on the ResponseBuilder.- Specified by:
statusin classRestResponse.ResponseBuilder<T>- Parameters:
status- the response status.reasonPhrase- the reason phrase.- Returns:
- the updated response builder.
-
status
Description copied from class:RestResponse.ResponseBuilderSet the status on the ResponseBuilder.- Specified by:
statusin classRestResponse.ResponseBuilder<T>- Parameters:
status- the response status.- Returns:
- the updated response builder.
-
entity
Description copied from class:RestResponse.ResponseBuilderSet the response entity in the builder. Any Java type instance for a response entity, that is supported by the runtime can be passed. It is the callers responsibility to wrap the actual entity withGenericEntityif preservation of its generic type is required. Note that the entity can be also set as aninput stream. A specific entity media type can be set using one of thetype(...)methods.- Specified by:
entityin classRestResponse.ResponseBuilder<T>- Parameters:
entity- the request entity.- Returns:
- updated response builder instance.
- See Also:
-
entity
Description copied from class:RestResponse.ResponseBuilderSet the response entity in the builder. Any Java type instance for a response entity, that is supported by the runtime can be passed. It is the callers responsibility to wrap the actual entity withGenericEntityif preservation of its generic type is required. Note that the entity can be also set as aninput stream. A specific entity media type can be set using one of thetype(...)methods.- Specified by:
entityin classRestResponse.ResponseBuilder<T>- Parameters:
entity- the request entity.annotations- annotations that will be passed to theMessageBodyWriter, (in addition to any annotations declared directly on a resource method that returns the built response).- Returns:
- updated response builder instance.
- See Also:
-
type
Description copied from class:RestResponse.ResponseBuilderSet the message entity media type.- Specified by:
typein classRestResponse.ResponseBuilder<T>- Parameters:
type- the media type of the message entity. Ifnull, any existing value for type will be removed.- Returns:
- the updated response builder.
-
type
Description copied from class:RestResponse.ResponseBuilderSet the message entity media type.- Specified by:
typein classRestResponse.ResponseBuilder<T>- Parameters:
type- the media type of the message entity. Ifnull, any existing value for type will be removed.- Returns:
- the updated response builder.
-
variant
Description copied from class:RestResponse.ResponseBuilderSet message entity representation metadata. Equivalent to setting the values of content type, content language, and content encoding separately using the values of the variant properties.- Specified by:
variantin classRestResponse.ResponseBuilder<T>- Parameters:
variant- metadata of the message entity, anullvalue is equivalent to a variant with allnullproperties.- Returns:
- the updated response builder.
- See Also:
-
variants
Description copied from class:RestResponse.ResponseBuilderAdd a Vary header that lists the available variants.- Specified by:
variantsin classRestResponse.ResponseBuilder<T>- Parameters:
variants- a list of available representation variants, anullvalue will remove an existing value for Vary header.- Returns:
- the updated response builder.
-
language
Description copied from class:RestResponse.ResponseBuilderSet the message entity language.- Specified by:
languagein classRestResponse.ResponseBuilder<T>- Parameters:
language- the language of the message entity, ifnullany existing value for language will be removed.- Returns:
- the updated response builder.
-
tag
Description copied from class:RestResponse.ResponseBuilderSet a response entity tag.- Specified by:
tagin classRestResponse.ResponseBuilder<T>- Parameters:
tag- the entity tag, ifnullany existing entity tag value will be removed.- Returns:
- the updated response builder.
-
tag
Description copied from class:RestResponse.ResponseBuilderSet a strong response entity tag. This is a shortcut fortag(new EntityTag(value)).- Specified by:
tagin classRestResponse.ResponseBuilder<T>- Parameters:
tag- the string content of a strong entity tag. The runtime will quote the supplied value when creating the header. Ifnullany existing entity tag value will be removed.- Returns:
- the updated response builder.
-
lastModified
Description copied from class:RestResponse.ResponseBuilderSet the response entity last modification date.- Specified by:
lastModifiedin classRestResponse.ResponseBuilder<T>- Parameters:
lastModified- the last modified date, ifnullany existing last modified value will be removed.- Returns:
- the updated response builder.
-
cacheControl
Description copied from class:RestResponse.ResponseBuilderSet the cache control data of the message.- Specified by:
cacheControlin classRestResponse.ResponseBuilder<T>- Parameters:
cacheControl- the cache control directives, ifnullany existing cache control directives will be removed.- Returns:
- the updated response builder.
-
header
Description copied from class:RestResponse.ResponseBuilderAdd an arbitrary header.- Specified by:
headerin classRestResponse.ResponseBuilder<T>- Parameters:
name- the name of the headervalue- the value of the header, the header will be serialized using aRuntimeDelegate.HeaderDelegateif one is available viaRuntimeDelegate.createHeaderDelegate(java.lang.Class)for the class ofvalueor using itstoStringmethod if a header delegate is not available. Ifvalueisnullthen all current headers of the same name will be removed.- Returns:
- the updated response builder.
-
cookie
Description copied from class:RestResponse.ResponseBuilderAdd cookies to the response message.- Specified by:
cookiein classRestResponse.ResponseBuilder<T>- Parameters:
cookies- new cookies that will accompany the response. Anullvalue will remove all cookies, including those added via theRestResponse.ResponseBuilder.header(java.lang.String, java.lang.Object)method.- Returns:
- the updated response builder.
-
language
Description copied from class:RestResponse.ResponseBuilderSet the message entity language.- Specified by:
languagein classRestResponse.ResponseBuilder<T>- Parameters:
language- the language of the message entity, ifnullany existing value for type will be removed.- Returns:
- the updated response builder.
-
expires
Description copied from class:RestResponse.ResponseBuilderSet the response expiration date.- Specified by:
expiresin classRestResponse.ResponseBuilder<T>- Parameters:
expires- the expiration date, ifnullremoves any existing expires value.- Returns:
- the updated response builder.
-
allow
Description copied from class:RestResponse.ResponseBuilderSet the list of allowed methods for the resource. Any duplicate method names will be truncated to a single entry.- Specified by:
allowin classRestResponse.ResponseBuilder<T>- Parameters:
methods- the methods to be listed as allowed for the resource, ifnullany existing allowed method list will be removed.- Returns:
- the updated response builder.
-
allow
Description copied from class:RestResponse.ResponseBuilderSet the list of allowed methods for the resource.- Specified by:
allowin classRestResponse.ResponseBuilder<T>- Parameters:
methods- the methods to be listed as allowed for the resource, ifnullany existing allowed method list will be removed.- Returns:
- the updated response builder.
-
encoding
Description copied from class:RestResponse.ResponseBuilderSet the message entity content encoding.- Specified by:
encodingin classRestResponse.ResponseBuilder<T>- Parameters:
encoding- the content encoding of the message entity, ifnullany existing value for content encoding will be removed.- Returns:
- the updated response builder.
-
variants
Description copied from class:RestResponse.ResponseBuilderAdd a Vary header that lists the available variants.- Specified by:
variantsin classRestResponse.ResponseBuilder<T>- Parameters:
variants- a list of available representation variants, anullvalue will remove an existing value for Vary header.- Returns:
- the updated response builder.
-
links
Description copied from class:RestResponse.ResponseBuilderAdd one or more link headers.- Specified by:
linksin classRestResponse.ResponseBuilder<T>- Parameters:
links- links to be added to the message as headers, anullvalue will remove any existing Link headers.- Returns:
- the updated response builder.
-
link
Description copied from class:RestResponse.ResponseBuilderAdd a link header.- Specified by:
linkin classRestResponse.ResponseBuilder<T>- Parameters:
uri- underlying URI for link header.rel- value of "rel" parameter.- Returns:
- the updated response builder.
-
link
Description copied from class:RestResponse.ResponseBuilderAdd a link header.- Specified by:
linkin classRestResponse.ResponseBuilder<T>- Parameters:
uri- underlying URI for link header.rel- value of "rel" parameter.- Returns:
- the updated response builder.
-
replaceAll
public RestResponse.ResponseBuilder<T> replaceAll(jakarta.ws.rs.core.MultivaluedMap<String, Object> headers) Description copied from class:RestResponse.ResponseBuilderReplaces all existing headers with the newly supplied headers.- Specified by:
replaceAllin classRestResponse.ResponseBuilder<T>- Parameters:
headers- new headers to be set, ifnullall existing headers will be removed.- Returns:
- the updated response builder.
-
getMetadata
-