Package io.micronaut.jaxrs.common
Class JaxRsResponse
java.lang.Object
jakarta.ws.rs.core.Response
io.micronaut.jaxrs.common.JaxRsResponse
- All Implemented Interfaces:
HttpResponseProvider,AutoCloseable
- Direct Known Subclasses:
JaxRsMutableResponse
@Internal
public sealed class JaxRsResponse
extends Response
implements HttpResponseProvider
permits JaxRsMutableResponse
Adapter for JAX-RS and final Micronaut response.
- Since:
- 1.0.0
- Author:
- graemerocher
-
Nested Class Summary
Nested classes/interfaces inherited from class jakarta.ws.rs.core.Response
Response.ResponseBuilder, Response.Status, Response.StatusType -
Constructor Summary
ConstructorsConstructorDescriptionJaxRsResponse(HttpResponse<?> response) JaxRsResponse(HttpResponse<?> response, HttpMessageEntityReader entityReader) -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidclose()getDate()getHeaderString(String name) intgetLinkBuilder(String relation) getLinks()HttpResponse<?>intbooleanboolean<T> TreadEntity(Argument<T> entityType) Read the entity.<T> TreadEntity(GenericType<T> entityType) <T> TreadEntity(GenericType<T> entityType, Annotation[] annotations) <T> TreadEntity(Class<T> entityType) <T> TreadEntity(Class<T> entityType, Annotation[] annotations) withEntityReader(HttpMessageEntityReader entityReader) Add the entity reader to the response.Methods inherited from class jakarta.ws.rs.core.Response
accepted, accepted, created, fromResponse, isClosed, noContent, notAcceptable, notModified, notModified, notModified, ok, ok, ok, ok, ok, seeOther, serverError, status, status, status, status, temporaryRedirect
-
Constructor Details
-
JaxRsResponse
-
JaxRsResponse
-
-
Method Details
-
withEntityReader
Add the entity reader to the response.- Parameters:
entityReader- The entity reader- Returns:
- A new response
-
getResponse
- Specified by:
getResponsein interfaceHttpResponseProvider- Returns:
- The Micronaut response object
-
getStatus
public int getStatus() -
getStatusInfo
- Specified by:
getStatusInfoin classResponse
-
getEntity
-
readEntity
Read the entity.- Type Parameters:
T- The entity type- Parameters:
entityType- The entity argument- Returns:
- The entity value
-
readEntity
- Specified by:
readEntityin classResponse
-
readEntity
- Specified by:
readEntityin classResponse
-
readEntity
- Specified by:
readEntityin classResponse
-
readEntity
- Specified by:
readEntityin classResponse
-
hasEntity
public boolean hasEntity() -
bufferEntity
public boolean bufferEntity()- Specified by:
bufferEntityin classResponse
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein classResponse
-
getMediaType
- Specified by:
getMediaTypein classResponse
-
getLanguage
- Specified by:
getLanguagein classResponse
-
getLength
public int getLength() -
getAllowedMethods
- Specified by:
getAllowedMethodsin classResponse
-
getCookies
- Specified by:
getCookiesin classResponse
-
getEntityTag
- Specified by:
getEntityTagin classResponse
-
getDate
-
getLastModified
- Specified by:
getLastModifiedin classResponse
-
getLocation
- Specified by:
getLocationin classResponse
-
getLinks
-
hasLink
-
getLink
-
getLinkBuilder
- Specified by:
getLinkBuilderin classResponse
-
getStringHeaders
- Specified by:
getStringHeadersin classResponse
-
getHeaderString
- Specified by:
getHeaderStringin classResponse
-
getMetadata
- Specified by:
getMetadatain classResponse
-
getHeaders
- Overrides:
getHeadersin classResponse
-