Stubs

Module

stubs/wellknowntypes

The Protobuf well-known types (google/protobuf/*.proto), from Google's protobuf releases.

OfficialPublic

Message in pb

JavaFeatures

pb.JavaFeatures

Fields

FieldTypeNumberDescription
legacy_closed_enumoptionalbool1

Whether or not to treat an enum field as closed. This option is only applicable to enum fields, and will be removed in the future. It is consistent with the legacy behavior of using proto3 enum types for proto2 fields.

  • option retention = RETENTION_RUNTIME;
  • option targets = [TARGET_TYPE_FIELD, TARGET_TYPE_FILE];
  • option edition_defaults = [{ value: "true" edition: EDITION_LEGACY }, { value: "false" edition: EDITION_PROTO3 }];
  • option feature_support = { edition_introduced: EDITION_2023 edition_deprecated: EDITION_2023 deprecation_warning: "The legacy closed enum behavior in Java is deprecated and is scheduled to be removed in edition 2025. See http://protobuf.dev/programming-guides/enum/#java for more information." };
utf8_validationoptionalUtf8Validation2
  • option retention = RETENTION_RUNTIME;
  • option targets = [TARGET_TYPE_FIELD, TARGET_TYPE_FILE];
  • option edition_defaults = [{ value: "DEFAULT" edition: EDITION_LEGACY }];
  • option feature_support = { edition_introduced: EDITION_2023 edition_deprecated: EDITION_2024 deprecation_warning: "The Java-specific utf8 validation feature is deprecated and is scheduled to be removed in edition 2025. Utf8 validation behavior should use the global cross-language utf8_validation feature." };
large_enumoptionalbool3

Allows creation of large Java enums, extending beyond the standard constant limits imposed by the Java language.

  • option retention = RETENTION_RUNTIME;
  • option targets = [TARGET_TYPE_ENUM, TARGET_TYPE_FILE];
  • option edition_defaults = [{ value: "false" edition: EDITION_LEGACY }];
  • option feature_support = { edition_introduced: EDITION_2024 };
use_old_outer_classname_defaultoptionalbool4

Whether to use the old default outer class name scheme, or the new feature which adds a "Proto" suffix to the outer class name.

Users will not be able to set this option, because we removed it in the same edition that it was introduced. But we use it to determine which naming scheme to use for outer class name defaults.

  • option retention = RETENTION_RUNTIME;
  • option targets = [TARGET_TYPE_FILE];
  • option edition_defaults = [{ value: "true" edition: EDITION_LEGACY }, { value: "false" edition: EDITION_2024 }];
  • option feature_support = { edition_introduced: EDITION_2024 edition_removed: EDITION_2024 };
nest_in_file_classoptionalNestInFileClass5

Whether to nest the generated class in the generated file class. This is only applicable to top-level messages, enums, and services.

  • option retention = RETENTION_RUNTIME;
  • option targets = [TARGET_TYPE_MESSAGE, TARGET_TYPE_ENUM, TARGET_TYPE_SERVICE];
  • option edition_defaults = [{ value: "LEGACY" edition: EDITION_LEGACY }, { value: "NO" edition: EDITION_2024 }];
  • option feature_support = { edition_introduced: EDITION_2024 };

Nested messages

Nested enums

Reserved numbers: 6

Used by

Defined in google/protobuf/java_features.proto