Classes | |
class | Builder |
interface | BuilderParent |
Protected Member Functions | |
Message.Builder | newBuilderForType (BuilderParent parent) |
Static Protected Member Functions | |
static int | hashBoolean (boolean b) |
static int | hashEnum (EnumLite e) |
static int | hashEnumList (List<? extends EnumLite > list) |
static int | hashFields (int hash, Map< FieldDescriptor, Object > map) |
static int | hashLong (long n) |
![]() | |
static< T > void | addAll (final Iterable< T > values, final Collection<? super T > list) |
static< T > void | addAll (final Iterable< T > values, final List<? super T > list) |
static void | checkByteStringIsUtf8 (ByteString byteString) throws IllegalArgumentException |
Protected Attributes | |
int | memoizedSize = -1 |
![]() | |
int | memoizedHashCode = 0 |
Static Private Member Functions | |
static boolean | compareBytes (Object a, Object b) |
static boolean | compareMapField (Object a, Object b) |
static Map | convertMapEntryListToMap (List list) |
static int | hashMapField (Object value) |
static ByteString | toByteString (Object value) |
A partial implementation of the Message interface which implements as many methods of that interface as possible in terms of other methods.
Definition at line 52 of file AbstractMessage.java.
|
inlinestaticprivate |
Compares two bytes fields. The parameters must be either a byte array or a ByteString object. They can be of different type though.
Definition at line 183 of file AbstractMessage.java.
|
inlinestaticprivate |
Compares two map fields. The parameters must be a list of MapEntry messages.
Definition at line 220 of file AbstractMessage.java.
|
inlinestaticprivate |
Converts a list of MapEntry messages into a Map used for equals() and hashCode().
Definition at line 192 of file AbstractMessage.java.
|
inline |
Compares the specified object with this message for equality. Returns
if the given object is a message of the same type (as defined by
) and has identical values for all of its fields. Subclasses must implement this; inheriting
is incorrect.
other | object to be compared for equality with this message |
Implements com.google.protobuf.Message.
Definition at line 143 of file AbstractMessage.java.
|
inline |
Returns a list of field paths (e.g. "foo.bar.baz") of required fields which are not set in this message. You should call MessageLiteOrBuilder#isInitialized() first to check if there are any missing fields, as that method is likely to be much faster than this one even when the message is fully-initialized.
Implements com.google.protobuf.MessageOrBuilder.
Definition at line 88 of file AbstractMessage.java.
|
inline |
Returns a comma-delimited list of required fields which are not set in this message object. You should call MessageLiteOrBuilder#isInitialized() first to check if there are any missing fields, as that method is likely to be much faster than this one even when the message is fully-initialized.
Implements com.google.protobuf.MessageOrBuilder.
Definition at line 93 of file AbstractMessage.java.
|
inline |
TODO(jieluo): Clear it when all subclasses have implemented this method.
Reimplemented in com.google.protobuf.DynamicMessage, com.google.protobuf.GeneratedMessageV3, and com.google.protobuf.GeneratedMessage.
Definition at line 105 of file AbstractMessage.java.
|
inline |
Get the number of bytes required to encode this message. The result is only computed on the first call and memoized after that.
Implements com.google.protobuf.MessageLite.
Reimplemented in com.google.protobuf.GeneratedMessageV3, com.google.protobuf.GeneratedMessage, com.google.protobuf.DynamicMessage, and com.google.protobuf.MapEntry< K, V >.
Definition at line 132 of file AbstractMessage.java.
|
inlinestaticprotected |
Definition at line 598 of file AbstractMessage.java.
|
inline |
Returns the hash code value for this message. The hash code of a message should mix the message's type (object identity of the descriptor) with its contents (known and unknown field values). Subclasses must implement this; inheriting
is incorrect.
Implements com.google.protobuf.Message.
Definition at line 159 of file AbstractMessage.java.
|
inlinestaticprotected |
Definition at line 607 of file AbstractMessage.java.
|
inlinestaticprotected |
Definition at line 616 of file AbstractMessage.java.
|
inlinestaticprotected |
Get a hash code for given fields and values, using the given seed.
Definition at line 283 of file AbstractMessage.java.
|
inlinestaticprotected |
Definition at line 589 of file AbstractMessage.java.
|
inlinestaticprivate |
Calculates the hash code of a map field.
must be a list of MapEntry messages.
Definition at line 277 of file AbstractMessage.java.
|
inline |
TODO(jieluo): Clear it when all subclasses have implemented this method.
Reimplemented in com.google.protobuf.DynamicMessage, com.google.protobuf.GeneratedMessageV3, and com.google.protobuf.GeneratedMessage.
Definition at line 99 of file AbstractMessage.java.
|
inline |
Returns true if all required fields in the message and all embedded messages are set, false otherwise.
See also: MessageOrBuilder#getInitializationErrorString()
Implements com.google.protobuf.MessageLiteOrBuilder.
Reimplemented in com.google.protobuf.GeneratedMessageV3.ExtendableMessage< MessageType extends ExtendableMessage >, com.google.protobuf.GeneratedMessage.ExtendableMessage< MessageType extends ExtendableMessage >, com.google.protobuf.DynamicMessage, com.google.protobuf.GeneratedMessageV3, com.google.protobuf.GeneratedMessage, and com.google.protobuf.MapEntry< K, V >.
Definition at line 57 of file AbstractMessage.java.
|
inlineprotected |
Create a nested builder.
Definition at line 82 of file AbstractMessage.java.
|
inlinestaticprivate |
Definition at line 171 of file AbstractMessage.java.
|
inline |
Converts the message to a string in protocol buffer text format. This is just a trivial wrapper around TextFormat.Printer#printToString(MessageOrBuilder).
Implements com.google.protobuf.Message.
Definition at line 110 of file AbstractMessage.java.
|
inline |
Serializes the message and writes it to
. This does not flush or close the stream.
Implements com.google.protobuf.MessageLite.
Reimplemented in com.google.protobuf.GeneratedMessageV3, com.google.protobuf.GeneratedMessage, com.google.protobuf.DynamicMessage, and com.google.protobuf.MapEntry< K, V >.
Definition at line 115 of file AbstractMessage.java.
|
protected |
Definition at line 119 of file AbstractMessage.java.