Top Description Inners Fields Constructors Methods
com.google.protobuf

public abstract Class GeneratedMessageV3

extends AbstractMessage
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Known Direct Subclasses
com.google.protobuf.GeneratedMessageV3.ExtendableMessage, com.google.protobuf.Int32Value, com.google.protobuf.Int64Value, com.google.protobuf.ListValue, com.google.protobuf.Timestamp, com.google.protobuf.Type, com.google.protobuf.UInt32Value, com.google.protobuf.UInt64Value, com.google.protobuf.Value, com.google.protobuf.BytesValue, com.google.protobuf.DescriptorProtos.FileDescriptorSet, com.google.protobuf.DescriptorProtos.FileDescriptorProto, com.google.protobuf.DescriptorProtos.DescriptorProto, com.google.protobuf.DescriptorProtos.DescriptorProto.ExtensionRange, com.google.protobuf.DescriptorProtos.DescriptorProto.ReservedRange, com.google.protobuf.DescriptorProtos.FieldDescriptorProto, com.google.protobuf.DescriptorProtos.OneofDescriptorProto, com.google.protobuf.DescriptorProtos.EnumDescriptorProto, com.google.protobuf.DescriptorProtos.EnumDescriptorProto.EnumReservedRange, com.google.protobuf.DescriptorProtos.EnumValueDescriptorProto, com.google.protobuf.DescriptorProtos.ServiceDescriptorProto, com.google.protobuf.DescriptorProtos.MethodDescriptorProto, com.google.protobuf.DescriptorProtos.UninterpretedOption, com.google.protobuf.DescriptorProtos.UninterpretedOption.NamePart, com.google.protobuf.DescriptorProtos.SourceCodeInfo, com.google.protobuf.DescriptorProtos.SourceCodeInfo.Location, com.google.protobuf.DescriptorProtos.GeneratedCodeInfo, com.google.protobuf.DescriptorProtos.GeneratedCodeInfo.Annotation, com.google.protobuf.DoubleValue, com.google.protobuf.Duration, com.google.protobuf.compiler.PluginProtos.Version, com.google.protobuf.compiler.PluginProtos.CodeGeneratorRequest, com.google.protobuf.compiler.PluginProtos.CodeGeneratorResponse, com.google.protobuf.compiler.PluginProtos.CodeGeneratorResponse.File, com.google.protobuf.Any, com.google.protobuf.Api, com.google.protobuf.BoolValue, com.google.protobuf.Method, com.google.protobuf.Mixin, com.google.protobuf.Option, com.google.protobuf.SourceContext, com.google.protobuf.StringValue, com.google.protobuf.Struct, com.google.protobuf.Empty, com.google.protobuf.Enum, com.google.protobuf.EnumValue, com.google.protobuf.Field, com.google.protobuf.FieldMask, com.google.protobuf.FloatValue
Static Imports
com.google.protobuf.Internal.checkNotNull

All generated protocol message classes extend this class. This class implements most of the Message and Builder interfaces using Java reflection. Users can ignore this class and pretend that generated messages implement the Message interface directly.
Author
[email protected] Kenton Varda

Nested and Inner Type Summary

Modifier and TypeClass and Description
public abstract static class
GeneratedMessageV3.Builder<BuilderType extends GeneratedMessageV3.Builder<BuilderType>>

protected static interface
GeneratedMessageV3.BuilderParent

TODO(xiaofeng): remove this after b/29368482 is fixed.

public abstract static class
GeneratedMessageV3.ExtendableBuilder<MessageType extends GeneratedMessageV3.ExtendableMessage<MessageType extends GeneratedMessageV3.ExtendableMessage>, BuilderType extends GeneratedMessageV3.ExtendableBuilder<MessageType, BuilderType>>

Generated message builders for message types that contain extension ranges subclass this.

public abstract static class
GeneratedMessageV3.ExtendableMessage<MessageType extends GeneratedMessageV3.ExtendableMessage>

Generated message classes for message types that contain extension ranges subclass this.

public static interface
pack-priv static interface
GeneratedMessageV3.ExtensionDescriptorRetriever

Gets the descriptor for an extension.

public static class
GeneratedMessageV3.FieldAccessorTable

Users should ignore this class.

Field Summary

Modifier and TypeField and Description
protected static boolean
private static final long
protected UnknownFieldSet
unknownFields

For use by generated code only.

Inherited from com.google.protobuf.AbstractMessage:
memoizedSize

Constructor Summary

AccessConstructor and Description
protected
protected

Method Summary

Modifier and TypeMethod and Description
protected static boolean
private static <MessageType extends GeneratedMessageV3.ExtendableMessage<MessageType>, T> Extension<MessageType, T>
checkNotLite(ExtensionLite<MessageType, T> extension)

Checks that the Extension is non-Lite and returns it as a GeneratedExtension.

protected static int
computeStringSize(final int fieldNumber, final Object value)

protected static int
protected static Internal.BooleanList
protected static Internal.DoubleList
protected static Internal.FloatList
protected static Internal.IntList
protected static Internal.LongList
pack-priv static void
public Map<Descriptors.FieldDescriptor, Object>
getAllFields()

Implements com.google.protobuf.MessageOrBuilder.getAllFields.

Returns a collection of all the fields in this message which are set and their corresponding values.
private Map<Descriptors.FieldDescriptor, Object>
getAllFieldsMutable(boolean
whether to generate ByteString for string fields
getBytesForString
)

Internal helper to return a modifiable map containing all the fields.

pack-priv Map<Descriptors.FieldDescriptor, Object>
getAllFieldsRaw()

Returns a collection of all the fields in this message which are set and their corresponding values.

public Descriptors.Descriptor
getDescriptorForType()

Implements com.google.protobuf.MessageOrBuilder.getDescriptorForType.

Get the message's type's descriptor.
public Object
getField(final Descriptors.FieldDescriptor field)

Implements com.google.protobuf.MessageOrBuilder.getField.

Obtains the value of the given field, or the default value if it is not set.
pack-priv Object
getFieldRaw(final Descriptors.FieldDescriptor field)

Obtains the value of the given field, or the default value if it is not set.

private static Method
getMethodOrDie(final Class<T> clazz, final String name, final Class<T>... params)

Calls Class.getMethod and throws a RuntimeException if it fails.

public Descriptors.FieldDescriptor
getOneofFieldDescriptor(final Descriptors.OneofDescriptor oneof)

Overrides com.google.protobuf.AbstractMessage.getOneofFieldDescriptor.

Implements com.google.protobuf.MessageOrBuilder.getOneofFieldDescriptor.

TODO(jieluo): Clear it when all subclasses have implemented this method.
public Parser<? extends GeneratedMessageV3>
getParserForType()

Implements com.google.protobuf.Message.getParserForType, com.google.protobuf.MessageLite.getParserForType.

Gets the parser for a message of the same type as this message.
public Object
getRepeatedField(final Descriptors.FieldDescriptor field, final int index)

Implements com.google.protobuf.MessageOrBuilder.getRepeatedField.

Gets an element of a repeated field.
public int
getRepeatedFieldCount(final Descriptors.FieldDescriptor field)

Implements com.google.protobuf.MessageOrBuilder.getRepeatedFieldCount.

Gets the number of elements of a repeated field.
public int
getSerializedSize()

Overrides com.google.protobuf.AbstractMessage.getSerializedSize.

Implements com.google.protobuf.MessageLite.getSerializedSize.

Get the number of bytes required to encode this message.
public UnknownFieldSet
public boolean
hasField(final Descriptors.FieldDescriptor field)

Implements com.google.protobuf.MessageOrBuilder.hasField.

Returns true if the given field is set.
public boolean
hasOneof(final Descriptors.OneofDescriptor oneof)

Overrides com.google.protobuf.AbstractMessage.hasOneof.

Implements com.google.protobuf.MessageOrBuilder.hasOneof.

TODO(jieluo): Clear it when all subclasses have implemented this method.
protected abstract GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()

Get the FieldAccessorTable for this type.

protected MapField<K, V>
internalGetMapField(int fieldNumber)

Gets the map field with the given field number.

private static Object
invokeOrDie(final Method method, final Object object, final Object... params)

Calls invoke and throws a RuntimeException if it fails.

public boolean
isInitialized()

Overrides com.google.protobuf.AbstractMessage.isInitialized.

Implements com.google.protobuf.MessageLiteOrBuilder.isInitialized.

Returns true if all required fields in the message and all embedded messages are set, false otherwise.
protected void
makeExtensionsImmutable()

Used by parsing constructors in generated classes.

private static <V> void
maybeSerializeBooleanEntryTo(CodedOutputStream out, Map<Boolean, V> m, MapEntry<Boolean, V> defaultEntry, int fieldNumber, boolean key)

protected static Internal.IntList
protected static Internal.LongList
protected static Internal.FloatList
protected static Internal.DoubleList
protected static Internal.BooleanList
protected static Internal.BooleanList
protected abstract Message.Builder
newBuilderForType(GeneratedMessageV3.BuilderParent parent)

TODO(xiaofeng): remove this together with GeneratedMessageV3.BuilderParent.

protected Message.Builder
protected static Internal.DoubleList
protected static Internal.FloatList
protected static Internal.IntList
protected static Internal.LongList
protected static <M extends Message> M
protected static <M extends Message> M
protected boolean

Returns:

true unless the tag is an end-group tag.
parseUnknownField
(CodedInputStream input, UnknownFieldSet.Builder unknownFields, ExtensionRegistryLite extensionRegistry, int tag)

Called by subclasses to parse an unknown field.

protected boolean
parseUnknownFieldProto3(CodedInputStream input, UnknownFieldSet.Builder unknownFields, ExtensionRegistryLite extensionRegistry, int tag)

Delegates to parseUnknownField.

protected static <M extends Message> M
protected static <M extends Message> M
protected static <M extends Message> M
protected static <M extends Message> M
protected static <V> void
serializeBooleanMapTo(CodedOutputStream out, MapField<Boolean, V> field, MapEntry<Boolean, V> defaultEntry, int fieldNumber)

protected static <V> void
serializeIntegerMapTo(CodedOutputStream out, MapField<Integer, V> field, MapEntry<Integer, V> defaultEntry, int fieldNumber)

protected static <V> void
serializeLongMapTo(CodedOutputStream out, MapField<Long, V> field, MapEntry<Long, V> defaultEntry, int fieldNumber)

private static <K, V> void
serializeMapTo(CodedOutputStream out, Map<K, V> m, MapEntry<K, V> defaultEntry, int fieldNumber)

Serialize the map using the iteration order.

protected static <V> void
serializeStringMapTo(CodedOutputStream out, MapField<String, V> field, MapEntry<String, V> defaultEntry, int fieldNumber)

protected Object

Returns:

a SerializedForm of this message
writeReplace
()

Replaces this object in the output stream with a serialized form.

protected static void
writeString(CodedOutputStream output, final int fieldNumber, final Object value)

protected static void
public void
writeTo(final CodedOutputStream output)

Overrides com.google.protobuf.AbstractMessage.writeTo.

Implements com.google.protobuf.MessageLite.writeTo.

Serializes the message and writes it to output.
Inherited from com.google.protobuf.AbstractMessage:
compareFieldsequalsfindInitializationErrorsgetInitializationErrorStringgetMemoizedSerializedSizehashBooleanhashCodehashEnumhashEnumListhashFieldshashLongnewUninitializedMessageExceptionsetMemoizedSerializedSizetoString