Class GeneratedMessage

All Implemented Interfaces:
Message, MessageLite, MessageLiteOrBuilder, MessageOrBuilder, Serializable
Direct Known Subclasses:
Any, Api, BoolValue, BytesValue, DescriptorProtos.DescriptorProto, DescriptorProtos.DescriptorProto.ExtensionRange, DescriptorProtos.DescriptorProto.ReservedRange, DescriptorProtos.EnumDescriptorProto, DescriptorProtos.EnumDescriptorProto.EnumReservedRange, DescriptorProtos.EnumValueDescriptorProto, DescriptorProtos.ExtensionRangeOptions.Declaration, DescriptorProtos.FeatureSet.VisibilityFeature, DescriptorProtos.FeatureSetDefaults, DescriptorProtos.FeatureSetDefaults.FeatureSetEditionDefault, DescriptorProtos.FieldDescriptorProto, DescriptorProtos.FieldOptions.EditionDefault, DescriptorProtos.FieldOptions.FeatureSupport, DescriptorProtos.FileDescriptorProto, DescriptorProtos.GeneratedCodeInfo, DescriptorProtos.GeneratedCodeInfo.Annotation, DescriptorProtos.MethodDescriptorProto, DescriptorProtos.OneofDescriptorProto, DescriptorProtos.ServiceDescriptorProto, DescriptorProtos.SourceCodeInfo.Location, DescriptorProtos.UninterpretedOption, DescriptorProtos.UninterpretedOption.NamePart, DoubleValue, Duration, Empty, Enum, EnumValue, Field, FieldMask, FloatValue, GeneratedMessage.ExtendableMessage, Int32Value, Int64Value, JavaFeaturesProto.JavaFeatures, JavaFeaturesProto.JavaFeatures.NestInFileClassFeature, ListValue, Method, Mixin, Option, PluginProtos.CodeGeneratorRequest, PluginProtos.CodeGeneratorResponse, PluginProtos.CodeGeneratorResponse.File, PluginProtos.Version, SourceContext, StringValue, Struct, Timestamp, Type, UInt32Value, UInt64Value, Value

public abstract class GeneratedMessage extends AbstractMessage implements Serializable
All generated protocol message classes extend this class. This class implements most of the Message and Builder interfaces using Java reflection.

Users should generally ignore this class and use the Message interface instead.

This class is intended to only be extended by protoc created gencode. It is not intended or supported to extend this class, and any protected methods may be removed without it being considered a breaking change as long as all supported gencode does not depend on the changed methods.

See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • logger

      private static final Logger logger
    • alwaysUseFieldBuilders

      protected static boolean alwaysUseFieldBuilders
      For testing. Allows a test to disable the optimization that avoids using field builders for nested messages until they are requested. By disabling this optimization, existing tests can be reused to test the field builders.
    • unknownFields

      protected UnknownFieldSet unknownFields
      For use by generated code only.

      TODO: mark this private and final (breaking change)

    • PRE22_GENCODE_SILENCE_PROPERTY

      static final String PRE22_GENCODE_SILENCE_PROPERTY
      See Also:
    • PRE22_GENCODE_ERROR_PROPERTY

      static final String PRE22_GENCODE_ERROR_PROPERTY
      See Also:
    • PRE22_GENCODE_VULNERABILITY_MESSAGE

      static final String PRE22_GENCODE_VULNERABILITY_MESSAGE
      See Also:
    • loggedPre22TypeNames

      protected static final Set<String> loggedPre22TypeNames
  • Constructor Details

    • GeneratedMessage

      protected GeneratedMessage()
    • GeneratedMessage

      protected GeneratedMessage(GeneratedMessage.Builder<?> builder)
  • Method Details