Class Response
- java.lang.Object
-
- co.elastic.apm.agent.impl.context.Response
-
- All Implemented Interfaces:
Recyclable
public class Response extends java.lang.Object implements Recyclable
-
-
Constructor Summary
Constructors Constructor Description Response()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResponseaddHeader(java.lang.String headerName, java.lang.String headerValue)Adds a response header.ResponseaddHeader(java.lang.String headerName, java.util.Collection<java.lang.String> headerValues)voidcopyFrom(Response other)PotentiallyMultiValuedMapgetHeaders()A mapping of HTTP headers of the response objectintgetStatusCode()The HTTP status code of the response.booleanhasContent()booleanisFinished()A boolean indicating whether the response was finished or notbooleanisHeadersSent()voidresetState()resets pooled object state so it can be reusedResponsewithFinished(boolean finished)A boolean indicating whether the response was finished or notResponsewithHeadersSent(boolean headersSent)ResponsewithStatusCode(int statusCode)The HTTP status code of the response.
-
-
-
Method Detail
-
isFinished
public boolean isFinished()
A boolean indicating whether the response was finished or not
-
withFinished
public Response withFinished(boolean finished)
A boolean indicating whether the response was finished or not
-
addHeader
public Response addHeader(java.lang.String headerName, java.lang.String headerValue)
Adds a response header.- Parameters:
headerName- The name of the header.headerValue- The value of the header.- Returns:
this, for fluent method chaining
-
addHeader
public Response addHeader(java.lang.String headerName, @Nullable java.util.Collection<java.lang.String> headerValues)
-
getHeaders
public PotentiallyMultiValuedMap getHeaders()
A mapping of HTTP headers of the response object
-
isHeadersSent
public boolean isHeadersSent()
-
withHeadersSent
public Response withHeadersSent(boolean headersSent)
-
getStatusCode
public int getStatusCode()
The HTTP status code of the response.
-
withStatusCode
public Response withStatusCode(int statusCode)
The HTTP status code of the response.
-
resetState
public void resetState()
Description copied from interface:Recyclableresets pooled object state so it can be reused- Specified by:
resetStatein interfaceRecyclable
-
copyFrom
public void copyFrom(Response other)
-
hasContent
public boolean hasContent()
-
-