Home

Class goog.proto2.Serializer

Abstract base class for PB2 serializers. A serializer is a class which implements the serialization and deserialization of a Protocol Buffer Message to/from a specific format.

Instance Method Summary
deserialize(?goog.proto2.Descriptor descriptor, <Any Type> data) ⇒ ?goog.proto2.Message

Deserializes a message from the expected format.

deserializeTo(?goog.proto2.Message message, <Any Type> data)

Deserializes a message from the expected format and places the data in the message.

getDeserializedValue(?goog.proto2.FieldDescriptor field, <Any Type> value) ⇒ <Any Type>

Returns the deserialized form of the given value for the given field if the field is a Message or Group and returns the value, converted or unchanged, for primitive field types otherwise.

getSerializedValue(?goog.proto2.FieldDescriptor field, <Any Type> value) ⇒ <Any Type>

Returns the serialized form of the given value for the given field if the field is a Message or Group and returns the value unchanged otherwise.

serialize(?goog.proto2.Message message) ⇒ ?Object

Serializes a message to the expected format.