Top Description Inners Fields Constructors Methods
com.google.protobuf

public abstract Class AbstractMessage

extends AbstractMessageLite
implements Message
Class Inheritance
All Implemented Interfaces
com.google.protobuf.Message, com.google.protobuf.MessageOrBuilder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageLite
Known Direct Subclasses
com.google.protobuf.DynamicMessage, com.google.protobuf.MapEntry, com.google.protobuf.GeneratedMessage, com.google.protobuf.GeneratedMessageV3
Imports
com.google.protobuf.Descriptors.EnumValueDescriptor, .Descriptors.FieldDescriptor, .Descriptors.OneofDescriptor, .Internal.EnumLite, java.io.IOException, .InputStream, java.util.Arrays, .Collections, .HashMap, .Iterator, .List, .Map

A partial implementation of the Message interface which implements as many methods of that interface as possible in terms of other methods.
Author
[email protected] Kenton Varda

Nested and Inner Type Summary

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

A partial implementation of the Message.Builder interface which implements as many methods of that interface as possible in terms of other methods.

protected static interface
AbstractMessage.BuilderParent

Interface for the parent of a Builder that allows the builder to communicate invalidations back to the parent for use when using nested builders.

Field Summary

Modifier and TypeField and Description
protected int
Inherited from com.google.protobuf.AbstractMessageLite:
memoizedHashCode

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static boolean
compareBytes(Object a, Object b)

Compares two bytes fields.

pack-priv static boolean
private static boolean
compareMapField(Object a, Object b)

Compares two map fields.

private static Map<K, V>
convertMapEntryListToMap(List<E> list)

Converts a list of MapEntry messages into a Map used for equals() and hashCode().

public boolean
equals(final Object
object to be compared for equality with this message
other
)

Overrides java.lang.Object.equals.

Implements com.google.protobuf.Message.equals.

Compares the specified object with this message for equality.
public List<String>
findInitializationErrors()

Implements com.google.protobuf.MessageOrBuilder.findInitializationErrors.

Returns a list of field paths (e.g. "foo.bar.baz") of required fields which are not set in this message.
public String
getInitializationErrorString()

Implements com.google.protobuf.MessageOrBuilder.getInitializationErrorString.

Returns a comma-delimited list of required fields which are not set in this message object.
pack-priv int
public Descriptors.FieldDescriptor
getOneofFieldDescriptor(Descriptors.OneofDescriptor oneof)

Implements com.google.protobuf.MessageOrBuilder.getOneofFieldDescriptor.

TODO(jieluo): Clear it when all subclasses have implemented this method.
public int
getSerializedSize()

Implements com.google.protobuf.MessageLite.getSerializedSize.

Get the number of bytes required to encode this message.
protected static int
hashBoolean(boolean b)

Deprecated from v3.0.0-beta-3+, for compatibility with v2.5.0 and v2.6.1 generated code.
public int
hashCode()

Overrides java.lang.Object.hashCode.

Implements com.google.protobuf.Message.hashCode.

Returns the hash code value for this message.
protected static int
hashEnum(Internal.EnumLite e)

Deprecated from v3.0.0-beta-3+, for compatibility with v2.5.0 and v2.6.1 generated code.
protected static int
hashEnumList(List<? extends Internal.EnumLite> list)

Deprecated from v3.0.0-beta-3+, for compatibility with v2.5.0 and v2.6.1 generated code.
protected static int
hashFields(int hash, Map<Descriptors.FieldDescriptor, Object> map)

Get a hash code for given fields and values, using the given seed.

protected static int
hashLong(long n)

Deprecated from v3.0.0-beta-3+, for compatibility with v2.5.0 and v2.6.1 generated code.
private static int
hashMapField(Object value)

Calculates the hash code of a map field.

public boolean
hasOneof(Descriptors.OneofDescriptor oneof)

Implements com.google.protobuf.MessageOrBuilder.hasOneof.

TODO(jieluo): Clear it when all subclasses have implemented this method.
public boolean
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 Message.Builder
newBuilderForType(AbstractMessage.BuilderParent parent)

Create a nested builder.

pack-priv UninitializedMessageException
newUninitializedMessageException()

Overrides com.google.protobuf.AbstractMessageLite.newUninitializedMessageException.

Package private helper method for AbstractParser to create UninitializedMessageException with missing field information.
pack-priv void
private static ByteString
public final String
toString()

Overrides java.lang.Object.toString.

Implements com.google.protobuf.Message.toString.

Converts the message to a string in protocol buffer text format.
public void
writeTo(final CodedOutputStream output)

Implements com.google.protobuf.MessageLite.writeTo.

Serializes the message and writes it to output.
Inherited from com.google.protobuf.AbstractMessageLite:
addAlladdAllcheckByteStringIsUtf8toByteArraytoByteStringwriteDelimitedTowriteTo