com.google.protobuf
Interface Message

All Superinterfaces:
MessageLite, MessageLiteOrBuilder, MessageOrBuilder
All Known Implementing Classes:
AbstractMessage, DescriptorProtos.DescriptorProto, DescriptorProtos.DescriptorProto.ExtensionRange, DescriptorProtos.EnumDescriptorProto, DescriptorProtos.EnumOptions, DescriptorProtos.EnumValueDescriptorProto, DescriptorProtos.EnumValueOptions, DescriptorProtos.FieldDescriptorProto, DescriptorProtos.FieldOptions, DescriptorProtos.FileDescriptorProto, DescriptorProtos.FileDescriptorSet, DescriptorProtos.FileOptions, DescriptorProtos.MessageOptions, DescriptorProtos.MethodDescriptorProto, DescriptorProtos.MethodOptions, DescriptorProtos.ServiceDescriptorProto, DescriptorProtos.ServiceOptions, DescriptorProtos.SourceCodeInfo, DescriptorProtos.SourceCodeInfo.Location, DescriptorProtos.UninterpretedOption, DescriptorProtos.UninterpretedOption.NamePart, DynamicMessage, GeneratedMessage, GeneratedMessage.ExtendableMessage

public interface Message
extends MessageLite, MessageOrBuilder

Abstract interface implemented by Protocol Message objects.

See also MessageLite, which defines most of the methods that typical users care about. Message adds to it methods that are not available in the "lite" runtime. The biggest added features are introspection and reflection -- i.e., getting descriptors for the message type and accessing the field values dynamically.

Author:
[email protected] Kenton Varda

Nested Class Summary
static interface Message.Builder
          Abstract interface implemented by Protocol Message builders.
 
Method Summary
 boolean equals(java.lang.Object other)
          Compares the specified object with this message for equality.
 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.
 java.lang.String toString()
          Converts the message to a string in protocol buffer text format.
 
Methods inherited from interface com.google.protobuf.MessageLite
getSerializedSize, toByteArray, toByteString, writeDelimitedTo, writeTo, writeTo
 
Methods inherited from interface com.google.protobuf.MessageOrBuilder
getAllFields, getDefaultInstanceForType, getDescriptorForType, getField, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField
 
Methods inherited from interface com.google.protobuf.MessageLiteOrBuilder
isInitialized
 

Method Detail

equals

boolean equals(java.lang.Object other)
Compares the specified object with this message for equality. Returns 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.

Overrides:
equals in class java.lang.Object
Parameters:
other - object to be compared for equality with this message
Returns:
true if the specified object is equal to this message

hashCode

int hashCode()
Returns the hash code value for this message. The hash code of a message should mix the message's type (object identity of the decsriptor) with its contents (known and unknown field values). Subclasses must implement this; inheriting Object.hashCode() is incorrect.

Overrides:
hashCode in class java.lang.Object
Returns:
the hash code value for this message
See Also:
Map.hashCode()

toString

java.lang.String toString()
Converts the message to a string in protocol buffer text format. This is just a trivial wrapper around TextFormat.printToString(Message).

Overrides:
toString in class java.lang.Object

newBuilderForType

Message.Builder newBuilderForType()
Description copied from interface: MessageLite
Constructs a new builder for a message of the same type as this message.

Specified by:
newBuilderForType in interface MessageLite

toBuilder

Message.Builder toBuilder()
Description copied from interface: MessageLite
Constructs a builder initialized with the current message. Use this to derive a new message from the current one.

Specified by:
toBuilder in interface MessageLite


Copyright © 2008-2011 Google. All Rights Reserved.