@@ -84,4 +84,36 @@ message JavaFeatures {
8484 edition_defaults = { edition : EDITION_LEGACY, value : "true" },
8585 edition_defaults = { edition : EDITION_2024, value : "false" }
8686 ];
87+
88+ message NestInFileClassFeature {
89+ enum NestInFileClass {
90+ // Invalid default, which should never be used.
91+ NEST_IN_FILE_CLASS_UNKNOWN = 0 ;
92+ // Do not nest the generated class in the file class.
93+ NO = 1 ;
94+ // Nest the generated class in the file class.
95+ YES = 2 ;
96+ // Fall back to the `java_multiple_files` option. Users won't be able to
97+ // set this option.
98+ LEGACY = 3 [feature_support = {
99+ edition_introduced : EDITION_2024
100+ edition_removed : EDITION_2024
101+ }];
102+ }
103+ reserved 1 to max;
104+ }
105+
106+ // Whether to nest the generated class in the generated file class. This is
107+ // only applicable to *top-level* messages, enums, and services.
108+ optional NestInFileClassFeature.NestInFileClass nest_in_file_class = 5 [
109+ retention = RETENTION_SOURCE ,
110+ targets = TARGET_TYPE_MESSAGE ,
111+ targets = TARGET_TYPE_ENUM ,
112+ targets = TARGET_TYPE_SERVICE ,
113+ feature_support = {
114+ edition_introduced : EDITION_2024,
115+ },
116+ edition_defaults = { edition : EDITION_LEGACY, value : "LEGACY" },
117+ edition_defaults = { edition : EDITION_2024, value : "NO" }
118+ ];
87119}
0 commit comments