public interface ProtocolBufferSupport
Modifier and Type | Method and Description |
---|---|
void |
convertToProtocolBuffer(Message message,
Class typeClass)
Convert the given
message to a message of type
ProtocolBufferMessage with a protocol buffer
Message type passed in with the typeClass . |
void |
convertToProtocolBuffer(Message message,
String descFile)
Convert the given
message to a message of type
ProtocolBufferMessage with a protocol buffer
DynamicMessage as the message type. |
<T> T |
getMessage(Message message,
Class<T> typeClass)
Gets the protocol buffer message as a parsed message of type T from the given
message . |
void |
setMessage(Message message,
Object object)
Sets the message of a protocol buffer message, from either a type of a protocol buffer Message interface or a
protocol buffer Message.Builder interface into the given
message . |
void convertToProtocolBuffer(Message message, String descFile)
message
to a message
of type
ProtocolBufferMessage
with a protocol buffer
DynamicMessage as the message type.message
- the message to be converted to a protocol buffer messagedescFile
- description file for the proto schema, to parse the message as a dynamic messagevoid convertToProtocolBuffer(Message message, Class typeClass)
message
to a message
of type
ProtocolBufferMessage
with a protocol buffer
Message type passed in with the typeClass
.message
- the message to be converted to a protocol buffer messagetypeClass
- the type class of the protocol buffer message to be used for parsing the message<T> T getMessage(Message message, Class<T> typeClass)
message
. The Type
needs to be either a protocol buffer DynamicMessage type or any type that is a sub class of a protocol buffer
Message interface.
If the format of the passed message is not a
ProtocolBufferMessage
and the type is definite,
(i.e. not DynamicMessage) then the message is converted to a ProtocolBufferMessage in the process of getting the
message of the given type.
T
- protocol buffer typemessage
- the message to be used to retrieve the protocol buffer message.typeClass
- the type class of the parsed protocol buffervoid setMessage(Message message, Object object)
message
.
The format of the message
has to be of type
ProtocolBufferMessage
for the operation to be
successful. A BusRuntimeException
will be thrown
otherwise.
message
- the message to set the protocol buffer messageobject
- the Message or the Message.Builder to be set as the protocol buffer messageCopyright © 2010–2016 AdroitLogic. All rights reserved.