R - the type of response expectedpublic class ConvertingResponseMessage<R> extends Object implements QueryResponseMessage<R>
 The conversion is generally used to accommodate response types that aren't compatible with serialization, such as
 OptionalResponseType.
| Constructor and Description | 
|---|
| ConvertingResponseMessage(ResponseType<R> expectedResponseType,
                         QueryResponseMessage<?> responseMessage)Initialize a response message, using  expectedResponseTypeto convert the payload from theresponseMessage, if necessary. | 
| Modifier and Type | Method and Description | 
|---|---|
| QueryResponseMessage<R> | andMetaData(Map<String,?> additionalMetaData)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  Optionalin case of successful
 execution. | 
| <T> SerializedObject<T> | serializeExceptionResult(Serializer serializer,
                        Class<T> expectedRepresentation)Serializes the exception result. | 
| <R1> SerializedObject<R1> | serializeMetaData(Serializer serializer,
                 Class<R1> expectedRepresentation)Serialize the meta data of this message to the  expectedRepresentationusing givenserializer. | 
| <S> SerializedObject<S> | serializePayload(Serializer serializer,
                Class<S> expectedRepresentation)Serialize the payload of this message to the  expectedRepresentationusing givenserializer. | 
| QueryResponseMessage<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, waitexceptionDetails, exceptionResultpublic ConvertingResponseMessage(ResponseType<R> expectedResponseType, QueryResponseMessage<?> responseMessage)
expectedResponseType to convert the payload from the responseMessage, if necessary.expectedResponseType - an instance describing the expected response typeresponseMessage - the message containing the actual response from the handlerpublic <S> SerializedObject<S> serializePayload(Serializer serializer, Class<S> expectedRepresentation)
MessageexpectedRepresentation using given serializer. This
 method should return the same SerializedObject instance when invoked multiple times using the same
 serializer.serializePayload in interface Message<R>serializePayload in interface ResultMessage<R>S - The type of the serialized dataserializer - The serializer to serialize payload withexpectedRepresentation - The type of data to serialize topublic <T> SerializedObject<T> serializeExceptionResult(Serializer serializer, Class<T> expectedRepresentation)
ResultMessageRemoteExceptionDescription from the Optional
 exception in this ResultMessage instead of serializing the original exception.serializeExceptionResult in interface ResultMessage<R>T - the generic type representing the expected formatserializer - the Serializer used to serialize the exceptionexpectedRepresentation - a Class representing the expected formatSerializedObjectpublic <R1> SerializedObject<R1> serializeMetaData(Serializer serializer, Class<R1> expectedRepresentation)
MessageexpectedRepresentation using given serializer.
 This method should return the same SerializedObject instance when invoked multiple times using the same
 serializer.serializeMetaData in interface Message<R>R1 - The type of the serialized dataserializer - The serializer to serialize meta data withexpectedRepresentation - The type of data to serialize topublic boolean isExceptional()
ResultMessageisExceptional in interface ResultMessage<R>true if execution was unsuccessful, false otherwisepublic Optional<Throwable> optionalExceptionResult()
ResultMessageOptional in case of successful
 execution.optionalExceptionResult in interface ResultMessage<R>Optional containing exception result or an empty Optional in case of a successful executionpublic String getIdentifier()
MessagegetIdentifier in interface Message<R>public MetaData getMetaData()
MessagegetMetaData in interface Message<R>public R getPayload()
MessagegetPayload in interface Message<R>public Class<R> getPayloadType()
MessagegetPayload().getClass(), but allows implementations to optimize by using
 lazy loading or deserialization.getPayloadType in interface Message<R>public QueryResponseMessage<R> withMetaData(Map<String,?> metaData)
QueryResponseMessagemetaData. 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,?> additionalMetaData)
QueryResponseMessagemetaData. The payload
 remains unchanged.andMetaData in interface Message<R>andMetaData in interface ResultMessage<R>andMetaData in interface QueryResponseMessage<R>additionalMetaData - The MetaData to merge into the QueryResponseMessageCopyright © 2010–2020. All rights reserved.