Use parameter name comment

This commit is contained in:
ST-DDT 2019-06-26 20:38:49 +02:00
parent 73e0d748b9
commit 5af81a442b
No known key found for this signature in database
GPG Key ID: B0ACEF01F52929C3
8 changed files with 144 additions and 82 deletions

3
.gitignore vendored
View File

@ -197,6 +197,9 @@ cmake/cmake-build-debug/
# Visual Studio 2017
.vs
# Visual Studio Code
/.vscode/
# IntelliJ
.idea
*.iml

View File

@ -280,7 +280,7 @@ void WriteFieldEnumValueAccessorDocComment(io::Printer* printer,
"name", field->camelcase_name());
break;
case LIST_INDEXED_SETTER:
printer->Print(" * @param index The index of the value to return.\n");
printer->Print(" * @param index The index to set the value at.\n");
printer->Print(" * @param value The enum value of the $name$ to set.\n",
"name", field->camelcase_name());
break;
@ -336,7 +336,7 @@ void WriteFieldStringBytesAccessorDocComment(io::Printer* printer,
"name", field->camelcase_name());
break;
case LIST_INDEXED_SETTER:
printer->Print(" * @param index The index of the value to return.\n");
printer->Print(" * @param index The index to set the value at.\n");
printer->Print(" * @param value The bytes of the $name$ to set.\n",
"name", field->camelcase_name());
break;

View File

@ -220,7 +220,8 @@ void ImmutableEnumFieldGenerator::GenerateBuilderMembers(
" return $name$_;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldEnumValueAccessorDocComment(printer, descriptor_, SETTER);
WriteFieldEnumValueAccessorDocComment(printer, descriptor_, SETTER,
/* builder */ true);
printer->Print(variables_,
"$deprecation$public Builder "
"${$set$capitalized_name$Value$}$(int value) {\n"
@ -238,7 +239,8 @@ void ImmutableEnumFieldGenerator::GenerateBuilderMembers(
" return result == null ? $unknown$ : result;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, SETTER, true);
WriteFieldAccessorDocComment(printer, descriptor_, SETTER,
/* builder */ true);
printer->Print(variables_,
"$deprecation$public Builder "
"${$set$capitalized_name$$}$($type$ value) {\n"
@ -251,7 +253,8 @@ void ImmutableEnumFieldGenerator::GenerateBuilderMembers(
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, true);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
/* builder */ true);
printer->Print(
variables_,
"$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n"
@ -441,7 +444,8 @@ void ImmutableEnumOneofFieldGenerator::GenerateBuilderMembers(
" return $default_number$;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldEnumValueAccessorDocComment(printer, descriptor_, SETTER, true);
WriteFieldEnumValueAccessorDocComment(printer, descriptor_, SETTER,
/* builder */ true);
printer->Print(variables_,
"$deprecation$public Builder "
"${$set$capitalized_name$Value$}$(int value) {\n"
@ -464,7 +468,8 @@ void ImmutableEnumOneofFieldGenerator::GenerateBuilderMembers(
" return $default$;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, SETTER, true);
WriteFieldAccessorDocComment(printer, descriptor_, SETTER,
/* builder */ true);
printer->Print(variables_,
"$deprecation$public Builder "
"${$set$capitalized_name$$}$($type$ value) {\n"
@ -477,7 +482,8 @@ void ImmutableEnumOneofFieldGenerator::GenerateBuilderMembers(
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, true);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
/* builder */ true);
printer->Print(
variables_,
"$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n"
@ -738,7 +744,8 @@ void RepeatedImmutableEnumFieldGenerator::GenerateBuilderMembers(
" return $name$_converter_.convert($name$_.get(index));\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER, true);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER,
/* builder */ true);
printer->Print(variables_,
"$deprecation$public Builder ${$set$capitalized_name$$}$(\n"
" int index, $type$ value) {\n"
@ -751,7 +758,8 @@ void RepeatedImmutableEnumFieldGenerator::GenerateBuilderMembers(
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER, true);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER,
/* builder */ true);
printer->Print(variables_,
"$deprecation$public Builder "
"${$add$capitalized_name$$}$($type$ value) {\n"
@ -764,7 +772,8 @@ void RepeatedImmutableEnumFieldGenerator::GenerateBuilderMembers(
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER, true);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER,
/* builder */ true);
printer->Print(variables_,
"$deprecation$public Builder ${$addAll$capitalized_name$$}$(\n"
" java.lang.Iterable<? extends $type$> values) {\n"
@ -776,7 +785,8 @@ void RepeatedImmutableEnumFieldGenerator::GenerateBuilderMembers(
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, true);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
/* builder */ true);
printer->Print(
variables_,
"$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n"
@ -804,7 +814,8 @@ void RepeatedImmutableEnumFieldGenerator::GenerateBuilderMembers(
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldEnumValueAccessorDocComment(printer, descriptor_,
LIST_INDEXED_GETTER, true);
LIST_INDEXED_GETTER,
/* builder */ true);
printer->Print(
variables_,
"$deprecation$public Builder ${$set$capitalized_name$Value$}$(\n"
@ -816,7 +827,7 @@ void RepeatedImmutableEnumFieldGenerator::GenerateBuilderMembers(
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldEnumValueAccessorDocComment(printer, descriptor_, LIST_ADDER,
true);
/* builder */ true);
printer->Print(variables_,
"$deprecation$public Builder "
"${$add$capitalized_name$Value$}$(int value) {\n"
@ -826,8 +837,8 @@ void RepeatedImmutableEnumFieldGenerator::GenerateBuilderMembers(
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldEnumValueAccessorDocComment(printer, descriptor_, LIST_ADDER,
true);
WriteFieldEnumValueAccessorDocComment(printer, descriptor_,
LIST_MULTI_ADDER, /* builder */ true);
printer->Print(
variables_,
"$deprecation$public Builder ${$addAll$capitalized_name$Value$}$(\n"

View File

@ -236,7 +236,8 @@ void ImmutableEnumFieldLiteGenerator::GenerateBuilderMembers(
" return instance.get$capitalized_name$Value();\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, SETTER, true);
WriteFieldAccessorDocComment(printer, descriptor_, SETTER,
/* builder */ true);
printer->Print(variables_,
"$deprecation$public Builder "
"${$set$capitalized_name$Value$}$(int value) {\n"
@ -253,7 +254,8 @@ void ImmutableEnumFieldLiteGenerator::GenerateBuilderMembers(
" return instance.get$capitalized_name$();\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldEnumValueAccessorDocComment(printer, descriptor_, SETTER, true);
WriteFieldEnumValueAccessorDocComment(printer, descriptor_, SETTER,
/* builder */ true);
printer->Print(variables_,
"$deprecation$public Builder "
"${$set$capitalized_name$$}$($type$ value) {\n"
@ -262,7 +264,8 @@ void ImmutableEnumFieldLiteGenerator::GenerateBuilderMembers(
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, true);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
/* builder */ true);
printer->Print(
variables_,
"$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n"
@ -415,7 +418,8 @@ void ImmutableEnumOneofFieldLiteGenerator::GenerateBuilderMembers(
" return instance.get$capitalized_name$Value();\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldEnumValueAccessorDocComment(printer, descriptor_, SETTER, true);
WriteFieldEnumValueAccessorDocComment(printer, descriptor_, SETTER,
/* builder */ true);
printer->Print(variables_,
"$deprecation$public Builder "
"${$set$capitalized_name$Value$}$(int value) {\n"
@ -432,7 +436,8 @@ void ImmutableEnumOneofFieldLiteGenerator::GenerateBuilderMembers(
" return instance.get$capitalized_name$();\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, SETTER, true);
WriteFieldAccessorDocComment(printer, descriptor_, SETTER,
/* builder */ true);
printer->Print(variables_,
"$deprecation$public Builder "
"${$set$capitalized_name$$}$($type$ value) {\n"
@ -441,7 +446,8 @@ void ImmutableEnumOneofFieldLiteGenerator::GenerateBuilderMembers(
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, true);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
/* builder */ true);
printer->Print(
variables_,
"$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n"
@ -675,7 +681,8 @@ void RepeatedImmutableEnumFieldLiteGenerator::GenerateBuilderMembers(
" return instance.get$capitalized_name$(index);\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER, true);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER,
/* builder */ true);
printer->Print(variables_,
"$deprecation$public Builder ${$set$capitalized_name$$}$(\n"
" int index, $type$ value) {\n"
@ -684,7 +691,8 @@ void RepeatedImmutableEnumFieldLiteGenerator::GenerateBuilderMembers(
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER, true);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER,
/* builder */ true);
printer->Print(variables_,
"$deprecation$public Builder "
"${$add$capitalized_name$$}$($type$ value) {\n"
@ -693,7 +701,8 @@ void RepeatedImmutableEnumFieldLiteGenerator::GenerateBuilderMembers(
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER, true);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER,
/* builder */ true);
printer->Print(variables_,
"$deprecation$public Builder ${$addAll$capitalized_name$$}$(\n"
" java.lang.Iterable<? extends $type$> values) {\n"
@ -702,7 +711,8 @@ void RepeatedImmutableEnumFieldLiteGenerator::GenerateBuilderMembers(
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, true);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
/* builder */ true);
printer->Print(
variables_,
"$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n"
@ -732,7 +742,8 @@ void RepeatedImmutableEnumFieldLiteGenerator::GenerateBuilderMembers(
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldEnumValueAccessorDocComment(printer, descriptor_,
LIST_INDEXED_SETTER, true);
LIST_INDEXED_SETTER,
/* builder */ true);
printer->Print(
variables_,
"$deprecation$public Builder ${$set$capitalized_name$Value$}$(\n"
@ -743,7 +754,7 @@ void RepeatedImmutableEnumFieldLiteGenerator::GenerateBuilderMembers(
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldEnumValueAccessorDocComment(printer, descriptor_, LIST_ADDER,
true);
/* builder */ true);
printer->Print(variables_,
"$deprecation$public Builder "
"${$add$capitalized_name$Value$}$(int value) {\n"
@ -752,7 +763,8 @@ void RepeatedImmutableEnumFieldLiteGenerator::GenerateBuilderMembers(
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldEnumValueAccessorDocComment(printer, descriptor_,
LIST_MULTI_ADDER, true);
LIST_MULTI_ADDER,
/* builder */ true);
printer->Print(
variables_,
"$deprecation$public Builder ${$addAll$capitalized_name$Value$}$(\n"

View File

@ -257,7 +257,8 @@ void ImmutablePrimitiveFieldGenerator::GenerateBuilderMembers(
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, SETTER, true);
WriteFieldAccessorDocComment(printer, descriptor_, SETTER,
/* builder */ true);
printer->Print(variables_,
"$deprecation$public Builder "
"${$set$capitalized_name$$}$($type$ value) {\n"
@ -269,7 +270,8 @@ void ImmutablePrimitiveFieldGenerator::GenerateBuilderMembers(
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, true);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
/* builder */ true);
printer->Print(
variables_,
"$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n"
@ -534,7 +536,8 @@ void ImmutablePrimitiveOneofFieldGenerator::GenerateBuilderMembers(
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, SETTER, true);
WriteFieldAccessorDocComment(printer, descriptor_, SETTER,
/* builder */ true);
printer->Print(variables_,
"$deprecation$public Builder "
"${$set$capitalized_name$$}$($type$ value) {\n"
@ -546,7 +549,8 @@ void ImmutablePrimitiveOneofFieldGenerator::GenerateBuilderMembers(
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, true);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
/* builder */ true);
printer->Print(
variables_,
"$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n"
@ -735,7 +739,8 @@ void RepeatedImmutablePrimitiveFieldGenerator::GenerateBuilderMembers(
" return $repeated_get$(index);\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER, true);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER,
/* builder */ true);
printer->Print(variables_,
"$deprecation$public Builder ${$set$capitalized_name$$}$(\n"
" int index, $type$ value) {\n"
@ -746,7 +751,8 @@ void RepeatedImmutablePrimitiveFieldGenerator::GenerateBuilderMembers(
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER, true);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER,
/* builder */ true);
printer->Print(variables_,
"$deprecation$public Builder "
"${$add$capitalized_name$$}$($type$ value) {\n"
@ -757,7 +763,8 @@ void RepeatedImmutablePrimitiveFieldGenerator::GenerateBuilderMembers(
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER, true);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER,
/* builder */ true);
printer->Print(variables_,
"$deprecation$public Builder ${$addAll$capitalized_name$$}$(\n"
" java.lang.Iterable<? extends $boxed_type$> values) {\n"
@ -768,7 +775,8 @@ void RepeatedImmutablePrimitiveFieldGenerator::GenerateBuilderMembers(
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, true);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
/* builder */ true);
printer->Print(
variables_,
"$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n"

View File

@ -282,7 +282,8 @@ void ImmutablePrimitiveFieldLiteGenerator::GenerateBuilderMembers(
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldDocComment(printer, descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, SETTER,
/* builder */ true);
printer->Print(variables_,
"$deprecation$public Builder "
"${$set$capitalized_name$$}$($type$ value) {\n"
@ -292,7 +293,8 @@ void ImmutablePrimitiveFieldLiteGenerator::GenerateBuilderMembers(
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldDocComment(printer, descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
/* builder */ true);
printer->Print(
variables_,
"$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n"
@ -368,7 +370,7 @@ void ImmutablePrimitiveOneofFieldLiteGenerator::GenerateMembers(
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldDocComment(printer, descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, SETTER);
printer->Print(variables_,
"private void set$capitalized_name$($type$ value) {\n"
"$null_check$"
@ -376,7 +378,7 @@ void ImmutablePrimitiveOneofFieldLiteGenerator::GenerateMembers(
" $oneof_name$_ = value;\n"
"}\n");
WriteFieldDocComment(printer, descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER);
printer->Print(variables_,
"private void clear$capitalized_name$() {\n"
" if ($has_oneof_case_message$) {\n"
@ -415,7 +417,8 @@ void ImmutablePrimitiveOneofFieldLiteGenerator::GenerateBuilderMembers(
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldDocComment(printer, descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, SETTER,
/* builder */ true);
printer->Print(variables_,
"$deprecation$public Builder "
"${$set$capitalized_name$$}$($type$ value) {\n"
@ -425,7 +428,8 @@ void ImmutablePrimitiveOneofFieldLiteGenerator::GenerateBuilderMembers(
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldDocComment(printer, descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
/* builder */ true);
printer->Print(
variables_,
"$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n"
@ -459,14 +463,14 @@ int RepeatedImmutablePrimitiveFieldLiteGenerator::GetNumBitsForMessage() const {
void RepeatedImmutablePrimitiveFieldLiteGenerator::GenerateInterfaceMembers(
io::Printer* printer) const {
WriteFieldDocComment(printer, descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_GETTER);
printer->Print(variables_,
"$deprecation$java.util.List<$boxed_type$> "
"get$capitalized_name$List();\n");
WriteFieldDocComment(printer, descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_COUNT);
printer->Print(variables_,
"$deprecation$int get$capitalized_name$Count();\n");
WriteFieldDocComment(printer, descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER);
printer->Print(variables_,
"$deprecation$$type$ get$capitalized_name$(int index);\n");
}
@ -475,7 +479,7 @@ void RepeatedImmutablePrimitiveFieldLiteGenerator::GenerateMembers(
io::Printer* printer) const {
printer->Print(variables_, "private $field_list_type$ $name$_;\n");
PrintExtraFieldInfo(variables_, printer);
WriteFieldDocComment(printer, descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_GETTER);
printer->Print(variables_,
"@java.lang.Override\n"
"$deprecation$public java.util.List<$boxed_type$>\n"
@ -483,7 +487,7 @@ void RepeatedImmutablePrimitiveFieldLiteGenerator::GenerateMembers(
" return $name$_;\n" // note: unmodifiable list
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldDocComment(printer, descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_COUNT);
printer->Print(
variables_,
"@java.lang.Override\n"
@ -491,7 +495,7 @@ void RepeatedImmutablePrimitiveFieldLiteGenerator::GenerateMembers(
" return $name$_.size();\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldDocComment(printer, descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER);
printer->Print(
variables_,
"@java.lang.Override\n"
@ -515,7 +519,7 @@ void RepeatedImmutablePrimitiveFieldLiteGenerator::GenerateMembers(
" }\n"
"}\n");
WriteFieldDocComment(printer, descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER);
printer->Print(variables_,
"private void set$capitalized_name$(\n"
" int index, $type$ value) {\n"
@ -523,14 +527,14 @@ void RepeatedImmutablePrimitiveFieldLiteGenerator::GenerateMembers(
" ensure$capitalized_name$IsMutable();\n"
" $repeated_set$(index, value);\n"
"}\n");
WriteFieldDocComment(printer, descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER);
printer->Print(variables_,
"private void add$capitalized_name$($type$ value) {\n"
"$null_check$"
" ensure$capitalized_name$IsMutable();\n"
" $repeated_add$(value);\n"
"}\n");
WriteFieldDocComment(printer, descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER);
printer->Print(variables_,
"private void addAll$capitalized_name$(\n"
" java.lang.Iterable<? extends $boxed_type$> values) {\n"
@ -538,7 +542,7 @@ void RepeatedImmutablePrimitiveFieldLiteGenerator::GenerateMembers(
" com.google.protobuf.AbstractMessageLite.addAll(\n"
" values, $name$_);\n"
"}\n");
WriteFieldDocComment(printer, descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER);
printer->Print(variables_,
"private void clear$capitalized_name$() {\n"
" $name$_ = $empty_list$;\n"
@ -547,7 +551,7 @@ void RepeatedImmutablePrimitiveFieldLiteGenerator::GenerateMembers(
void RepeatedImmutablePrimitiveFieldLiteGenerator::GenerateBuilderMembers(
io::Printer* printer) const {
WriteFieldDocComment(printer, descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_GETTER);
printer->Print(variables_,
"@java.lang.Override\n"
"$deprecation$public java.util.List<$boxed_type$>\n"
@ -556,7 +560,7 @@ void RepeatedImmutablePrimitiveFieldLiteGenerator::GenerateBuilderMembers(
" instance.get$capitalized_name$List());\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldDocComment(printer, descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_COUNT);
printer->Print(
variables_,
"@java.lang.Override\n"
@ -564,7 +568,7 @@ void RepeatedImmutablePrimitiveFieldLiteGenerator::GenerateBuilderMembers(
" return instance.get$capitalized_name$Count();\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldDocComment(printer, descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER);
printer->Print(
variables_,
"@java.lang.Override\n"
@ -572,7 +576,8 @@ void RepeatedImmutablePrimitiveFieldLiteGenerator::GenerateBuilderMembers(
" return instance.get$capitalized_name$(index);\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldDocComment(printer, descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, SETTER,
/* builder */ true);
printer->Print(variables_,
"$deprecation$public Builder ${$set$capitalized_name$$}$(\n"
" int index, $type$ value) {\n"
@ -581,7 +586,8 @@ void RepeatedImmutablePrimitiveFieldLiteGenerator::GenerateBuilderMembers(
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldDocComment(printer, descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER,
/* builder */ true);
printer->Print(variables_,
"$deprecation$public Builder "
"${$add$capitalized_name$$}$($type$ value) {\n"
@ -590,7 +596,8 @@ void RepeatedImmutablePrimitiveFieldLiteGenerator::GenerateBuilderMembers(
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldDocComment(printer, descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER,
/* builder */ true);
printer->Print(variables_,
"$deprecation$public Builder ${$addAll$capitalized_name$$}$(\n"
" java.lang.Iterable<? extends $boxed_type$> values) {\n"
@ -599,7 +606,8 @@ void RepeatedImmutablePrimitiveFieldLiteGenerator::GenerateBuilderMembers(
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldDocComment(printer, descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
/* builder */ true);
printer->Print(
variables_,
"$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n"

View File

@ -316,7 +316,8 @@ void ImmutableStringFieldGenerator::GenerateBuilderMembers(
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, SETTER, true);
WriteFieldAccessorDocComment(printer, descriptor_, SETTER,
/* builder */ true);
printer->Print(variables_,
"$deprecation$public Builder ${$set$capitalized_name$$}$(\n"
" java.lang.String value) {\n"
@ -327,7 +328,8 @@ void ImmutableStringFieldGenerator::GenerateBuilderMembers(
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
/* builder */ true);
printer->Print(
variables_,
"$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n"
@ -342,7 +344,8 @@ void ImmutableStringFieldGenerator::GenerateBuilderMembers(
" return this;\n"
"}\n");
WriteFieldStringBytesAccessorDocComment(printer, descriptor_, SETTER);
WriteFieldStringBytesAccessorDocComment(printer, descriptor_, SETTER,
/* builder */ true);
printer->Print(
variables_,
"$deprecation$public Builder ${$set$capitalized_name$Bytes$}$(\n"
@ -608,7 +611,8 @@ void ImmutableStringOneofFieldGenerator::GenerateBuilderMembers(
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, SETTER, true);
WriteFieldAccessorDocComment(printer, descriptor_, SETTER,
/* builder */ true);
printer->Print(variables_,
"$deprecation$public Builder ${$set$capitalized_name$$}$(\n"
" java.lang.String value) {\n"
@ -619,7 +623,8 @@ void ImmutableStringOneofFieldGenerator::GenerateBuilderMembers(
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, true);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
/* builder */ true);
printer->Print(
variables_,
"$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n"
@ -632,7 +637,8 @@ void ImmutableStringOneofFieldGenerator::GenerateBuilderMembers(
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldStringBytesAccessorDocComment(printer, descriptor_, SETTER, true);
WriteFieldStringBytesAccessorDocComment(printer, descriptor_, SETTER,
/* builder */ true);
printer->Print(
variables_,
"$deprecation$public Builder ${$set$capitalized_name$Bytes$}$(\n"
@ -840,7 +846,8 @@ void RepeatedImmutableStringFieldGenerator::GenerateBuilderMembers(
" return $name$_.getByteString(index);\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER, true);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER,
/* builder */ true);
printer->Print(variables_,
"$deprecation$public Builder ${$set$capitalized_name$$}$(\n"
" int index, java.lang.String value) {\n"
@ -851,7 +858,8 @@ void RepeatedImmutableStringFieldGenerator::GenerateBuilderMembers(
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER, true);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER,
/* builder */ true);
printer->Print(variables_,
"$deprecation$public Builder ${$add$capitalized_name$$}$(\n"
" java.lang.String value) {\n"
@ -862,7 +870,8 @@ void RepeatedImmutableStringFieldGenerator::GenerateBuilderMembers(
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER, true);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER,
/* builder */ true);
printer->Print(variables_,
"$deprecation$public Builder ${$addAll$capitalized_name$$}$(\n"
" java.lang.Iterable<java.lang.String> values) {\n"
@ -873,7 +882,8 @@ void RepeatedImmutableStringFieldGenerator::GenerateBuilderMembers(
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, true);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
/* builder */ true);
printer->Print(
variables_,
"$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n"
@ -885,7 +895,7 @@ void RepeatedImmutableStringFieldGenerator::GenerateBuilderMembers(
printer->Annotate("{", "}", descriptor_);
WriteFieldStringBytesAccessorDocComment(printer, descriptor_, LIST_ADDER,
true);
/* builder */ true);
printer->Print(
variables_,
"$deprecation$public Builder ${$add$capitalized_name$Bytes$}$(\n"

View File

@ -273,7 +273,8 @@ void ImmutableStringFieldLiteGenerator::GenerateBuilderMembers(
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, SETTER, true);
WriteFieldAccessorDocComment(printer, descriptor_, SETTER,
/* builder */ true);
printer->Print(variables_,
"$deprecation$public Builder ${$set$capitalized_name$$}$(\n"
" java.lang.String value) {\n"
@ -282,7 +283,8 @@ void ImmutableStringFieldLiteGenerator::GenerateBuilderMembers(
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, true);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
/* builder */ true);
printer->Print(
variables_,
"$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n"
@ -292,7 +294,8 @@ void ImmutableStringFieldLiteGenerator::GenerateBuilderMembers(
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldStringBytesAccessorDocComment(printer, descriptor_, SETTER, true);
WriteFieldStringBytesAccessorDocComment(printer, descriptor_, SETTER,
/* builder */ true);
printer->Print(
variables_,
"$deprecation$public Builder ${$set$capitalized_name$Bytes$}$(\n"
@ -451,7 +454,8 @@ void ImmutableStringOneofFieldLiteGenerator::GenerateBuilderMembers(
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, SETTER, true);
WriteFieldAccessorDocComment(printer, descriptor_, SETTER,
/* builder */ true);
printer->Print(variables_,
"$deprecation$public Builder ${$set$capitalized_name$$}$(\n"
" java.lang.String value) {\n"
@ -460,7 +464,8 @@ void ImmutableStringOneofFieldLiteGenerator::GenerateBuilderMembers(
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, true);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
/* builder */ true);
printer->Print(
variables_,
"$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n"
@ -470,7 +475,8 @@ void ImmutableStringOneofFieldLiteGenerator::GenerateBuilderMembers(
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldStringBytesAccessorDocComment(printer, descriptor_, SETTER);
WriteFieldStringBytesAccessorDocComment(printer, descriptor_, SETTER,
/* builder */ true);
printer->Print(
variables_,
"$deprecation$public Builder ${$set$capitalized_name$Bytes$}$(\n"
@ -651,7 +657,8 @@ void RepeatedImmutableStringFieldLiteGenerator::GenerateBuilderMembers(
" return instance.get$capitalized_name$Bytes(index);\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER, true);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER,
/* builder */ true);
printer->Print(variables_,
"$deprecation$public Builder ${$set$capitalized_name$$}$(\n"
" int index, java.lang.String value) {\n"
@ -660,7 +667,8 @@ void RepeatedImmutableStringFieldLiteGenerator::GenerateBuilderMembers(
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER,
/* builder */ true);
printer->Print(variables_,
"$deprecation$public Builder ${$add$capitalized_name$$}$(\n"
" java.lang.String value) {\n"
@ -669,7 +677,8 @@ void RepeatedImmutableStringFieldLiteGenerator::GenerateBuilderMembers(
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER, true);
WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER,
/* builder */ true);
printer->Print(variables_,
"$deprecation$public Builder ${$addAll$capitalized_name$$}$(\n"
" java.lang.Iterable<java.lang.String> values) {\n"
@ -678,7 +687,8 @@ void RepeatedImmutableStringFieldLiteGenerator::GenerateBuilderMembers(
" return this;\n"
"}\n");
printer->Annotate("{", "}", descriptor_);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, true);
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
/* builder */ true);
printer->Print(
variables_,
"$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n"
@ -689,7 +699,7 @@ void RepeatedImmutableStringFieldLiteGenerator::GenerateBuilderMembers(
printer->Annotate("{", "}", descriptor_);
WriteFieldStringBytesAccessorDocComment(printer, descriptor_, LIST_ADDER,
true);
/* builder */ true);
printer->Print(
variables_,
"$deprecation$public Builder ${$add$capitalized_name$Bytes$}$(\n"