Package com.google.protobuf
Interface Message
-
- All Superinterfaces:
com.google.protobuf.MessageLite,com.google.protobuf.MessageLiteOrBuilder,MessageOrBuilder
- All Known Implementing Classes:
AbstractMessage,Any,Api,BoolValue,BytesValue,DescriptorProtos.DescriptorProto,DescriptorProtos.DescriptorProto.ExtensionRange,DescriptorProtos.DescriptorProto.ReservedRange,DescriptorProtos.EnumDescriptorProto,DescriptorProtos.EnumDescriptorProto.EnumReservedRange,DescriptorProtos.EnumOptions,DescriptorProtos.EnumValueDescriptorProto,DescriptorProtos.EnumValueOptions,DescriptorProtos.ExtensionRangeOptions,DescriptorProtos.ExtensionRangeOptions.Declaration,DescriptorProtos.FeatureSet,DescriptorProtos.FeatureSet.VisibilityFeature,DescriptorProtos.FeatureSetDefaults,DescriptorProtos.FeatureSetDefaults.FeatureSetEditionDefault,DescriptorProtos.FieldDescriptorProto,DescriptorProtos.FieldOptions,DescriptorProtos.FieldOptions.EditionDefault,DescriptorProtos.FieldOptions.FeatureSupport,DescriptorProtos.FileDescriptorProto,DescriptorProtos.FileDescriptorSet,DescriptorProtos.FileOptions,DescriptorProtos.GeneratedCodeInfo,DescriptorProtos.GeneratedCodeInfo.Annotation,DescriptorProtos.MessageOptions,DescriptorProtos.MethodDescriptorProto,DescriptorProtos.MethodOptions,DescriptorProtos.OneofDescriptorProto,DescriptorProtos.OneofOptions,DescriptorProtos.ServiceDescriptorProto,DescriptorProtos.ServiceOptions,DescriptorProtos.SourceCodeInfo,DescriptorProtos.SourceCodeInfo.Location,DescriptorProtos.UninterpretedOption,DescriptorProtos.UninterpretedOption.NamePart,DoubleValue,Duration,DynamicMessage,Empty,Enum,EnumValue,Field,FieldMask,FloatValue,GeneratedMessage,GeneratedMessage.ExtendableMessage,GeneratedMessageV3,GeneratedMessageV3.ExtendableMessage,Int32Value,Int64Value,JavaFeaturesProto.JavaFeatures,JavaFeaturesProto.JavaFeatures.NestInFileClassFeature,ListValue,MapEntry,Method,Mixin,Option,PluginProtos.CodeGeneratorRequest,PluginProtos.CodeGeneratorResponse,PluginProtos.CodeGeneratorResponse.File,PluginProtos.Version,SourceContext,StringValue,Struct,Timestamp,Type,UInt32Value,UInt64Value,Value
@CheckReturnValue public interface Message extends com.google.protobuf.MessageLite, MessageOrBuilder
Abstract interface implemented by Protocol Message objects.This interface is intended to only be implemented by protoc created gencode. It is not intended or supported to implement this interface manually.
See also
MessageLite, which defines most of the methods that typical users care about.Messageadds 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceMessage.BuilderAbstract interface implemented by Protocol Message builders.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanequals(java.lang.Object other)Compares the specified object with this message for equality.com.google.protobuf.Parser<? extends Message>getParserForType()inthashCode()Returns the hash code value for this message.Message.BuildernewBuilderForType()Message.BuildertoBuilder()java.lang.StringtoString()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
findInitializationErrors, getAllFields, getDefaultInstanceForType, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
-
-
-
Method Detail
-
getParserForType
com.google.protobuf.Parser<? extends Message> getParserForType()
- Specified by:
getParserForTypein interfacecom.google.protobuf.MessageLite
-
equals
boolean equals(java.lang.Object other)
Compares the specified object with this message for equality. Returnstrueif the given object is a message of the same type (as defined bygetDescriptorForType()) and has identical values for all of its fields. Subclasses must implement this; inheritingObject.equals()is incorrect.- Overrides:
equalsin classjava.lang.Object- Parameters:
other- object to be compared for equality with this message- Returns:
trueif 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 descriptor) with its contents (known and unknown field values). Subclasses must implement this; inheritingObject.hashCode()is incorrect.- Overrides:
hashCodein classjava.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 aroundTextFormat.Printer.printToString(MessageOrBuilder).- Overrides:
toStringin classjava.lang.Object
-
newBuilderForType
Message.Builder newBuilderForType()
- Specified by:
newBuilderForTypein interfacecom.google.protobuf.MessageLite
-
toBuilder
Message.Builder toBuilder()
- Specified by:
toBuilderin interfacecom.google.protobuf.MessageLite
-
-