Interface Message

All Superinterfaces:
com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, MessageOrBuilder
All Known Implementing Classes:
AbstractMessage, Any, Api, BoolValue, BytesValue, CompactThing, CompactThings, 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.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, GetFileDescriptorSetRequest, GetFileDescriptorSetResponse, GetThingRequest, GetThingResponse, GetThingsRequest, GetThingsResponse, Int32Value, Int64Value, JavaFeaturesProto.JavaFeatures, LinksMetadata, ListValue, Log, Log.Entry, Log.Inline, MapEntry, Method, Mixin, Option, PluginProtos.CodeGeneratorRequest, PluginProtos.CodeGeneratorResponse, PluginProtos.CodeGeneratorResponse.File, PluginProtos.Version, SourceContext, StringValue, Struct, TextThing, TextThings, Thing, ThingMetadata, Things, Timestamp, Type, UInt32Value, UInt64Value, Validation, Validations, Value, Value, Value.LangString, Value.List, Value.Literal

@CheckReturnValue public interface Message extends com.google.protobuf.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 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.

  • Method Details

    • getParserForType

      com.google.protobuf.Parser<? extends Message> getParserForType()
      Specified by:
      getParserForType in interface com.google.protobuf.MessageLite
    • equals

      boolean equals(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 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 descriptor) with its contents (known and unknown field values). Subclasses must implement this; inheriting Object.hashCode() is incorrect.
      Overrides:
      hashCode in class Object
      Returns:
      the hash code value for this message
      See Also:
    • toString

      String toString()
      Converts the message to a string in protocol buffer text format. This is just a trivial wrapper around TextFormat.Printer.printToString(MessageOrBuilder).
      Overrides:
      toString in class Object
    • newBuilderForType

      Message.Builder newBuilderForType()
      Specified by:
      newBuilderForType in interface com.google.protobuf.MessageLite
    • toBuilder

      Message.Builder toBuilder()
      Specified by:
      toBuilder in interface com.google.protobuf.MessageLite