|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
public abstract class AbstractMessage
A partial implementation of the Message interface which implements
as many methods of that interface as possible in terms of other methods.
| Nested Class Summary | |
|---|---|
static class |
AbstractMessage.Builder<BuilderType extends AbstractMessage.Builder>
A partial implementation of the Message.Builder interface which
implements as many methods of that interface as possible in terms of
other methods. |
| Field Summary |
|---|
| Fields inherited from class com.google.protobuf.AbstractMessageLite |
|---|
memoizedHashCode |
| Constructor Summary | |
|---|---|
AbstractMessage()
|
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object other)
Compares the specified object with this message for equality. |
java.util.List<java.lang.String> |
findInitializationErrors()
Returns a list of field paths (e.g. |
java.lang.String |
getInitializationErrorString()
Returns a comma-delimited list of required fields which are not set in this message object. |
Descriptors.FieldDescriptor |
getOneofFieldDescriptor(Descriptors.OneofDescriptor oneof)
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,
java.util.Map<Descriptors.FieldDescriptor,java.lang.Object> map)
Get a hash code for given fields and values, using the given seed. |
boolean |
hasOneof(Descriptors.OneofDescriptor oneof)
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. |
java.lang.String |
toString()
Converts the message to a string in protocol buffer text format. |
void |
writeTo(CodedOutputStream output)
Serializes the message and writes it to output. |
| Methods inherited from class com.google.protobuf.AbstractMessageLite |
|---|
checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.google.protobuf.Message |
|---|
getParserForType, newBuilderForType, toBuilder |
| Methods inherited from interface com.google.protobuf.MessageLite |
|---|
toByteArray, toByteString, writeDelimitedTo, writeTo |
| Methods inherited from interface com.google.protobuf.MessageOrBuilder |
|---|
getAllFields, getDefaultInstanceForType, getDescriptorForType, getField, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField |
| Constructor Detail |
|---|
public AbstractMessage()
| Method Detail |
|---|
public boolean isInitialized()
MessageLiteOrBuilderSee also: MessageOrBuilder.getInitializationErrorString()
isInitialized in interface MessageLiteOrBuilderpublic java.util.List<java.lang.String> findInitializationErrors()
MessageOrBuilderMessageLiteOrBuilder.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.
findInitializationErrors in interface MessageOrBuilderpublic java.lang.String getInitializationErrorString()
MessageOrBuilderMessageLiteOrBuilder.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.
getInitializationErrorString in interface MessageOrBuilderpublic boolean hasOneof(Descriptors.OneofDescriptor oneof)
hasOneof in interface MessageOrBuilderpublic Descriptors.FieldDescriptor getOneofFieldDescriptor(Descriptors.OneofDescriptor oneof)
getOneofFieldDescriptor in interface MessageOrBuilderpublic final java.lang.String toString()
MessageTextFormat.printToString(MessageOrBuilder).
toString in interface MessagetoString in class java.lang.Object
public void writeTo(CodedOutputStream output)
throws java.io.IOException
MessageLiteoutput. This does not
flush or close the stream.
writeTo in interface MessageLitejava.io.IOExceptionpublic int getSerializedSize()
MessageLite
getSerializedSize in interface MessageLitepublic boolean equals(java.lang.Object other)
Messagetrue 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.
equals in interface Messageequals in class java.lang.Objectother - object to be compared for equality with this message
true if the specified object is equal to this messagepublic int hashCode()
MessageObject.hashCode() is incorrect.
hashCode in interface MessagehashCode in class java.lang.ObjectMap.hashCode()
protected static int hashFields(int hash,
java.util.Map<Descriptors.FieldDescriptor,java.lang.Object> map)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||