- java.lang.Object
-
- io.netty5.handler.codec.http.DefaultHttpObject
-
- io.netty5.handler.codec.http.DefaultHttpMessage
-
- io.netty5.handler.codec.http.DefaultHttpResponse
-
- All Implemented Interfaces:
DecoderResultProvider,HttpMessage,HttpObject,HttpResponse
- Direct Known Subclasses:
DefaultFullHttpResponse
public class DefaultHttpResponse extends DefaultHttpMessage implements HttpResponse
The defaultHttpResponseimplementation.
-
-
Constructor Summary
Constructors Constructor Description DefaultHttpResponse(HttpVersion version, HttpResponseStatus status)Creates a new instance.DefaultHttpResponse(HttpVersion version, HttpResponseStatus status, boolean validateHeaders)Creates a new instance.DefaultHttpResponse(HttpVersion version, HttpResponseStatus status, boolean validateHeaders, boolean singleFieldHeaders)Creates a new instance.DefaultHttpResponse(HttpVersion version, HttpResponseStatus status, HttpHeaders headers)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)inthashCode()HttpResponsesetProtocolVersion(HttpVersion version)Set the protocol version of thisHttpMessageHttpResponsesetStatus(HttpResponseStatus status)Set the status of thisHttpResponse.HttpResponseStatusstatus()Returns the status of thisHttpResponse.StringtoString()-
Methods inherited from class io.netty5.handler.codec.http.DefaultHttpMessage
getProtocolVersion, headers, protocolVersion
-
Methods inherited from class io.netty5.handler.codec.http.DefaultHttpObject
decoderResult, setDecoderResult
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.netty5.handler.codec.DecoderResultProvider
decoderResult, setDecoderResult
-
Methods inherited from interface io.netty5.handler.codec.http.HttpMessage
getProtocolVersion, headers, protocolVersion
-
-
-
-
Constructor Detail
-
DefaultHttpResponse
public DefaultHttpResponse(HttpVersion version, HttpResponseStatus status)
Creates a new instance.- Parameters:
version- the HTTP version of this responsestatus- the status of this response
-
DefaultHttpResponse
public DefaultHttpResponse(HttpVersion version, HttpResponseStatus status, boolean validateHeaders)
Creates a new instance.- Parameters:
version- the HTTP version of this responsestatus- the status of this responsevalidateHeaders- validate the header names and values when adding them to theHttpHeaders
-
DefaultHttpResponse
public DefaultHttpResponse(HttpVersion version, HttpResponseStatus status, boolean validateHeaders, boolean singleFieldHeaders)
Creates a new instance.- Parameters:
version- the HTTP version of this responsestatus- the status of this responsevalidateHeaders- validate the header names and values when adding them to theHttpHeaderssingleFieldHeaders-trueto check and enforce that headers with the same name are appended to the same entry and comma separated. See RFC 7230, 3.2.2.falseto allow multiple header entries with the same name to coexist.
-
DefaultHttpResponse
public DefaultHttpResponse(HttpVersion version, HttpResponseStatus status, HttpHeaders headers)
Creates a new instance.- Parameters:
version- the HTTP version of this responsestatus- the status of this responseheaders- the headers for this HTTP Response
-
-
Method Detail
-
status
public HttpResponseStatus status()
Description copied from interface:HttpResponseReturns the status of thisHttpResponse.- Specified by:
statusin interfaceHttpResponse- Returns:
- The
HttpResponseStatusof thisHttpResponse
-
setStatus
public HttpResponse setStatus(HttpResponseStatus status)
Description copied from interface:HttpResponseSet the status of thisHttpResponse.- Specified by:
setStatusin interfaceHttpResponse
-
setProtocolVersion
public HttpResponse setProtocolVersion(HttpVersion version)
Description copied from interface:HttpMessageSet the protocol version of thisHttpMessage- Specified by:
setProtocolVersionin interfaceHttpMessage- Specified by:
setProtocolVersionin interfaceHttpResponse- Overrides:
setProtocolVersionin classDefaultHttpMessage
-
hashCode
public int hashCode()
- Overrides:
hashCodein classDefaultHttpMessage
-
equals
public boolean equals(Object o)
- Overrides:
equalsin classDefaultHttpMessage
-
-