Interface MessageMarshaller<T>
- All Superinterfaces:
BaseMarshaller<T>
Contract to be implemented by manually written marshallers for Protobuf message (entity) types. The marshaller
implementation must be stateless and thread-safe.
- Since:
- 1.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA high-level interface for the wire encoding of a Protobuf stream that allows reading named (and typed) message fields.static interfaceA high-level interface for the wire encoding of a Protobuf stream that allows writing named (and typed) message fields. -
Field Summary
Fields inherited from interface BaseMarshaller
EMPTY -
Method Summary
Modifier and TypeMethodDescriptionRead the fields written bywriteTo(ProtoStreamWriter, Object).voidwriteTo(MessageMarshaller.ProtoStreamWriter writer, T t) Write the fields defined in the schema.Methods inherited from interface BaseMarshaller
getJavaClass, getSubClassNames, getTypeName
-
Method Details
-
readFrom
Read the fields written bywriteTo(ProtoStreamWriter, Object). Should read them in the exact same order as were written to ensure maximum performance. Not obeying the order will lead to poor performance and will cause warnings to be logged but will still work.- Throws:
IOException
-
writeTo
Write the fields defined in the schema. Please establish a consistent order and always write them in the same order. Two common choices for ordering field writes are schema definition order and field number order.- Throws:
IOException
-