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
ConstructorDescriptionJaxRsResponse
(HttpResponse<?> response) JaxRsResponse
(HttpResponse<?> response, HttpMessageEntityReader entityReader) -
Method Summary
Modifier and TypeMethodDescriptionboolean
void
close()
getDate()
getHeaderString
(String name) int
getLinkBuilder
(String relation) getLinks()
HttpResponse<?>
int
boolean
boolean
<T> T
readEntity
(Argument<T> entityType) Read the entity.<T> T
readEntity
(GenericType<T> entityType) <T> T
readEntity
(GenericType<T> entityType, Annotation[] annotations) <T> T
readEntity
(Class<T> entityType) <T> T
readEntity
(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:
getResponse
in interfaceHttpResponseProvider
- Returns:
- The Micronaut response object
-
getStatus
public int getStatus() -
getStatusInfo
- Specified by:
getStatusInfo
in classResponse
-
getEntity
-
readEntity
Read the entity.- Type Parameters:
T
- The entity type- Parameters:
entityType
- The entity argument- Returns:
- The entity value
-
readEntity
- Specified by:
readEntity
in classResponse
-
readEntity
- Specified by:
readEntity
in classResponse
-
readEntity
- Specified by:
readEntity
in classResponse
-
readEntity
- Specified by:
readEntity
in classResponse
-
hasEntity
public boolean hasEntity() -
bufferEntity
public boolean bufferEntity()- Specified by:
bufferEntity
in classResponse
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in classResponse
-
getMediaType
- Specified by:
getMediaType
in classResponse
-
getLanguage
- Specified by:
getLanguage
in classResponse
-
getLength
public int getLength() -
getAllowedMethods
- Specified by:
getAllowedMethods
in classResponse
-
getCookies
- Specified by:
getCookies
in classResponse
-
getEntityTag
- Specified by:
getEntityTag
in classResponse
-
getDate
-
getLastModified
- Specified by:
getLastModified
in classResponse
-
getLocation
- Specified by:
getLocation
in classResponse
-
getLinks
-
hasLink
-
getLink
-
getLinkBuilder
- Specified by:
getLinkBuilder
in classResponse
-
getStringHeaders
- Specified by:
getStringHeaders
in classResponse
-
getHeaderString
- Specified by:
getHeaderString
in classResponse
-
getMetadata
- Specified by:
getMetadata
in classResponse
-
getHeaders
- Overrides:
getHeaders
in classResponse
-