- 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 defaultHttpResponse
implementation.
-
-
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 boolean
equals(Object o)
int
hashCode()
HttpResponse
setProtocolVersion(HttpVersion version)
Set the protocol version of thisHttpMessage
HttpResponse
setStatus(HttpResponseStatus status)
Set the status of thisHttpResponse
.HttpResponseStatus
status()
Returns the status of thisHttpResponse
.String
toString()
-
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 theHttpHeaders
singleFieldHeaders
-true
to check and enforce that headers with the same name are appended to the same entry and comma separated. See RFC 7230, 3.2.2.false
to 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:HttpResponse
Returns the status of thisHttpResponse
.- Specified by:
status
in interfaceHttpResponse
- Returns:
- The
HttpResponseStatus
of thisHttpResponse
-
setStatus
public HttpResponse setStatus(HttpResponseStatus status)
Description copied from interface:HttpResponse
Set the status of thisHttpResponse
.- Specified by:
setStatus
in interfaceHttpResponse
-
setProtocolVersion
public HttpResponse setProtocolVersion(HttpVersion version)
Description copied from interface:HttpMessage
Set the protocol version of thisHttpMessage
- Specified by:
setProtocolVersion
in interfaceHttpMessage
- Specified by:
setProtocolVersion
in interfaceHttpResponse
- Overrides:
setProtocolVersion
in classDefaultHttpMessage
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classDefaultHttpMessage
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classDefaultHttpMessage
-
-