Class HttpResponse
java.lang.Object
org.apache.pekko.http.javadsl.model.HttpResponse
org.apache.pekko.http.scaladsl.model.HttpResponse
- All Implemented Interfaces:
- HttpMessage,- HttpMessage.MessageTransformations<HttpResponse>,- HttpMessage
The immutable HTTP response model.
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.apache.pekko.http.javadsl.model.HttpMessageHttpMessage.DiscardedEntity, HttpMessage.MessageTransformations<Self>Nested classes/interfaces inherited from interface org.apache.pekko.http.scaladsl.model.HttpMessageHttpMessage.DiscardedEntity, HttpMessage.HttpMessageScalaDSLSugar, HttpMessage.HttpMessageScalaDSLSugar$
- 
Constructor SummaryConstructorsConstructorDescriptionHttpResponse(StatusCode status, scala.collection.immutable.Seq<HttpHeader> headers, scala.collection.immutable.Map<AttributeKey<?>, Object> attributes, ResponseEntity entity, HttpProtocol protocol) 
- 
Method SummaryModifier and TypeMethodDescription_1()scala.collection.immutable.Seq<HttpHeader>_2()_3()_4()static HttpResponseapply(StatusCode status, scala.collection.immutable.Seq<HttpHeader> headers, ResponseEntity entity, HttpProtocol protocol) scala.collection.immutable.Map<AttributeKey<?>,Object> entity()Returns the entity of this response.booleaninthashCode()scala.collection.immutable.Seq<HttpHeader>headers()booleanIs this instance a request.booleanIs this instance a response.mapEntity(scala.Function1<ResponseEntity, ResponseEntity> f) protocol()The protocol of this message.self()status()Returns the status-code of this response.toString()<T> HttpResponsetransformEntityDataBytes(org.apache.pekko.stream.Graph<org.apache.pekko.stream.FlowShape<org.apache.pekko.util.ByteString, org.apache.pekko.util.ByteString>, T> transformer) Returns a copy of Self message after applying the given transformationstatic OptHttpResponseunapply(HttpResponse any) withAttributes(scala.collection.immutable.Map<AttributeKey<?>, Object> attributes) Returns a copy of this message with the attributes set to the given ones.withEntity(RequestEntity entity) Returns a copy of Self message with a new entity.withEntity(ResponseEntity entity) Returns a copy of this instance with a new entity.withEntity(RequestEntity entity) Returns a copy of this message with the entity set to the given one.withHeaders(scala.collection.immutable.Seq<HttpHeader> headers) Returns a copy of this message with the list of headers set to the given ones.withHeadersAndEntity(scala.collection.immutable.Seq<HttpHeader> headers, RequestEntity entity) Returns a copy of this message with the entity and headers set to the given ones.withHeadersAndEntity(scala.collection.immutable.Seq<HttpHeader> headers, ResponseEntity entity) withProtocol(HttpProtocol protocol) Returns a copy of this message with a new protocol.withProtocol(HttpProtocol protocol) withStatus(int statusCode) Returns a copy of this instance with a new status-code.withStatus(StatusCode statusCode) Returns a copy of this instance with a new status-code.Methods inherited from class org.apache.pekko.http.javadsl.model.HttpResponsecreate, encodingMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.pekko.http.scaladsl.model.HttpMessageaddAttribute, addCredentials, addHeader, addHeaders, attribute, connectionCloseExpected, discardEntityBytes, discardEntityBytes, encoding, getAttribute, getHeader, getHeader, getHeaders, getHeaders, header, headers, mapAttributes, mapHeaders, removeAttribute, removeHeader, toStrict, toStrict, toStrict, toStrict, toStrict, toStrict, withDefaultHeaders, withDefaultHeaders, withEntity, withEntity, withEntity, withEntity, withEntity, withEntity, withEntity, withEntity, withHeaders, withHeadersMethods inherited from interface org.apache.pekko.http.javadsl.model.HttpMessage.MessageTransformationsaddAttribute, addCredentials, addHeader, addHeaders, removeAttribute, removeHeader, toStrict, toStrict, toStrict, toStrict, withEntity, withEntity, withEntity, withEntity, withEntity, withEntity, withEntity, withEntity, withHeaders
- 
Constructor Details- 
HttpResponsepublic HttpResponse(StatusCode status, scala.collection.immutable.Seq<HttpHeader> headers, scala.collection.immutable.Map<AttributeKey<?>, Object> attributes, ResponseEntity entity, HttpProtocol protocol) 
 
- 
- 
Method Details- 
applypublic static HttpResponse apply(StatusCode status, scala.collection.immutable.Seq<HttpHeader> headers, ResponseEntity entity, HttpProtocol protocol) 
- 
unapply
- 
statusDescription copied from class:HttpResponseReturns the status-code of this response.- Specified by:
- statusin class- HttpResponse
 
- 
headers- Specified by:
- headersin interface- HttpMessage
 
- 
attributes- Specified by:
- attributesin interface- HttpMessage
 
- 
entityDescription copied from class:HttpResponseReturns the entity of this response.- Specified by:
- entityin interface- HttpMessage
- Specified by:
- entityin interface- HttpMessage
- Specified by:
- entityin class- HttpResponse
 
- 
protocolDescription copied from interface:HttpMessageThe protocol of this message.- Specified by:
- protocolin interface- HttpMessage
- Specified by:
- protocolin interface- HttpMessage
 
- 
self- Specified by:
- selfin interface- HttpMessage
 
- 
isRequestpublic boolean isRequest()Description copied from interface:HttpMessageIs this instance a request.- Specified by:
- isRequestin interface- HttpMessage
- Specified by:
- isRequestin interface- HttpMessage
 
- 
isResponsepublic boolean isResponse()Description copied from interface:HttpMessageIs this instance a response.- Specified by:
- isResponsein interface- HttpMessage
- Specified by:
- isResponsein interface- HttpMessage
 
- 
withHeadersDescription copied from interface:HttpMessageReturns a copy of this message with the list of headers set to the given ones.- Specified by:
- withHeadersin interface- HttpMessage
 
- 
withAttributespublic HttpResponse withAttributes(scala.collection.immutable.Map<AttributeKey<?>, Object> attributes) Description copied from interface:HttpMessageReturns a copy of this message with the attributes set to the given ones.- Specified by:
- withAttributesin interface- HttpMessage
 
- 
withProtocolDescription copied from interface:HttpMessage.MessageTransformationsReturns a copy of this message with a new protocol.- Specified by:
- withProtocolin interface- HttpMessage.MessageTransformations<HttpResponse>
 
- 
withProtocol
- 
withStatusDescription copied from class:HttpResponseReturns a copy of this instance with a new status-code.- Specified by:
- withStatusin class- HttpResponse
 
- 
withStatusDescription copied from class:HttpResponseReturns a copy of this instance with a new status-code.- Specified by:
- withStatusin class- HttpResponse
 
- 
withHeadersAndEntitypublic HttpResponse withHeadersAndEntity(scala.collection.immutable.Seq<HttpHeader> headers, RequestEntity entity) Description copied from interface:HttpMessageReturns a copy of this message with the entity and headers set to the given ones.- Specified by:
- withHeadersAndEntityin interface- HttpMessage
 
- 
withHeadersAndEntitypublic HttpResponse withHeadersAndEntity(scala.collection.immutable.Seq<HttpHeader> headers, ResponseEntity entity) 
- 
withEntityDescription copied from class:HttpResponseReturns a copy of this instance with a new entity.- Specified by:
- withEntityin class- HttpResponse
 
- 
withEntityDescription copied from interface:HttpMessageReturns a copy of this message with the entity set to the given one.- Specified by:
- withEntityin interface- HttpMessage
 
- 
withEntityDescription copied from interface:HttpMessage.MessageTransformationsReturns a copy of Self message with a new entity.- Specified by:
- withEntityin interface- HttpMessage.MessageTransformations<HttpResponse>
 
- 
mapEntity
- 
transformEntityDataBytespublic <T> HttpResponse transformEntityDataBytes(org.apache.pekko.stream.Graph<org.apache.pekko.stream.FlowShape<org.apache.pekko.util.ByteString, org.apache.pekko.util.ByteString>, T> transformer) Description copied from interface:HttpMessage.MessageTransformationsReturns a copy of Self message after applying the given transformation- Specified by:
- transformEntityDataBytesin interface- HttpMessage
- Specified by:
- transformEntityDataBytesin interface- HttpMessage.MessageTransformations<HttpResponse>
 
- 
equals
- 
hashCodepublic int hashCode()
- 
toString
- 
_1
- 
_2
- 
_3
- 
_4
 
-