public abstract class AbstractMessage extends AbstractMessageLiteimplements Message
Message interface which implements as many methods of that interface as possible in terms of other methods.
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractMessage
A partial implementation of the
Message.Builder interface which implements as many methods of that interface as possible in terms of other methods.
|
memoizedHashCode| Constructor and Description |
|---|
AbstractMessage()
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object
Compares the specified object with this message for equality.
|
List |
findInitializationErrors()
Returns a list of field paths (e.g.
|
String |
getInitializationErrorString()
Returns a comma-delimited list of required fields which are not set in this message object.
|
Descriptors |
getOneofFieldDescriptor(Descriptors
TODO(jieluo): Clear it when all subclasses have implemented this method.
|
int |
getSerializedSize()
Get the number of bytes required to encode this message.
|
int |
hashCode()
Returns the hash code value for this message.
|
protected static int |
hashFields(int hash, Map
Get a hash code for given fields and values, using the given seed.
|
boolean |
hasOneof(Descriptors
TODO(jieluo): Clear it when all subclasses have implemented this method.
|
boolean |
isInitialized()
Returns true if all required fields in the message and all embedded messages are set, false otherwise.
|
String |
toString()
Converts the message to a string in protocol buffer text format.
|
void |
writeTo(CodedOutputStream
Serializes the message and writes it to
output.
|
checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetParserForType, newBuilderForType, toBuildertoByteArray, toByteString, writeDelimitedTo, writeTogetAllFields, getDefaultInstanceForType, getDescriptorForType, getField, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasFieldpublic boolean isInitialized()
MessageLiteOrBuilder
public List<String > findInitializationErrors()
MessageOrBuilder
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.
public StringgetInitializationErrorString()
MessageOrBuilder
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.
public boolean hasOneof(Descriptors.OneofDescriptor oneof)
public Descriptors.FieldDescriptor getOneofFieldDescriptor(Descriptors .OneofDescriptor oneof)
public final StringtoString()
Message
TextFormat.printToString(MessageOrBuilder) .
public void writeTo(CodedOutputStreamoutput) throws IOException
MessageLite
output. This does not flush or close the stream.
writeTo in interface
MessageLite
IOException
public int getSerializedSize()
MessageLite
public boolean equals(Objectother)
Message
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.
public int hashCode()
Message
Object.hashCode() is incorrect.
hashCode in interface
Message
hashCode in class
Object
Map.hashCode()
protected static int hashFields(int hash,
Map<Descriptors.FieldDescriptor ,Object> map)