|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.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. |
Constructor Summary | |
---|---|
AbstractMessage()
|
Method Summary | |
---|---|
boolean |
equals(java.lang.Object other)
Compares the specified object with this message for equality. |
int |
getSerializedSize()
Get the number of bytes required to encode this message. |
protected static int |
hashBoolean(boolean b)
Helper method for implementing Message.hashCode() . |
int |
hashCode()
Returns the hash code value for this message. |
protected static int |
hashEnum(Internal.EnumLite e)
Helper method for implementing Message.hashCode() . |
protected static int |
hashEnumList(java.util.List<? extends Internal.EnumLite> list)
Helper method for implementing Message.hashCode() . |
protected 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. |
protected static int |
hashLong(long n)
Helper method for implementing Message.hashCode() . |
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 |
---|
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 |
---|
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()
MessageLiteOrBuilder
isInitialized
in interface MessageLiteOrBuilder
public final java.lang.String toString()
Message
TextFormat.printToString(Message)
.
toString
in interface Message
toString
in class java.lang.Object
public void writeTo(CodedOutputStream output) throws java.io.IOException
MessageLite
output
. This does not
flush or close the stream.
writeTo
in interface MessageLite
java.io.IOException
public int getSerializedSize()
MessageLite
getSerializedSize
in interface MessageLite
public boolean equals(java.lang.Object other)
Message
getDescriptorForType()
) and has identical values for
all of its fields. Subclasses must implement this; inheriting
Object.equals()
is incorrect.
equals
in interface Message
equals
in class java.lang.Object
other
- object to be compared for equality with this message
public int hashCode()
Message
Object.hashCode()
is incorrect.
hashCode
in interface Message
hashCode
in class java.lang.Object
Map.hashCode()
protected int hashFields(int hash, java.util.Map<Descriptors.FieldDescriptor,java.lang.Object> map)
protected static int hashLong(long n)
Message.hashCode()
.
Boolean.hashCode()
protected static int hashBoolean(boolean b)
Message.hashCode()
.
Boolean.hashCode()
protected static int hashEnum(Internal.EnumLite e)
Message.hashCode()
.
This is needed because Enum.hashCode()
is final, but we
need to use the field number as the hash code to ensure compatibility
between statically and dynamically generated enum objects.
protected static int hashEnumList(java.util.List<? extends Internal.EnumLite> list)
Message.hashCode()
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |