public interface Message extends MessageLite, MessageOrBuilder
See also MessageLite
, which defines most of the methods that typical users care about.
Message
adds methods that are not available in the "lite" runtime. The biggest added
features are introspection and reflection; that is, getting descriptors for the message type
and accessing the field values dynamically.
Modifier and Type | Interface and Description |
---|---|
static interface |
Message.Builder
Abstract interface implemented by Protocol Message builders.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other)
Compares the specified object with this message for equality.
|
Parser<? extends Message> |
getParserForType()
Gets the parser for a message of the same type as this message.
|
int |
hashCode()
Returns the hash code value for this message.
|
Message.Builder |
newBuilderForType()
Constructs a new builder for a message of the same type as this message.
|
Message.Builder |
toBuilder()
Constructs a builder initialized with the current message.
|
String |
toString()
Converts the message to a string in protocol buffer text format.
|
getSerializedSize, toByteArray, toByteString, writeDelimitedTo, writeTo, writeTo
findInitializationErrors, getAllFields, getDefaultInstanceForType, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
isInitialized
Parser<? extends Message> getParserForType()
MessageLite
getParserForType
in interface MessageLite
boolean equals(Object other)
true
if the given
object is a message of the same type (as defined by getDescriptorForType()
) and has
identical values for all of its fields. Subclasses must implement this; inheriting Object.equals()
is incorrect.int hashCode()
Object.hashCode()
is incorrect.hashCode
in class Object
Map.hashCode()
String toString()
TextFormat.Printer.printToString(MessageOrBuilder)
.Message.Builder newBuilderForType()
MessageLite
newBuilderForType
in interface MessageLite
Message.Builder toBuilder()
MessageLite
toBuilder
in interface MessageLite
Copyright © 2008–2022. All rights reserved.