Add semantic annotations for field accessors in java proto lite

PiperOrigin-RevId: 532204580
pull/12817/head
Protobuf Team Bot 2 years ago committed by Copybara-Service
parent d33b00bdaa
commit 183521a072
  1. 3
      objectivec/GPBAny.pbobjc.h
  2. 27
      src/google/protobuf/compiler/java/enum_field_lite.cc
  3. 13
      src/google/protobuf/compiler/java/map_field_lite.cc
  4. 35
      src/google/protobuf/compiler/java/message_field_lite.cc
  5. 17
      src/google/protobuf/compiler/java/primitive_field_lite.cc
  6. 29
      src/google/protobuf/compiler/java/string_field_lite.cc

@ -157,8 +157,7 @@ GPB_FINAL @interface GPBAny : GPBMessage
*
* Note: this functionality is not currently available in the official
* protobuf release, and it is not used for type URLs beginning with
* type.googleapis.com. As of May 2023, there are no widely used type server
* implementations and no plans to implement one.
* type.googleapis.com.
*
* Schemes other than `http`, `https` (or the empty scheme) might be
* used with implementation specific semantics.

@ -55,6 +55,7 @@ namespace google {
namespace protobuf {
namespace compiler {
namespace java {
using Semantic = ::google::protobuf::io::AnnotationCollector::Semantic;
namespace {
bool EnableExperimentalRuntimeForLite() {
@ -276,7 +277,7 @@ void ImmutableEnumFieldLiteGenerator::GenerateBuilderMembers(
" instance.set$capitalized_name$Value(value);\n"
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
printer->Annotate("{", "}", descriptor_, Semantic::kSet);
}
WriteFieldAccessorDocComment(printer, descriptor_, GETTER);
printer->Print(variables_,
@ -294,7 +295,7 @@ void ImmutableEnumFieldLiteGenerator::GenerateBuilderMembers(
" instance.set$capitalized_name$(value);\n"
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
printer->Annotate("{", "}", descriptor_, Semantic::kSet);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
/* builder */ true);
printer->Print(
@ -304,7 +305,7 @@ void ImmutableEnumFieldLiteGenerator::GenerateBuilderMembers(
" instance.clear$capitalized_name$();\n"
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
printer->Annotate("{", "}", descriptor_, Semantic::kSet);
}
void ImmutableEnumFieldLiteGenerator::GenerateKotlinDslMembers(
@ -495,7 +496,7 @@ void ImmutableEnumOneofFieldLiteGenerator::GenerateBuilderMembers(
" instance.set$capitalized_name$Value(value);\n"
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
printer->Annotate("{", "}", descriptor_, Semantic::kSet);
}
WriteFieldAccessorDocComment(printer, descriptor_, GETTER);
printer->Print(variables_,
@ -513,7 +514,7 @@ void ImmutableEnumOneofFieldLiteGenerator::GenerateBuilderMembers(
" instance.set$capitalized_name$(value);\n"
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
printer->Annotate("{", "}", descriptor_, Semantic::kSet);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
/* builder */ true);
printer->Print(
@ -523,7 +524,7 @@ void ImmutableEnumOneofFieldLiteGenerator::GenerateBuilderMembers(
" instance.clear$capitalized_name$();\n"
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
printer->Annotate("{", "}", descriptor_, Semantic::kSet);
}
// ===================================================================
@ -768,7 +769,7 @@ void RepeatedImmutableEnumFieldLiteGenerator::GenerateBuilderMembers(
" instance.set$capitalized_name$(index, value);\n"
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
printer->Annotate("{", "}", descriptor_, Semantic::kSet);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER,
/* builder */ true);
printer->Print(variables_,
@ -778,7 +779,7 @@ void RepeatedImmutableEnumFieldLiteGenerator::GenerateBuilderMembers(
" instance.add$capitalized_name$(value);\n"
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
printer->Annotate("{", "}", descriptor_, Semantic::kSet);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER,
/* builder */ true);
printer->Print(variables_,
@ -788,7 +789,7 @@ void RepeatedImmutableEnumFieldLiteGenerator::GenerateBuilderMembers(
" instance.addAll$capitalized_name$(values);"
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
printer->Annotate("{", "}", descriptor_, Semantic::kSet);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
/* builder */ true);
printer->Print(
@ -798,7 +799,7 @@ void RepeatedImmutableEnumFieldLiteGenerator::GenerateBuilderMembers(
" instance.clear$capitalized_name$();\n"
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
printer->Annotate("{", "}", descriptor_, Semantic::kSet);
if (SupportUnknownEnumValue(descriptor_)) {
WriteFieldEnumValueAccessorDocComment(printer, descriptor_, LIST_GETTER);
@ -830,7 +831,7 @@ void RepeatedImmutableEnumFieldLiteGenerator::GenerateBuilderMembers(
" instance.set$capitalized_name$Value(index, value);\n"
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
printer->Annotate("{", "}", descriptor_, Semantic::kSet);
WriteFieldEnumValueAccessorDocComment(printer, descriptor_, LIST_ADDER,
/* builder */ true);
printer->Print(variables_,
@ -840,7 +841,7 @@ void RepeatedImmutableEnumFieldLiteGenerator::GenerateBuilderMembers(
" instance.add$capitalized_name$Value(value);\n"
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
printer->Annotate("{", "}", descriptor_, Semantic::kSet);
WriteFieldEnumValueAccessorDocComment(printer, descriptor_,
LIST_MULTI_ADDER,
/* builder */ true);
@ -852,7 +853,7 @@ void RepeatedImmutableEnumFieldLiteGenerator::GenerateBuilderMembers(
" instance.addAll$capitalized_name$Value(values);\n"
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
printer->Annotate("{", "}", descriptor_, Semantic::kSet);
}
}

@ -48,6 +48,7 @@ namespace compiler {
namespace java {
namespace {
using Semantic = ::google::protobuf::io::AnnotationCollector::Semantic;
std::string TypeName(const FieldDescriptor* field,
ClassNameResolver* name_resolver, bool boxed) {
@ -602,7 +603,7 @@ void ImmutableMapFieldLiteGenerator::GenerateBuilderMembers(
" instance.getMutable$capitalized_name$Map().clear();\n"
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
printer->Annotate("{", "}", descriptor_, Semantic::kSet);
WriteFieldDocComment(printer, descriptor_);
printer->Print(variables_,
"$deprecation$\n"
@ -613,7 +614,7 @@ void ImmutableMapFieldLiteGenerator::GenerateBuilderMembers(
" instance.getMutable$capitalized_name$Map().remove(key);\n"
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
printer->Annotate("{", "}", descriptor_, Semantic::kSet);
const FieldDescriptor* value = MapValueField(descriptor_);
if (GetJavaType(value) == JAVATYPE_ENUM) {
if (context_->options().opensource_runtime) {
@ -694,7 +695,7 @@ void ImmutableMapFieldLiteGenerator::GenerateBuilderMembers(
" instance.getMutable$capitalized_name$Map().putAll(values);\n"
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
printer->Annotate("{", "}", descriptor_, Semantic::kSet);
if (SupportUnknownEnumValue(value)) {
printer->Print(
variables_,
@ -771,7 +772,7 @@ void ImmutableMapFieldLiteGenerator::GenerateBuilderMembers(
" instance.getMutable$capitalized_name$ValueMap().putAll(values);\n"
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
printer->Annotate("{", "}", descriptor_, Semantic::kSet);
}
} else {
if (context_->options().opensource_runtime) {
@ -840,7 +841,7 @@ void ImmutableMapFieldLiteGenerator::GenerateBuilderMembers(
" instance.getMutable$capitalized_name$Map().put(key, value);\n"
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
printer->Annotate("{", "}", descriptor_, Semantic::kSet);
WriteFieldDocComment(printer, descriptor_);
printer->Print(
variables_,
@ -851,7 +852,7 @@ void ImmutableMapFieldLiteGenerator::GenerateBuilderMembers(
" instance.getMutable$capitalized_name$Map().putAll(values);\n"
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
printer->Annotate("{", "}", descriptor_, Semantic::kSet);
}
}

@ -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(

@ -53,6 +53,7 @@ namespace java {
using internal::WireFormat;
using internal::WireFormatLite;
using Semantic = ::google::protobuf::io::AnnotationCollector::Semantic;
namespace {
bool EnableExperimentalRuntimeForLite() {
@ -323,7 +324,7 @@ void ImmutablePrimitiveFieldLiteGenerator::GenerateBuilderMembers(
" instance.set$capitalized_name$(value);\n"
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
printer->Annotate("{", "}", descriptor_, Semantic::kSet);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
/* builder */ true);
@ -334,7 +335,7 @@ void ImmutablePrimitiveFieldLiteGenerator::GenerateBuilderMembers(
" instance.clear$capitalized_name$();\n"
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
printer->Annotate("{", "}", descriptor_, Semantic::kSet);
}
void ImmutablePrimitiveFieldLiteGenerator::GenerateKotlinDslMembers(
@ -484,7 +485,7 @@ void ImmutablePrimitiveOneofFieldLiteGenerator::GenerateBuilderMembers(
" instance.set$capitalized_name$(value);\n"
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
printer->Annotate("{", "}", descriptor_, Semantic::kSet);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
/* builder */ true);
@ -495,7 +496,7 @@ void ImmutablePrimitiveOneofFieldLiteGenerator::GenerateBuilderMembers(
" instance.clear$capitalized_name$();\n"
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
printer->Annotate("{", "}", descriptor_, Semantic::kSet);
}
// ===================================================================
@ -649,7 +650,7 @@ void RepeatedImmutablePrimitiveFieldLiteGenerator::GenerateBuilderMembers(
" instance.set$capitalized_name$(index, value);\n"
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
printer->Annotate("{", "}", descriptor_, Semantic::kSet);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER,
/* builder */ true);
printer->Print(variables_,
@ -659,7 +660,7 @@ void RepeatedImmutablePrimitiveFieldLiteGenerator::GenerateBuilderMembers(
" instance.add$capitalized_name$(value);\n"
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
printer->Annotate("{", "}", descriptor_, Semantic::kSet);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER,
/* builder */ true);
printer->Print(variables_,
@ -669,7 +670,7 @@ void RepeatedImmutablePrimitiveFieldLiteGenerator::GenerateBuilderMembers(
" instance.addAll$capitalized_name$(values);\n"
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
printer->Annotate("{", "}", descriptor_, Semantic::kSet);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
/* builder */ true);
printer->Print(
@ -679,7 +680,7 @@ void RepeatedImmutablePrimitiveFieldLiteGenerator::GenerateBuilderMembers(
" instance.clear$capitalized_name$();\n"
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
printer->Annotate("{", "}", descriptor_, Semantic::kSet);
}
void RepeatedImmutablePrimitiveFieldLiteGenerator::GenerateKotlinDslMembers(

@ -54,6 +54,7 @@ namespace java {
using internal::WireFormat;
using internal::WireFormatLite;
using Semantic = ::google::protobuf::io::AnnotationCollector::Semantic;
namespace {
@ -310,7 +311,7 @@ void ImmutableStringFieldLiteGenerator::GenerateBuilderMembers(
" instance.set$capitalized_name$(value);\n"
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
printer->Annotate("{", "}", descriptor_, Semantic::kSet);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
/* builder */ true);
printer->Print(
@ -320,7 +321,7 @@ void ImmutableStringFieldLiteGenerator::GenerateBuilderMembers(
" instance.clear$capitalized_name$();\n"
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
printer->Annotate("{", "}", descriptor_, Semantic::kSet);
WriteFieldStringBytesAccessorDocComment(printer, descriptor_, SETTER,
/* builder */ true);
@ -332,7 +333,7 @@ void ImmutableStringFieldLiteGenerator::GenerateBuilderMembers(
" instance.set$capitalized_name$Bytes(value);\n"
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
printer->Annotate("{", "}", descriptor_, Semantic::kSet);
}
void ImmutableStringFieldLiteGenerator::GenerateKotlinDslMembers(
@ -444,7 +445,7 @@ void ImmutableStringOneofFieldLiteGenerator::GenerateMembers(
" $set_oneof_case_message$;\n"
" $oneof_name$_ = value;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
printer->Annotate("{", "}", descriptor_, Semantic::kSet);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER);
printer->Print(variables_,
"private void ${$clear$capitalized_name$$}$() {\n"
@ -453,13 +454,13 @@ void ImmutableStringOneofFieldLiteGenerator::GenerateMembers(
" $oneof_name$_ = null;\n"
" }\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
printer->Annotate("{", "}", descriptor_, Semantic::kSet);
WriteFieldStringBytesAccessorDocComment(printer, descriptor_, SETTER);
printer->Print(variables_,
"private void ${$set$capitalized_name$Bytes$}$(\n"
" com.google.protobuf.ByteString value) {\n");
printer->Annotate("{", "}", descriptor_);
printer->Annotate("{", "}", descriptor_, Semantic::kSet);
if (CheckUtf8(descriptor_)) {
printer->Print(variables_, " checkByteStringIsUtf8(value);\n");
}
@ -515,7 +516,7 @@ void ImmutableStringOneofFieldLiteGenerator::GenerateBuilderMembers(
" instance.set$capitalized_name$(value);\n"
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
printer->Annotate("{", "}", descriptor_, Semantic::kSet);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
/* builder */ true);
printer->Print(
@ -525,7 +526,7 @@ void ImmutableStringOneofFieldLiteGenerator::GenerateBuilderMembers(
" instance.clear$capitalized_name$();\n"
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
printer->Annotate("{", "}", descriptor_, Semantic::kSet);
WriteFieldStringBytesAccessorDocComment(printer, descriptor_, SETTER,
/* builder */ true);
@ -537,7 +538,7 @@ void ImmutableStringOneofFieldLiteGenerator::GenerateBuilderMembers(
" instance.set$capitalized_name$Bytes(value);\n"
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
printer->Annotate("{", "}", descriptor_, Semantic::kSet);
}
// ===================================================================
@ -724,7 +725,7 @@ void RepeatedImmutableStringFieldLiteGenerator::GenerateBuilderMembers(
" instance.set$capitalized_name$(index, value);\n"
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
printer->Annotate("{", "}", descriptor_, Semantic::kSet);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER,
/* builder */ true);
printer->Print(variables_,
@ -734,7 +735,7 @@ void RepeatedImmutableStringFieldLiteGenerator::GenerateBuilderMembers(
" instance.add$capitalized_name$(value);\n"
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
printer->Annotate("{", "}", descriptor_, Semantic::kSet);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER,
/* builder */ true);
printer->Print(variables_,
@ -744,7 +745,7 @@ void RepeatedImmutableStringFieldLiteGenerator::GenerateBuilderMembers(
" instance.addAll$capitalized_name$(values);\n"
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
printer->Annotate("{", "}", descriptor_, Semantic::kSet);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
/* builder */ true);
printer->Print(
@ -754,7 +755,7 @@ void RepeatedImmutableStringFieldLiteGenerator::GenerateBuilderMembers(
" instance.clear$capitalized_name$();\n"
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
printer->Annotate("{", "}", descriptor_, Semantic::kSet);
WriteFieldStringBytesAccessorDocComment(printer, descriptor_, LIST_ADDER,
/* builder */ true);
@ -766,7 +767,7 @@ void RepeatedImmutableStringFieldLiteGenerator::GenerateBuilderMembers(
" instance.add$capitalized_name$Bytes(value);\n"
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
printer->Annotate("{", "}", descriptor_, Semantic::kSet);
}
void RepeatedImmutableStringFieldLiteGenerator::GenerateKotlinDslMembers(

Loading…
Cancel
Save