goog.proto2.Message
Classgoog.proto2.Message()
Abstract base class for all Protocol Buffer 2 messages. It will be subclassed in the code generated by the Protocol Compiler. Any other subclasses are prohibited.
goog.proto2.Message.FieldType
EnumAn enumeration defining the possible field types. Should be a mirror of that defined in descriptor.h. TODO(user): Remove this alias. The code generator generates code that references this enum, so it needs to exist until the code generator is changed. The enum was moved to from Message to FieldDescriptor to avoid a dependency cycle. Use goog.proto2.FieldDescriptor.FieldType instead. … more
.add(field, value)
Adds the given value to the field specified by the given field descriptor. Note that the field must be repeated.
field
{goog.proto2.FieldDescriptor
}
value
{*}
.add$Value(tag, value)
[protected]Adds the value to the *repeating* field indicated by the given tag. GENERATED CODE USE ONLY. Basis of the add{Field} methods.
tag
{number
}
value
{*}
.array$Values(tag)
[protected]Gets the values at the field indicated by the given tag. GENERATED CODE USE ONLY. Basis of the {field}Array methods.
tag
{number
}
Array
}
.arrayOf(field)
Returns the array of values found for the given repeated field.
field
{goog.proto2.FieldDescriptor
}
Array
}
.clear(field)
Clears the field specified.
field
{goog.proto2.FieldDescriptor
}
.clear$Field(tag)
[protected]Clears the field specified by tag. GENERATED CODE USE ONLY. Basis of the clear{Field} methods.
tag
{number
}
.clone()
goog.proto2.Message
}
.copyFrom(message)
Recursively copies the known fields from the given message to this message. Removes the fields which are not present in the source message.
message
{!goog.proto2.Message
}
.count$Values(tag)
[protected]Returns the number of values stored in the field by the given tag. GENERATED CODE USE ONLY. Basis of the {field}Count methods.
tag
{number
}
number
}
.countOf(field)
Returns the number of values stored in the given field.
field
{goog.proto2.FieldDescriptor
}
number
}
.equals(other)
Compares this message with another one ignoring the unknown fields.
other
{*}
boolean
}
.forEachUnknown(callback, opt_scope)
Iterates over all the unknown fields in the message.
callback
{function
(number
, *)}
opt_scope
{Object
=}
.get(field, opt_index)
Returns the value stored at the field specified by the given field descriptor.
field
{goog.proto2.FieldDescriptor
}
opt_index
{number
=}
.get$Value(tag, opt_index)
[protected]Gets the value at the field indicated by the given tag. GENERATED CODE USE ONLY. Basis of the get{Field} methods.
tag
{number
}
opt_index
{number
=}
.get$ValueOrDefault(tag, opt_index)
[protected]Gets the value at the field indicated by the given tag or the default value if none. GENERATED CODE USE ONLY. Basis of the get{Field} methods.
tag
{number
}
opt_index
{number
=}
.getDescriptor()
Returns the descriptor which describes the current message.
goog.proto2.Descriptor
}
.getOrDefault(field, opt_index)
Returns the value stored at the field specified by the given field descriptor or the default value if none exists.
field
{goog.proto2.FieldDescriptor
}
opt_index
{number
=}
.has(field)
Returns whether there is a value stored at the field specified by the given field descriptor.
field
{goog.proto2.FieldDescriptor
}
boolean
}
.has$Value(tag)
Returns the whether or not the field indicated by the given tag has a value. GENERATED CODE USE ONLY. Basis of the has{Field} methods.
tag
{number
}
boolean
}
.initDefaults(simpleFieldsToo)
Fills in the protocol buffer with default values. Any fields that are already set will not be overridden.
simpleFieldsToo
{boolean
}
.initializeForLazyDeserializer(deserializer, data)
Initializes the message with a lazy deserializer and its associated data. This method should be called by internal methods ONLY.
deserializer
{goog.proto2.LazyDeserializer
}
data
{*}
.mergeFrom(message)
Merges the given message into this message. Singular fields will be overwritten, except for embedded messages which will be merged. Repeated fields will be concatenated.
message
{!goog.proto2.Message
}
.set(field, value)
Stores the given value to the field specified by the given field descriptor. Note that the field must not be repeated.
field
{goog.proto2.FieldDescriptor
}
value
{*}
.set$Metadata(messageType, metadataObj)
Sets the metadata that represents the definition of this message. GENERATED CODE USE ONLY. Called when constructing message classes.
messageType
{Function
}
metadataObj
{Object
}
.set$Value(tag, value)
[protected]Sets the value of the *non-repeating* field indicated by the given tag. GENERATED CODE USE ONLY. Basis of the set{Field} methods.
tag
{number
}
value
{*}
.setUnknown(tag, value)
Sets the value of an unknown field, by tag.
tag
{number
}
value
{*}