public class GrpcBackedResponseMessage<R> extends Object implements QueryResponseMessage<R>
Constructor and Description |
---|
GrpcBackedResponseMessage(QueryResponse queryResponse,
Serializer messageSerializer) |
Modifier and Type | Method and Description |
---|---|
QueryResponseMessage<R> |
andMetaData(Map<String,?> var1)
Returns a copy of this QueryResponseMessage with its MetaData merged with given
metaData . |
String |
getIdentifier()
Returns the identifier of this message.
|
MetaData |
getMetaData()
Returns the meta data for this event.
|
R |
getPayload()
Returns the payload of this Event.
|
Class<R> |
getPayloadType()
Returns the type of the payload.
|
boolean |
isExceptional()
Indicates whether the ResultMessage represents unsuccessful execution.
|
Optional<Throwable> |
optionalExceptionResult()
Returns the Exception in case of exceptional result message or an empty
Optional in case of successful
execution. |
GrpcBackedResponseMessage<R> |
withMetaData(Map<String,?> metaData)
Returns a copy of this QueryResponseMessage with the given
metaData . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
exceptionResult, serializeExceptionResult
serializeMetaData, serializePayload
public GrpcBackedResponseMessage(QueryResponse queryResponse, Serializer messageSerializer)
public String getIdentifier()
Message
getIdentifier
in interface Message<R>
public MetaData getMetaData()
Message
getMetaData
in interface Message<R>
public R getPayload()
Message
getPayload
in interface Message<R>
public Class<R> getPayloadType()
Message
getPayload().getClass()
, but allows implementations to optimize by using
lazy loading or deserialization.getPayloadType
in interface Message<R>
public boolean isExceptional()
ResultMessage
isExceptional
in interface ResultMessage<R>
true
if execution was unsuccessful, false
otherwisepublic Optional<Throwable> optionalExceptionResult()
ResultMessage
Optional
in case of successful
execution.optionalExceptionResult
in interface ResultMessage<R>
Optional
containing exception result or an empty Optional in case of a successful executionpublic GrpcBackedResponseMessage<R> withMetaData(Map<String,?> metaData)
QueryResponseMessage
metaData
. The payload remains unchanged.withMetaData
in interface Message<R>
withMetaData
in interface ResultMessage<R>
withMetaData
in interface QueryResponseMessage<R>
metaData
- The new MetaData for the QueryResponseMessagepublic QueryResponseMessage<R> andMetaData(Map<String,?> var1)
QueryResponseMessage
metaData
. The payload
remains unchanged.andMetaData
in interface Message<R>
andMetaData
in interface ResultMessage<R>
andMetaData
in interface QueryResponseMessage<R>
var1
- The MetaData to merge into the QueryResponseMessageCopyright © 2010–2018. All rights reserved.