The goog.proto2.ObjectSerializer Class

goog.proto2.ObjectSerializer
> goog.proto2.Serializer

goog.proto2.ObjectSerializer(opt_keyOption)

ObjectSerializer, a serializer which turns Messages into simplified ECMAScript objects.

opt_keyOption {goog.proto2.ObjectSerializer.KeyOption=}
If specified, which key option to use when serializing/deserializing.

The goog.proto2.ObjectSerializer.KeyOption Enum

An enumeration of the options for how to emit the keys in the generated simplified object. … more

.deserialize(descriptor, data)

Inherited from goog.proto2.Serializer .

Deserializes a message from the expected format.

descriptor {goog.proto2.Descriptor}
The descriptor of the message to be created.
data {*}
The data of the message.
returns {goog.proto2.Message}
The message created.

.deserializeTo(message, data)

Deserializes a message from an object and places the data in the message.

message {goog.proto2.Message}
The message in which to place the information.
data {*}
The data of the message.

.serialize(message)

Serializes a message to an object.

message {goog.proto2.Message}
The message to be serialized.
returns {Object}
The serialized form of the message.