Package io.netty.handler.codec.http
Class DefaultHttpResponse
- java.lang.Object
-
- io.netty.handler.codec.http.DefaultHttpObject
-
- io.netty.handler.codec.http.DefaultHttpMessage
-
- io.netty.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)Deprecated.Use theDefaultHttpResponse(HttpVersion, HttpResponseStatus, HttpHeadersFactory)constructor instead.DefaultHttpResponse(HttpVersion version, HttpResponseStatus status, boolean validateHeaders, boolean singleFieldHeaders)Deprecated.Use theDefaultHttpResponse(HttpVersion, HttpResponseStatus, HttpHeadersFactory)constructor instead.DefaultHttpResponse(HttpVersion version, HttpResponseStatus status, HttpHeaders headers)Creates a new instance.DefaultHttpResponse(HttpVersion version, HttpResponseStatus status, HttpHeadersFactory headersFactory)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanequals(java.lang.Object o)HttpResponseStatusgetStatus()Deprecated.inthashCode()HttpResponsesetProtocolVersion(HttpVersion version)Set the protocol version of thisHttpMessageHttpResponsesetStatus(HttpResponseStatus status)Set the status of thisHttpResponse.HttpResponseStatusstatus()Returns the status of thisHttpResponse.java.lang.StringtoString()-
Methods inherited from class io.netty.handler.codec.http.DefaultHttpMessage
getProtocolVersion, headers, protocolVersion
-
Methods inherited from class io.netty.handler.codec.http.DefaultHttpObject
decoderResult, getDecoderResult, setDecoderResult
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.netty.handler.codec.DecoderResultProvider
decoderResult, setDecoderResult
-
Methods inherited from interface io.netty.handler.codec.http.HttpMessage
getProtocolVersion, headers, protocolVersion
-
Methods inherited from interface io.netty.handler.codec.http.HttpObject
getDecoderResult
-
-
-
-
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
@Deprecated public DefaultHttpResponse(HttpVersion version, HttpResponseStatus status, boolean validateHeaders)
Deprecated.Use theDefaultHttpResponse(HttpVersion, HttpResponseStatus, HttpHeadersFactory)constructor instead.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
@Deprecated public DefaultHttpResponse(HttpVersion version, HttpResponseStatus status, boolean validateHeaders, boolean singleFieldHeaders)
Deprecated.Use theDefaultHttpResponse(HttpVersion, HttpResponseStatus, HttpHeadersFactory)constructor instead.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, HttpHeadersFactory headersFactory)
Creates a new instance.- Parameters:
version- the HTTP version of this responsestatus- the status of this responseheadersFactory- theHttpHeadersFactoryused to create the headers for this HTTP Response. The recommended default isDefaultHttpHeadersFactory.headersFactory().
-
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
-
getStatus
@Deprecated public HttpResponseStatus getStatus()
Deprecated.- Specified by:
getStatusin interfaceHttpResponse
-
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
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classDefaultHttpMessage
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classDefaultHttpMessage
-
-