Package io.micronaut.jaxrs.common
Class JaxRsMutableResponse
java.lang.Object
jakarta.ws.rs.core.Response
io.micronaut.jaxrs.common.JaxRsResponse
io.micronaut.jaxrs.common.JaxRsMutableResponse
- All Implemented Interfaces:
HttpResponseProvider
,AutoCloseable
@Internal
public final class JaxRsMutableResponse
extends JaxRsResponse
implements HttpResponseProvider
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
ConstructorDescriptionJaxRsMutableResponse
(MutableHttpResponse<?> mutableHttpResponse) JaxRsMutableResponse
(MutableHttpResponse<?> mutableHttpResponse, HttpMessageEntityReader entityReader) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
boolean
<T> T
readEntity
(Argument<T> entityType) Read the entity.void
setEntityStream
(InputStream entityStream) withEntityReader
(HttpMessageEntityReader entityReader) Add the entity reader to the response.Methods inherited from class io.micronaut.jaxrs.common.JaxRsResponse
bufferEntity, getAllowedMethods, getCookies, getDate, getEntity, getEntityTag, getHeaderString, getLanguage, getLastModified, getLength, getLink, getLinkBuilder, getLinks, getLocation, getMediaType, getMetadata, getStatus, getStatusInfo, hasLink, readEntity, readEntity, readEntity, readEntity
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
-
JaxRsMutableResponse
-
JaxRsMutableResponse
public JaxRsMutableResponse(MutableHttpResponse<?> mutableHttpResponse, HttpMessageEntityReader entityReader)
-
-
Method Details
-
hasEntity
public boolean hasEntity()- Overrides:
hasEntity
in classJaxRsResponse
-
readEntity
Description copied from class:JaxRsResponse
Read the entity.- Overrides:
readEntity
in classJaxRsResponse
- Type Parameters:
T
- The entity type- Parameters:
entityType
- The entity argument- Returns:
- The entity value
-
getStringHeaders
- Overrides:
getStringHeaders
in classJaxRsResponse
-
withEntityReader
Description copied from class:JaxRsResponse
Add the entity reader to the response.- Overrides:
withEntityReader
in classJaxRsResponse
- Parameters:
entityReader
- The entity reader- Returns:
- A new response
-
getResponse
- Specified by:
getResponse
in interfaceHttpResponseProvider
- Overrides:
getResponse
in classJaxRsResponse
- Returns:
- The Micronaut response object
-
getHeaders
- Overrides:
getHeaders
in classJaxRsResponse
-
getEntityStream
-
setEntityStream
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Overrides:
close
in classJaxRsResponse
-