|
|
|
@ -53,6 +53,7 @@ namespace google { |
|
|
|
|
namespace protobuf { |
|
|
|
|
namespace compiler { |
|
|
|
|
namespace java { |
|
|
|
|
using Semantic = ::google::protobuf::io::AnnotationCollector::Semantic; |
|
|
|
|
|
|
|
|
|
namespace { |
|
|
|
|
|
|
|
|
@ -261,7 +262,7 @@ void ImmutableMessageFieldLiteGenerator::GenerateBuilderMembers( |
|
|
|
|
" instance.set$capitalized_name$(value);\n" |
|
|
|
|
" return this;\n" |
|
|
|
|
" }\n"); |
|
|
|
|
printer->Annotate("{", "}", descriptor_); |
|
|
|
|
printer->Annotate("{", "}", descriptor_, Semantic::kSet); |
|
|
|
|
|
|
|
|
|
// Field.Builder setField(Field.Builder builderForValue)
|
|
|
|
|
WriteFieldDocComment(printer, descriptor_); |
|
|
|
@ -272,7 +273,7 @@ void ImmutableMessageFieldLiteGenerator::GenerateBuilderMembers( |
|
|
|
|
" instance.set$capitalized_name$(builderForValue.build());\n" |
|
|
|
|
" return this;\n" |
|
|
|
|
"}\n"); |
|
|
|
|
printer->Annotate("{", "}", descriptor_); |
|
|
|
|
printer->Annotate("{", "}", descriptor_, Semantic::kSet); |
|
|
|
|
|
|
|
|
|
// Field.Builder mergeField(Field value)
|
|
|
|
|
WriteFieldDocComment(printer, descriptor_); |
|
|
|
@ -283,7 +284,7 @@ void ImmutableMessageFieldLiteGenerator::GenerateBuilderMembers( |
|
|
|
|
" instance.merge$capitalized_name$(value);\n" |
|
|
|
|
" return this;\n" |
|
|
|
|
"}\n"); |
|
|
|
|
printer->Annotate("{", "}", descriptor_); |
|
|
|
|
printer->Annotate("{", "}", descriptor_, Semantic::kSet); |
|
|
|
|
|
|
|
|
|
// Field.Builder clearField()
|
|
|
|
|
WriteFieldDocComment(printer, descriptor_); |
|
|
|
@ -293,7 +294,7 @@ void ImmutableMessageFieldLiteGenerator::GenerateBuilderMembers( |
|
|
|
|
" instance.clear$capitalized_name$();\n" |
|
|
|
|
" return this;\n" |
|
|
|
|
"}\n"); |
|
|
|
|
printer->Annotate("{", "}", descriptor_); |
|
|
|
|
printer->Annotate("{", "}", descriptor_, Semantic::kSet); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void ImmutableMessageFieldLiteGenerator::GenerateKotlinDslMembers( |
|
|
|
@ -464,7 +465,7 @@ void ImmutableMessageOneofFieldLiteGenerator::GenerateBuilderMembers( |
|
|
|
|
" instance.set$capitalized_name$(value);\n" |
|
|
|
|
" return this;\n" |
|
|
|
|
"}\n"); |
|
|
|
|
printer->Annotate("{", "}", descriptor_); |
|
|
|
|
printer->Annotate("{", "}", descriptor_, Semantic::kSet); |
|
|
|
|
|
|
|
|
|
// Field.Builder setField(Field.Builder builderForValue)
|
|
|
|
|
WriteFieldDocComment(printer, descriptor_); |
|
|
|
@ -475,7 +476,7 @@ void ImmutableMessageOneofFieldLiteGenerator::GenerateBuilderMembers( |
|
|
|
|
" instance.set$capitalized_name$(builderForValue.build());\n" |
|
|
|
|
" return this;\n" |
|
|
|
|
"}\n"); |
|
|
|
|
printer->Annotate("{", "}", descriptor_); |
|
|
|
|
printer->Annotate("{", "}", descriptor_, Semantic::kSet); |
|
|
|
|
|
|
|
|
|
// Field.Builder mergeField(Field value)
|
|
|
|
|
WriteFieldDocComment(printer, descriptor_); |
|
|
|
@ -486,7 +487,7 @@ void ImmutableMessageOneofFieldLiteGenerator::GenerateBuilderMembers( |
|
|
|
|
" instance.merge$capitalized_name$(value);\n" |
|
|
|
|
" return this;\n" |
|
|
|
|
"}\n"); |
|
|
|
|
printer->Annotate("{", "}", descriptor_); |
|
|
|
|
printer->Annotate("{", "}", descriptor_, Semantic::kSet); |
|
|
|
|
|
|
|
|
|
// Field.Builder clearField()
|
|
|
|
|
WriteFieldDocComment(printer, descriptor_); |
|
|
|
@ -497,7 +498,7 @@ void ImmutableMessageOneofFieldLiteGenerator::GenerateBuilderMembers( |
|
|
|
|
" instance.clear$capitalized_name$();\n" |
|
|
|
|
" return this;\n" |
|
|
|
|
"}\n"); |
|
|
|
|
printer->Annotate("{", "}", descriptor_); |
|
|
|
|
printer->Annotate("{", "}", descriptor_, Semantic::kSet); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// ===================================================================
|
|
|
|
@ -702,7 +703,7 @@ void RepeatedImmutableMessageFieldLiteGenerator::GenerateBuilderMembers( |
|
|
|
|
" instance.set$capitalized_name$(index, value);\n" |
|
|
|
|
" return this;\n" |
|
|
|
|
"}\n"); |
|
|
|
|
printer->Annotate("{", "}", descriptor_); |
|
|
|
|
printer->Annotate("{", "}", descriptor_, Semantic::kSet); |
|
|
|
|
|
|
|
|
|
// Builder setRepeatedField(int index, Field.Builder builderForValue)
|
|
|
|
|
WriteFieldDocComment(printer, descriptor_); |
|
|
|
@ -714,7 +715,7 @@ void RepeatedImmutableMessageFieldLiteGenerator::GenerateBuilderMembers( |
|
|
|
|
" builderForValue.build());\n" |
|
|
|
|
" return this;\n" |
|
|
|
|
"}\n"); |
|
|
|
|
printer->Annotate("{", "}", descriptor_); |
|
|
|
|
printer->Annotate("{", "}", descriptor_, Semantic::kSet); |
|
|
|
|
|
|
|
|
|
// Builder addRepeatedField(Field value)
|
|
|
|
|
WriteFieldDocComment(printer, descriptor_); |
|
|
|
@ -725,7 +726,7 @@ void RepeatedImmutableMessageFieldLiteGenerator::GenerateBuilderMembers( |
|
|
|
|
" instance.add$capitalized_name$(value);\n" |
|
|
|
|
" return this;\n" |
|
|
|
|
"}\n"); |
|
|
|
|
printer->Annotate("{", "}", descriptor_); |
|
|
|
|
printer->Annotate("{", "}", descriptor_, Semantic::kSet); |
|
|
|
|
|
|
|
|
|
// Builder addRepeatedField(int index, Field value)
|
|
|
|
|
WriteFieldDocComment(printer, descriptor_); |
|
|
|
@ -736,7 +737,7 @@ void RepeatedImmutableMessageFieldLiteGenerator::GenerateBuilderMembers( |
|
|
|
|
" instance.add$capitalized_name$(index, value);\n" |
|
|
|
|
" return this;\n" |
|
|
|
|
"}\n"); |
|
|
|
|
printer->Annotate("{", "}", descriptor_); |
|
|
|
|
printer->Annotate("{", "}", descriptor_, Semantic::kSet); |
|
|
|
|
// Builder addRepeatedField(Field.Builder builderForValue)
|
|
|
|
|
WriteFieldDocComment(printer, descriptor_); |
|
|
|
|
printer->Print(variables_, |
|
|
|
@ -746,7 +747,7 @@ void RepeatedImmutableMessageFieldLiteGenerator::GenerateBuilderMembers( |
|
|
|
|
" instance.add$capitalized_name$(builderForValue.build());\n" |
|
|
|
|
" return this;\n" |
|
|
|
|
"}\n"); |
|
|
|
|
printer->Annotate("{", "}", descriptor_); |
|
|
|
|
printer->Annotate("{", "}", descriptor_, Semantic::kSet); |
|
|
|
|
|
|
|
|
|
// Builder addRepeatedField(int index, Field.Builder builderForValue)
|
|
|
|
|
WriteFieldDocComment(printer, descriptor_); |
|
|
|
@ -758,7 +759,7 @@ void RepeatedImmutableMessageFieldLiteGenerator::GenerateBuilderMembers( |
|
|
|
|
" builderForValue.build());\n" |
|
|
|
|
" return this;\n" |
|
|
|
|
"}\n"); |
|
|
|
|
printer->Annotate("{", "}", descriptor_); |
|
|
|
|
printer->Annotate("{", "}", descriptor_, Semantic::kSet); |
|
|
|
|
|
|
|
|
|
// Builder addAllRepeatedField(Iterable<Field> values)
|
|
|
|
|
WriteFieldDocComment(printer, descriptor_); |
|
|
|
@ -769,7 +770,7 @@ void RepeatedImmutableMessageFieldLiteGenerator::GenerateBuilderMembers( |
|
|
|
|
" instance.addAll$capitalized_name$(values);\n" |
|
|
|
|
" return this;\n" |
|
|
|
|
"}\n"); |
|
|
|
|
printer->Annotate("{", "}", descriptor_); |
|
|
|
|
printer->Annotate("{", "}", descriptor_, Semantic::kSet); |
|
|
|
|
|
|
|
|
|
// Builder clearAllRepeatedField()
|
|
|
|
|
WriteFieldDocComment(printer, descriptor_); |
|
|
|
@ -780,7 +781,7 @@ void RepeatedImmutableMessageFieldLiteGenerator::GenerateBuilderMembers( |
|
|
|
|
" instance.clear$capitalized_name$();\n" |
|
|
|
|
" return this;\n" |
|
|
|
|
"}\n"); |
|
|
|
|
printer->Annotate("{", "}", descriptor_); |
|
|
|
|
printer->Annotate("{", "}", descriptor_, Semantic::kSet); |
|
|
|
|
|
|
|
|
|
// Builder removeRepeatedField(int index)
|
|
|
|
|
WriteFieldDocComment(printer, descriptor_); |
|
|
|
@ -791,7 +792,7 @@ void RepeatedImmutableMessageFieldLiteGenerator::GenerateBuilderMembers( |
|
|
|
|
" instance.remove$capitalized_name$(index);\n" |
|
|
|
|
" return this;\n" |
|
|
|
|
"}\n"); |
|
|
|
|
printer->Annotate("{", "}", descriptor_); |
|
|
|
|
printer->Annotate("{", "}", descriptor_, Semantic::kSet); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void RepeatedImmutableMessageFieldLiteGenerator::GenerateFieldInfo( |
|
|
|
|