From 578b37904c7376bfc711ddb89f23a203e4a70fdd Mon Sep 17 00:00:00 2001 From: Marco Bardelli Date: Fri, 4 Nov 2022 22:48:51 +0100 Subject: [PATCH 1/6] added minimal support for es6 import_style --- generator/js_generator.cc | 50 +++++++++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 10 deletions(-) diff --git a/generator/js_generator.cc b/generator/js_generator.cc index 6ca0ad3..2bdec1e 100644 --- a/generator/js_generator.cc +++ b/generator/js_generator.cc @@ -226,7 +226,8 @@ std::string MaybeCrossFileRef(const GeneratorOptions& options, const FileDescriptor* from_file, const Descriptor* to_message) { if ((options.import_style == GeneratorOptions::kImportCommonJs || - options.import_style == GeneratorOptions::kImportCommonJsStrict) && + options.import_style == GeneratorOptions::kImportCommonJsStrict || + options.import_style == GeneratorOptions::kImportEs6) && from_file != to_message->file()) { // Cross-file ref in CommonJS needs to use the module alias instead of // the global name. @@ -3618,8 +3619,14 @@ void Generator::GenerateFile(const GeneratorOptions& options, // Generate "require" statements. if ((options.import_style == GeneratorOptions::kImportCommonJs || - options.import_style == GeneratorOptions::kImportCommonJsStrict)) { - printer->Print("var jspb = require('google-protobuf');\n"); + options.import_style == GeneratorOptions::kImportCommonJsStrict || + options.import_style == GeneratorOptions::kImportEs6)) { + + if (options.import_style == GeneratorOptions::kImportEs6) { + printer->Print("import * as jspb from 'google-protobuf';\n"); + } else { + printer->Print("var jspb = require('google-protobuf');\n"); + } printer->Print("var goog = jspb;\n"); // Do not use global scope in strict mode @@ -3648,13 +3655,22 @@ void Generator::GenerateFile(const GeneratorOptions& options, " Function('return this')();\n\n"); } - for (int i = 0; i < file->dependency_count(); i++) { - const std::string& name = file->dependency(i)->name(); - printer->Print( - "var $alias$ = require('$file$');\n" - "goog.object.extend(proto, $alias$);\n", - "alias", ModuleAlias(name), "file", - GetRootPath(file->name(), name) + GetJSFilename(options, name)); + if (options.import_style == GeneratorOptions::kImportEs6) { + for (int i = 0; i < file->dependency_count(); i++) { + const std::string& name = file->dependency(i)->name(); + printer->Print("import * as $alias$ from '$file$';\n" + "goog.object.extend(proto, $alias$);\n", + "alias", ModuleAlias(name), "file", + GetRootPath(file->name(), name) + GetJSFilename(options, name)); + } + } else { + for (int i = 0; i < file->dependency_count(); i++) { + const std::string& name = file->dependency(i)->name(); + printer->Print("var $alias$ = require('$file$');\n" + "goog.object.extend(proto, $alias$);\n", + "alias", ModuleAlias(name), "file", + GetRootPath(file->name(), name) + GetJSFilename(options, name)); + } } } @@ -3698,6 +3714,20 @@ void Generator::GenerateFile(const GeneratorOptions& options, } else if (options.import_style == GeneratorOptions::kImportCommonJsStrict) { printer->Print("goog.object.extend(exports, proto);\n", "package", GetNamespace(options, file)); + } else if (options.import_style == GeneratorOptions::kImportEs6) { + std::string package = GetNamespace(options, file); + for (std::set::iterator it = provided.begin(); + it != provided.end(); ++it) { + std::string fullname = *it; + std::string name = fullname.substr(package.length()); + + std::string::iterator iend = std::remove(name.begin(), name.end(), '.'); + name.resize(name.length()-(name.end()-iend)); + name.shrink_to_fit(); + + printer->Print("export const $name$ = $fullname$;\n", + "name", name, "fullname", fullname); + } } // Emit well-known type methods. From fdf42cd3d5edba368ca9b51f726348dc3b0bdb05 Mon Sep 17 00:00:00 2001 From: Jacob Fugal Date: Tue, 26 Nov 2024 13:40:16 -0700 Subject: [PATCH 2/6] generate es6 library with .d.ts --- generator/js_generator.cc | 379 ++++++++++++++++++++++++++-- generator/js_generator.h | 35 ++- generator/well_known_types_embed.cc | 40 ++- generator/well_known_types_embed.h | 1 + 4 files changed, 434 insertions(+), 21 deletions(-) diff --git a/generator/js_generator.cc b/generator/js_generator.cc index 2bdec1e..227529d 100644 --- a/generator/js_generator.cc +++ b/generator/js_generator.cc @@ -3505,6 +3505,12 @@ bool GeneratorOptions::ParseFromOptions( return false; } annotate_code = true; + } else if (option.first == "generate_dts") { + if (!option.second.empty()) { + *error = "Unexpected option value for generate_dts"; + return false; + } + generate_dts = true; } else { // Assume any other option is an output directory, as long as it is a bare // `key` rather than a `key=value` option. @@ -3517,22 +3523,38 @@ bool GeneratorOptions::ParseFromOptions( } if (import_style != kImportClosure && - (add_require_for_enums || testonly || !library.empty() || - extension != ".js" || one_output_file_per_input_file)) { + (add_require_for_enums || testonly || extension != ".js" || + one_output_file_per_input_file)) { *error = - "The add_require_for_enums, testonly, library, extension, and " + "The add_require_for_enums, testonly, extension, and " "one_output_file_per_input_file options should only be " "used for import_style=closure"; return false; } + if (import_style != kImportClosure && import_style != kImportEs6 && + !library.empty()) { + *error = + "The library option should only be " + "used for import_style=closure or es6"; + return false; + } + + if (generate_dts && (import_style != kImportEs6 || library.empty())) { + *error = + "The generate_dts option should only be " + "used for import_style=es6 and with library set"; + return false; + } + return true; } GeneratorOptions::OutputMode GeneratorOptions::output_mode() const { - // We use one output file per input file if we are not using Closure or if - // this is explicitly requested. - if (import_style != kImportClosure || one_output_file_per_input_file) { + // We use one output file per input file if we are not using Closure or ES6, + // or if this is explicitly requested. + if ((import_style != kImportClosure && import_style != kImportEs6) || + one_output_file_per_input_file) { return kOneOutputFilePerInputFile; } @@ -3541,6 +3563,10 @@ GeneratorOptions::OutputMode GeneratorOptions::output_mode() const { return kEverythingInOneFile; } + // SCC for ES6 is not implemented + ABSL_CHECK(import_style != kImportEs6) + << "ES6 must specify either one_output_file_per_input_file or library"; + // Otherwise, we create one output file per SCC. return kOneOutputFilePerSCC; } @@ -3585,12 +3611,7 @@ void Generator::GenerateFileAndDeps( bool Generator::GenerateFile(const FileDescriptor* file, const GeneratorOptions& options, GeneratorContext* context, - bool use_short_name) const { - std::string filename = - options.output_dir + "/" + - GetJSFilename(options, use_short_name - ? file->name().substr(file->name().rfind('/')) - : file->name()); + const std::string& filename) const { std::unique_ptr output(context->Open(filename)); ABSL_CHECK(output); GeneratedCodeInfo annotations; @@ -3629,8 +3650,9 @@ void Generator::GenerateFile(const GeneratorOptions& options, } printer->Print("var goog = jspb;\n"); - // Do not use global scope in strict mode - if (options.import_style == GeneratorOptions::kImportCommonJsStrict) { + // Do not use global scope in strict mode or with ES6 + if (options.import_style == GeneratorOptions::kImportCommonJsStrict || + options.import_style == GeneratorOptions::kImportEs6) { printer->Print("var proto = {};\n\n"); } else { // To get the global object we call a function with .call(null), this will @@ -3739,6 +3761,315 @@ void Generator::GenerateFile(const GeneratorOptions& options, } } +bool Generator::GenerateDTS(const FileDescriptor* file, + const GeneratorOptions& options, + GeneratorContext* context, + const std::string& js_filename) const { + if (!options.generate_dts) { + return true; + } + + ABSL_CHECK(options.import_style == GeneratorOptions::kImportEs6); + + std::string dts_filename = + js_filename.substr(0, js_filename.length() - options.extension.length()) + + ".d.ts"; + std::unique_ptr output(context->Open(dts_filename)); + ABSL_CHECK(output); + io::Printer printer(output.get(), '$', nullptr); + + GenerateDTS(options, &printer, file); + + return !printer.failed(); +} + +const std::string DTS_INDENT = " "; + +void Generator::GenerateDTS(const GeneratorOptions& options, + io::Printer* printer, + const FileDescriptor* file) const { + std::string ns = GetNamespace(options, file); + printer->Print("declare namespace $ns$ {\n", "ns", ns); + + const std::string& indent = DTS_INDENT; + std::set exported; + for (int i = 0; i < file->message_type_count(); i++) { + auto desc = file->message_type(i); + GenerateMessageDTS(options, printer, desc, indent); + exported.insert(desc->name()); + } + for (int i = 0; i < file->enum_type_count(); i++) { + auto enumdesc = file->enum_type(i); + GenerateEnumDTS(options, printer, enumdesc, indent); + exported.insert(enumdesc->name()); + } + + printer->Print("}\n"); + + if (!exported.empty()) { + for (auto name : exported) { + std::string fullname = ns + "." + name; + printer->Print( + "\ndeclare module \"goog:$fullname$ \" {\n" + "$indent$import $name$ = $fullname$;\n" + "$indent$export default $name$;\n" + "}\n", + "name", name, "fullname", fullname, "indent", indent); + } + + printer->Print("\n"); + for (auto name : exported) { + std::string fullname = ns + "." + name; + printer->Print("import $name$ = $fullname$;\n", "name", name, "fullname", + fullname); + } + printer->Print("\n"); + printer->Print("export {\n"); + for (auto name : exported) { + printer->Print("$indent$$name$,\n", "name", name, "indent", indent); + } + printer->Print("};\n"); + } + + // Emit well-known type methods. + for (FileToc* toc = well_known_types_js; toc->name != NULL; toc++) { + std::string name = std::string("google/protobuf/") + toc->name; + if (name == StripProto(file->name()) + ".js") { + printer->Print(toc->dts_data); + } + } +} + +void Generator::GenerateMessageDTS(const GeneratorOptions& options, + io::Printer* printer, const Descriptor* desc, + const std::string& indent) const { + if (IgnoreMessage(desc)) { + return; + } + + printer->Print("$indent$export class $classname$ extends jspb.Message {\n", + "classname", desc->name(), "indent", indent); + + const std::string nested_indent = indent + DTS_INDENT; + printer->Print("$indent$constructor(data?: any[] | null);\n", "indent", + nested_indent); + + if (HasOneofFields(desc)) { + for (int i = 0; i < desc->oneof_decl_count(); i++) { + GenerateOneofDTS(options, printer, desc->oneof_decl(i), nested_indent); + } + } + + printer->Print( + "$indent$toObject(includeInstance?: boolean): GlobalObject;\n" + "$indent$static toObject(includeInstance: boolean | undefined, msg: " + "$class$): GlobalObject;\n" + "$indent$static deserializeBinary(bytes: jspb.ByteSource): $class$;\n" + "$indent$static deserializeBinaryFromReader(msg: $class$, reader: " + "jspb.BinaryReader): $class$;\n" + "$indent$serializeBinary(): Uint8Array;\n" + "$indent$static serializeBinaryToWriter(message: $class$, writer: " + "jspb.BinaryWriter): void;\n", + "class", GetMessagePath(options, desc), "indent", nested_indent); + + for (int i = 0; i < desc->nested_type_count(); i++) { + GenerateMessageDTS(options, printer, desc->nested_type(i), nested_indent); + } + for (int i = 0; i < desc->enum_type_count(); i++) { + GenerateEnumDTS(options, printer, desc->enum_type(i), nested_indent); + } + + for (int i = 0; i < desc->field_count(); i++) { + if (!IgnoreField(desc->field(i))) { + GenerateFieldDTS(options, printer, desc->field(i), nested_indent); + } + } + + printer->Print("$indent$}\n\n", "indent", indent); +} + +void Generator::GenerateOneofDTS(const GeneratorOptions& options, + io::Printer* printer, + const OneofDescriptor* oneof, + const std::string& indent) const { + if (IgnoreOneof(oneof)) { + return; + } + printer->Print("$indent$enum $oneof$Case = {\n", "oneof", JSOneofName(oneof), + "indent", indent); + + const std::string nested_indent = indent + DTS_INDENT; + printer->Print("$indent$$upcase$_NOT_SET: 0,\n", "upcase", + ToEnumCase(oneof->name()), "indent", nested_indent); + + for (int i = 0; i < oneof->field_count(); i++) { + auto field = oneof->field(i); + if (IgnoreField(field)) { + continue; + } + printer->Print("$indent$$upcase$: $number$,\n", "upcase", + ToEnumCase(field->name()), "number", JSFieldIndex(field), + "indent", nested_indent); + } + + printer->Print("$indent$};\n", "indent", indent); + printer->Print("$indent$get$oneof$Case(): $class$.$oneof$Case;\n", "class", + GetMessagePath(options, oneof->containing_type()), "oneof", + JSOneofName(oneof), "indent", indent); +} + +std::string DTSFieldType(const GeneratorOptions& options, + const FieldDescriptor* field, + BytesMode bytes_mode = BYTES_DEFAULT, + bool force_singular = false) { + std::string jstype = JSTypeName(options, field, bytes_mode); + if (!force_singular && field->is_repeated()) { + if (field->type() == FieldDescriptor::TYPE_BYTES && + bytes_mode == BYTES_DEFAULT) { + jstype = "Uint8Array[] | string[]"; + } else { + jstype += "[]"; + } + } + return jstype; +} + +std::string DTSFieldReturnType(const GeneratorOptions& options, + const FieldDescriptor* field, + BytesMode bytes_mode = BYTES_DEFAULT) { + std::string jstype = DTSFieldType(options, field, bytes_mode); + if (DeclaredReturnTypeIsNullable(options, field)) { + jstype += " | null"; + } + return jstype; +} + +std::string DTSFieldSetterType(const GeneratorOptions& options, + const FieldDescriptor* field) { + std::string jstype = DTSFieldType(options, field); + if (SetterAcceptsNull(options, field)) { + jstype += " | null"; + } + if (SetterAcceptsUndefined(options, field)) { + jstype += " | undefined"; + } + return jstype; +} + +void Generator::GenerateFieldDTS(const GeneratorOptions& options, + io::Printer* printer, + const FieldDescriptor* field, + const std::string& indent) const { + if (field->is_map()) { + printer->Print( + "$indent$$gettername$(noLazyCreate?: boolean): " + "jspb.Map<$keytype$,$valuetype$> " + "| undefined;\n", + "class", GetMessagePath(options, field->containing_type()), + "gettername", "get" + JSGetterName(options, field), "keytype", + DTSFieldType(options, MapFieldKey(field)), "valuetype", + DTSFieldType(options, MapFieldValue(field)), "indent", indent); + } else if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) { + printer->Print("$indent$$gettername$(): $type$;\n", "gettername", + "get" + JSGetterName(options, field), "type", + DTSFieldReturnType(options, field), "indent", indent); + printer->Print("$indent$$settername$(value: $optionaltype$): $class$;\n", + "settername", "set" + JSGetterName(options, field), + "optionaltype", DTSFieldSetterType(options, field), "class", + GetMessagePath(options, field->containing_type()), "indent", + indent); + if (field->is_repeated()) { + printer->Print( + "$indent$$addername$(value?: $optionaltype$, index?: number): " + "$optionaltype$;\n", + "addername", + "add" + + JSGetterName(options, field, BYTES_DEFAULT, /* drop_list */ true), + "optionaltype", JSTypeName(options, field, BYTES_DEFAULT), "indent", + indent); + } + } else { + BytesMode bytes_mode = + field->type() == FieldDescriptor::TYPE_BYTES && !options.binary + ? BYTES_B64 + : BYTES_DEFAULT; + printer->Print("$indent$$gettername$(): $type$;\n", "gettername", + "get" + JSGetterName(options, field), "type", + DTSFieldReturnType(options, field, bytes_mode), "indent", + indent); + + if (field->type() == FieldDescriptor::TYPE_BYTES) { + printer->Print("$indent$get$name$(): $type$;\n", "type", + DTSFieldReturnType(options, field, BYTES_B64), "name", + JSGetterName(options, field, BYTES_B64), "indent", indent); + printer->Print("$indent$get$name$(): $type$;\n", "type", + DTSFieldReturnType(options, field, BYTES_U8), "name", + JSGetterName(options, field, BYTES_U8), "indent", indent); + } + + printer->Print("$indent$$settername$(value: $optionaltype$): $class$;\n", + "settername", "set" + JSGetterName(options, field), + "optionaltype", DTSFieldSetterType(options, field), "class", + GetMessagePath(options, field->containing_type()), "indent", + indent); + + if (field->is_repeated()) { + printer->Print( + "$indent$$addername$(value: $optionaltype$, index?: number): " + "$class$;\n", + "addername", + "add" + JSGetterName(options, field, BYTES_DEFAULT, + /* drop_list = */ true), + "optionaltype", DTSFieldType(options, field, BYTES_DEFAULT, true), + "class", GetMessagePath(options, field->containing_type()), "indent", + indent); + } + } + + if (field->is_map() || field->is_repeated() || + (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE && + !field->is_required()) || + HasFieldPresence(options, field)) { + printer->Print("$indent$$clearername$(): $class$;\n", "clearername", + "clear" + JSGetterName(options, field), "class", + GetMessagePath(options, field->containing_type()), "indent", + indent); + } + + if (HasFieldPresence(options, field)) { + printer->Print("$indent$$hasername$(): boolean;\n", "hasername", + "has" + JSGetterName(options, field), "indent", indent); + } +} + +void Generator::GenerateEnumDTS(const GeneratorOptions& options, + io::Printer* printer, + const EnumDescriptor* enumdesc, + const std::string& indent) const { + printer->Print("$indent$enum $name$ {\n", "indent", indent, "name", + enumdesc->name()); + + std::set used_name; + std::vector valid_values; + for (int i = 0; i < enumdesc->value_count(); i++) { + const EnumValueDescriptor* value = enumdesc->value(i); + if (enumdesc->options().allow_alias() && + !used_name.insert(ToEnumCase(value->name())).second) { + continue; + } + valid_values.push_back(value); + } + + const std::string nested_indent = indent + DTS_INDENT; + for (auto value : valid_values) { + printer->Print("$indent$$name$ = $value$,\n", "indent", nested_indent, + "name", ToEnumCase(value->name()), "value", + absl::StrCat(value->number())); + } + + printer->Print("$indent$}\n\n", "indent", indent); +} + bool Generator::GenerateAll(const std::vector& files, const std::string& parameter, GeneratorContext* context, @@ -3754,6 +4085,16 @@ bool Generator::GenerateAll(const std::vector& files, // All output should go in a single file. std::string filename = options.output_dir + "/" + options.library + options.GetFileNameExtension(); + if (options.import_style == GeneratorOptions::kImportEs6) { + // all-in-one for ES6 not actually supported. but we abuse this branch to + // allow specifying the output name via library when there's a single + // input. + ABSL_CHECK(files.size() == 1) + << "ES6 only supports one input file with library option"; + return GenerateFile(files[0], options, context, filename) && + GenerateDTS(files[0], options, context, filename); + } + std::unique_ptr output(context->Open(filename)); ABSL_CHECK(output.get()); GeneratedCodeInfo annotations; @@ -3812,7 +4153,11 @@ bool Generator::GenerateAll(const std::vector& files, for (auto file : files) { // Force well known type to generate in a whole file. if (IsWellKnownTypeFile(file)) { - if (!GenerateFile(file, options, context, true)) { + std::string filename = + options.output_dir + "/" + + GetJSFilename(options, + file->name().substr(file->name().rfind('/'))); + if (!GenerateFile(file, options, context, filename)) { return false; } generated = true; @@ -3959,7 +4304,9 @@ bool Generator::GenerateAll(const std::vector& files, // Generate one output file per input (.proto) file. for (auto file : files) { - if (!GenerateFile(file, options, context, false)) { + std::string filename = + options.output_dir + "/" + GetJSFilename(options, file->name()); + if (!GenerateFile(file, options, context, filename)) { return false; } } diff --git a/generator/js_generator.h b/generator/js_generator.h index 98b8126..588d7e0 100644 --- a/generator/js_generator.h +++ b/generator/js_generator.h @@ -81,7 +81,8 @@ struct GeneratorOptions { library(""), extension(".js"), one_output_file_per_input_file(false), - annotate_code(false) {} + annotate_code(false), + generate_dts(false) {} bool ParseFromOptions( const std::vector >& options, @@ -89,7 +90,10 @@ struct GeneratorOptions { // Returns the file name extension to use for generated code. std::string GetFileNameExtension() const { - return import_style == kImportClosure ? extension : "_pb.js"; + return (import_style == kImportClosure || + (import_style == kImportEs6 && !library.empty())) + ? extension + : "_pb.js"; } enum OutputMode { @@ -124,6 +128,9 @@ struct GeneratorOptions { // are encoded as base64 proto of GeneratedCodeInfo message (see // descriptor.proto). bool annotate_code; + // If true, generate a .d.ts output in addition to library output. Only valid + // with import_style=es6 and library. + bool generate_dts; }; // CodeGenerator implementation which generates a JavaScript source file and @@ -220,10 +227,32 @@ class Generator : public CodeGenerator { // If use_short_name is true, the generated file's name will only be short // name that without directory, otherwise filename equals file->name() bool GenerateFile(const FileDescriptor* file, const GeneratorOptions& options, - GeneratorContext* context, bool use_short_name) const; + GeneratorContext* context, + const std::string& filename) const; void GenerateFile(const GeneratorOptions& options, io::Printer* printer, const FileDescriptor* file) const; + // Generate declarations for all things in a proto file into one .d.ts file. + // If use_short_name is true, the generated file's name will only be short + // name that without directory, otherwise filename equals file->name() + bool GenerateDTS(const FileDescriptor* file, const GeneratorOptions& options, + GeneratorContext* context, + const std::string& filename) const; + void GenerateDTS(const GeneratorOptions& options, io::Printer* printer, + const FileDescriptor* file) const; + void GenerateMessageDTS(const GeneratorOptions& options, io::Printer* printer, + const Descriptor* desc, + const std::string& indent) const; + void GenerateOneofDTS(const GeneratorOptions& options, io::Printer* printer, + const OneofDescriptor* oneof, + const std::string& indent) const; + void GenerateFieldDTS(const GeneratorOptions& options, io::Printer* printer, + const FieldDescriptor* field, + const std::string& indent) const; + void GenerateEnumDTS(const GeneratorOptions& options, io::Printer* printer, + const EnumDescriptor* enumdesc, + const std::string& indent) const; + // Generate definitions for all message classes and enums in all files, // processing the files in dependence order. void GenerateFilesInDepOrder( diff --git a/generator/well_known_types_embed.cc b/generator/well_known_types_embed.cc index 08c3820..5d433dd 100644 --- a/generator/well_known_types_embed.cc +++ b/generator/well_known_types_embed.cc @@ -86,8 +86,15 @@ struct FileToc well_known_types_js[] = { " } else {\n" " return null;\n" " }\n" - "};\n" - }, + "};\n", + "declare namespace proto.google.protobuf {\n" + " export class Any {\n" + " getTypeName(): string;\n" + " pack(serialized: Uint8Array, name: string, typeUrlPrefix?: string): " + "void;\n" + " unpack(deserialize: (Uint8Array) => T, name: string): T | null;\n" + " }\n" + "};\n"}, {"timestamp.js", "/* This code will be inserted into generated code for\n" " * google/protobuf/timestamp.proto. */\n" @@ -124,6 +131,13 @@ struct FileToc well_known_types_js[] = { " var timestamp = new proto.google.protobuf.Timestamp();\n" " timestamp.fromDate(value);\n" " return timestamp;\n" + "};\n", + "declare namespace proto.google.protobuf {\n" + " export class Timestamp {\n" + " toDate(): Date;\n" + " fromDate(value: Date): void;\n" + " static fromDate(value: Date): proto.google.protobuf.Timestamp;\n" + " }\n" "};\n"}, {"struct.js", "/* This code will be inserted into generated code for\n" @@ -265,6 +279,28 @@ struct FileToc well_known_types_js[] = { " }\n" "\n" " return ret;\n" + "};\n", + "declare namespace proto.google.protobuf {\n" + " export type JavaScriptValue = " + "null|number|string|boolean|JavaScriptValue[]|{ [field: string]: " + "JavaScriptValue }};\n" + " export class Value {\n" + " toJavaScript(): proto.google.protobuf.JavaScriptValue;\n" + " static fromJavaScript(value: proto.google.protobuf.JavaScriptValue): " + "proto.google.protobuf.Value;\n" + " }\n" + " export class ListValue {\n" + " toJavaScript(): proto.google.protobuf.JavaScriptValue[];\n" + " static fromJavaScript(value: " + "proto.google.protobuf.JavaScriptValue[]): " + "proto.google.protobuf.ListValue;\n" + " }\n" + " export class Struct {\n" + " toJavaScript(): { [field: string]: " + "proto.google.protobuf.JavaScriptValue };\n" + " static fromJavaScript(value: { [field: string]: " + "proto.google.protobuf.JavaScriptValue }): proto.google.protobuf.Struct;\n" + " }\n" "};\n"}, {NULL, NULL} // Terminate the list. }; diff --git a/generator/well_known_types_embed.h b/generator/well_known_types_embed.h index 84bad43..08e494f 100644 --- a/generator/well_known_types_embed.h +++ b/generator/well_known_types_embed.h @@ -36,6 +36,7 @@ struct FileToc { const char* name; const char* data; + const char* dts_data; }; extern struct FileToc well_known_types_js[]; From 980a4b2f1caca87e66da2fab3d651294522d3e78 Mon Sep 17 00:00:00 2001 From: Jacob Fugal Date: Mon, 6 Jan 2025 11:19:17 -0700 Subject: [PATCH 3/6] add test.proto output example --- example/README.md | 11 + example/test.d.ts | 1013 +++++ example/test.js | 9993 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 11017 insertions(+) create mode 100644 example/README.md create mode 100644 example/test.d.ts create mode 100644 example/test.js diff --git a/example/README.md b/example/README.md new file mode 100644 index 0000000..dcd9d5f --- /dev/null +++ b/example/README.md @@ -0,0 +1,11 @@ +# Generation + +Built generator plugin: + +`bazel build generator:protoc-gen-js` + +then: + +`protoc --plugin=protoc-gen-js=bazel-bin/generator/protoc-gen-js --proto_path=protos --js_out=library=example/test,import_style=es6,generate_dts,binary:. protos/test.proto` + +Generated both `example/test.js` with ES6-style imports/exports and `example/test.d.ts` with TypeScript definitions. diff --git a/example/test.d.ts b/example/test.d.ts new file mode 100644 index 0000000..b5944de --- /dev/null +++ b/example/test.d.ts @@ -0,0 +1,1013 @@ +declare namespace proto.jspb.test { + export class Empty extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): GlobalObject; + static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.Empty): GlobalObject; + static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.Empty; + static deserializeBinaryFromReader(msg: proto.jspb.test.Empty, reader: jspb.BinaryReader): proto.jspb.test.Empty; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: proto.jspb.test.Empty, writer: jspb.BinaryWriter): void; + } + + export class EnumContainer extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): GlobalObject; + static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.EnumContainer): GlobalObject; + static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.EnumContainer; + static deserializeBinaryFromReader(msg: proto.jspb.test.EnumContainer, reader: jspb.BinaryReader): proto.jspb.test.EnumContainer; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: proto.jspb.test.EnumContainer, writer: jspb.BinaryWriter): void; + getOuterEnum(): proto.jspb.test.OuterEnum; + setOuterEnum(value: proto.jspb.test.OuterEnum): proto.jspb.test.EnumContainer; + clearOuterEnum(): proto.jspb.test.EnumContainer; + hasOuterEnum(): boolean; + } + + export class Simple1 extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): GlobalObject; + static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.Simple1): GlobalObject; + static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.Simple1; + static deserializeBinaryFromReader(msg: proto.jspb.test.Simple1, reader: jspb.BinaryReader): proto.jspb.test.Simple1; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: proto.jspb.test.Simple1, writer: jspb.BinaryWriter): void; + getAString(): string; + setAString(value: string): proto.jspb.test.Simple1; + clearAString(): proto.jspb.test.Simple1; + hasAString(): boolean; + getARepeatedStringList(): string[]; + setARepeatedStringList(value: string[]): proto.jspb.test.Simple1; + addARepeatedString(value: string, index?: number): proto.jspb.test.Simple1; + clearARepeatedStringList(): proto.jspb.test.Simple1; + getABoolean(): boolean; + setABoolean(value: boolean): proto.jspb.test.Simple1; + clearABoolean(): proto.jspb.test.Simple1; + hasABoolean(): boolean; + } + + export class Simple2 extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): GlobalObject; + static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.Simple2): GlobalObject; + static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.Simple2; + static deserializeBinaryFromReader(msg: proto.jspb.test.Simple2, reader: jspb.BinaryReader): proto.jspb.test.Simple2; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: proto.jspb.test.Simple2, writer: jspb.BinaryWriter): void; + getAString(): string; + setAString(value: string): proto.jspb.test.Simple2; + clearAString(): proto.jspb.test.Simple2; + hasAString(): boolean; + getARepeatedStringList(): string[]; + setARepeatedStringList(value: string[]): proto.jspb.test.Simple2; + addARepeatedString(value: string, index?: number): proto.jspb.test.Simple2; + clearARepeatedStringList(): proto.jspb.test.Simple2; + } + + export class SpecialCases extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): GlobalObject; + static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.SpecialCases): GlobalObject; + static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.SpecialCases; + static deserializeBinaryFromReader(msg: proto.jspb.test.SpecialCases, reader: jspb.BinaryReader): proto.jspb.test.SpecialCases; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: proto.jspb.test.SpecialCases, writer: jspb.BinaryWriter): void; + getNormal(): string; + setNormal(value: string): proto.jspb.test.SpecialCases; + clearNormal(): proto.jspb.test.SpecialCases; + hasNormal(): boolean; + getDefault(): string; + setDefault(value: string): proto.jspb.test.SpecialCases; + clearDefault(): proto.jspb.test.SpecialCases; + hasDefault(): boolean; + getFunction(): string; + setFunction(value: string): proto.jspb.test.SpecialCases; + clearFunction(): proto.jspb.test.SpecialCases; + hasFunction(): boolean; + getVar(): string; + setVar(value: string): proto.jspb.test.SpecialCases; + clearVar(): proto.jspb.test.SpecialCases; + hasVar(): boolean; + } + + export class OptionalFields extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): GlobalObject; + static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.OptionalFields): GlobalObject; + static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.OptionalFields; + static deserializeBinaryFromReader(msg: proto.jspb.test.OptionalFields, reader: jspb.BinaryReader): proto.jspb.test.OptionalFields; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: proto.jspb.test.OptionalFields, writer: jspb.BinaryWriter): void; + export class Nested extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): GlobalObject; + static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.OptionalFields.Nested): GlobalObject; + static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.OptionalFields.Nested; + static deserializeBinaryFromReader(msg: proto.jspb.test.OptionalFields.Nested, reader: jspb.BinaryReader): proto.jspb.test.OptionalFields.Nested; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: proto.jspb.test.OptionalFields.Nested, writer: jspb.BinaryWriter): void; + getAnInt(): number; + setAnInt(value: number): proto.jspb.test.OptionalFields.Nested; + clearAnInt(): proto.jspb.test.OptionalFields.Nested; + hasAnInt(): boolean; + } + + getAString(): string; + setAString(value: string): proto.jspb.test.OptionalFields; + clearAString(): proto.jspb.test.OptionalFields; + hasAString(): boolean; + getABool(): boolean; + setABool(value: boolean): proto.jspb.test.OptionalFields; + clearABool(): proto.jspb.test.OptionalFields; + hasABool(): boolean; + getANestedMessage(): proto.jspb.test.OptionalFields.Nested | null; + setANestedMessage(value: proto.jspb.test.OptionalFields.Nested | null | undefined): proto.jspb.test.OptionalFields; + clearANestedMessage(): proto.jspb.test.OptionalFields; + hasANestedMessage(): boolean; + getARepeatedMessageList(): proto.jspb.test.OptionalFields.Nested[]; + setARepeatedMessageList(value: proto.jspb.test.OptionalFields.Nested[]): proto.jspb.test.OptionalFields; + addARepeatedMessage(value?: proto.jspb.test.OptionalFields.Nested, index?: number): proto.jspb.test.OptionalFields.Nested; + clearARepeatedMessageList(): proto.jspb.test.OptionalFields; + getARepeatedStringList(): string[]; + setARepeatedStringList(value: string[]): proto.jspb.test.OptionalFields; + addARepeatedString(value: string, index?: number): proto.jspb.test.OptionalFields; + clearARepeatedStringList(): proto.jspb.test.OptionalFields; + } + + export class HasExtensions extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): GlobalObject; + static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.HasExtensions): GlobalObject; + static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.HasExtensions; + static deserializeBinaryFromReader(msg: proto.jspb.test.HasExtensions, reader: jspb.BinaryReader): proto.jspb.test.HasExtensions; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: proto.jspb.test.HasExtensions, writer: jspb.BinaryWriter): void; + getStr1(): string; + setStr1(value: string): proto.jspb.test.HasExtensions; + clearStr1(): proto.jspb.test.HasExtensions; + hasStr1(): boolean; + getStr2(): string; + setStr2(value: string): proto.jspb.test.HasExtensions; + clearStr2(): proto.jspb.test.HasExtensions; + hasStr2(): boolean; + getStr3(): string; + setStr3(value: string): proto.jspb.test.HasExtensions; + clearStr3(): proto.jspb.test.HasExtensions; + hasStr3(): boolean; + } + + export class Complex extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): GlobalObject; + static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.Complex): GlobalObject; + static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.Complex; + static deserializeBinaryFromReader(msg: proto.jspb.test.Complex, reader: jspb.BinaryReader): proto.jspb.test.Complex; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: proto.jspb.test.Complex, writer: jspb.BinaryWriter): void; + export class Nested extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): GlobalObject; + static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.Complex.Nested): GlobalObject; + static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.Complex.Nested; + static deserializeBinaryFromReader(msg: proto.jspb.test.Complex.Nested, reader: jspb.BinaryReader): proto.jspb.test.Complex.Nested; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: proto.jspb.test.Complex.Nested, writer: jspb.BinaryWriter): void; + getAnInt(): number; + setAnInt(value: number): proto.jspb.test.Complex.Nested; + clearAnInt(): proto.jspb.test.Complex.Nested; + hasAnInt(): boolean; + } + + getAString(): string; + setAString(value: string): proto.jspb.test.Complex; + clearAString(): proto.jspb.test.Complex; + hasAString(): boolean; + getAnOutOfOrderBool(): boolean; + setAnOutOfOrderBool(value: boolean): proto.jspb.test.Complex; + clearAnOutOfOrderBool(): proto.jspb.test.Complex; + hasAnOutOfOrderBool(): boolean; + getANestedMessage(): proto.jspb.test.Complex.Nested | null; + setANestedMessage(value: proto.jspb.test.Complex.Nested | null | undefined): proto.jspb.test.Complex; + clearANestedMessage(): proto.jspb.test.Complex; + hasANestedMessage(): boolean; + getARepeatedMessageList(): proto.jspb.test.Complex.Nested[]; + setARepeatedMessageList(value: proto.jspb.test.Complex.Nested[]): proto.jspb.test.Complex; + addARepeatedMessage(value?: proto.jspb.test.Complex.Nested, index?: number): proto.jspb.test.Complex.Nested; + clearARepeatedMessageList(): proto.jspb.test.Complex; + getARepeatedStringList(): string[]; + setARepeatedStringList(value: string[]): proto.jspb.test.Complex; + addARepeatedString(value: string, index?: number): proto.jspb.test.Complex; + clearARepeatedStringList(): proto.jspb.test.Complex; + getAFloatingPointField(): number; + setAFloatingPointField(value: number): proto.jspb.test.Complex; + clearAFloatingPointField(): proto.jspb.test.Complex; + hasAFloatingPointField(): boolean; + } + + export class OuterMessage extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): GlobalObject; + static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.OuterMessage): GlobalObject; + static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.OuterMessage; + static deserializeBinaryFromReader(msg: proto.jspb.test.OuterMessage, reader: jspb.BinaryReader): proto.jspb.test.OuterMessage; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: proto.jspb.test.OuterMessage, writer: jspb.BinaryWriter): void; + export class Complex extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): GlobalObject; + static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.OuterMessage.Complex): GlobalObject; + static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.OuterMessage.Complex; + static deserializeBinaryFromReader(msg: proto.jspb.test.OuterMessage.Complex, reader: jspb.BinaryReader): proto.jspb.test.OuterMessage.Complex; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: proto.jspb.test.OuterMessage.Complex, writer: jspb.BinaryWriter): void; + getInnerComplexField(): number; + setInnerComplexField(value: number): proto.jspb.test.OuterMessage.Complex; + clearInnerComplexField(): proto.jspb.test.OuterMessage.Complex; + hasInnerComplexField(): boolean; + } + + } + + export class MineField extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): GlobalObject; + static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.MineField): GlobalObject; + static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.MineField; + static deserializeBinaryFromReader(msg: proto.jspb.test.MineField, reader: jspb.BinaryReader): proto.jspb.test.MineField; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: proto.jspb.test.MineField, writer: jspb.BinaryWriter): void; + getCookie(): string; + setCookie(value: string): proto.jspb.test.MineField; + clearCookie(): proto.jspb.test.MineField; + hasCookie(): boolean; + } + + export class IsExtension extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): GlobalObject; + static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.IsExtension): GlobalObject; + static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.IsExtension; + static deserializeBinaryFromReader(msg: proto.jspb.test.IsExtension, reader: jspb.BinaryReader): proto.jspb.test.IsExtension; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: proto.jspb.test.IsExtension, writer: jspb.BinaryWriter): void; + getExt1(): string; + setExt1(value: string): proto.jspb.test.IsExtension; + clearExt1(): proto.jspb.test.IsExtension; + hasExt1(): boolean; + } + + export class IndirectExtension extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): GlobalObject; + static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.IndirectExtension): GlobalObject; + static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.IndirectExtension; + static deserializeBinaryFromReader(msg: proto.jspb.test.IndirectExtension, reader: jspb.BinaryReader): proto.jspb.test.IndirectExtension; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: proto.jspb.test.IndirectExtension, writer: jspb.BinaryWriter): void; + } + + export class DefaultValues extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): GlobalObject; + static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.DefaultValues): GlobalObject; + static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.DefaultValues; + static deserializeBinaryFromReader(msg: proto.jspb.test.DefaultValues, reader: jspb.BinaryReader): proto.jspb.test.DefaultValues; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: proto.jspb.test.DefaultValues, writer: jspb.BinaryWriter): void; + enum Enum { + E1 = 13, + E2 = 77, + } + + getStringField(): string; + setStringField(value: string): proto.jspb.test.DefaultValues; + clearStringField(): proto.jspb.test.DefaultValues; + hasStringField(): boolean; + getBoolField(): boolean; + setBoolField(value: boolean): proto.jspb.test.DefaultValues; + clearBoolField(): proto.jspb.test.DefaultValues; + hasBoolField(): boolean; + getIntField(): number; + setIntField(value: number): proto.jspb.test.DefaultValues; + clearIntField(): proto.jspb.test.DefaultValues; + hasIntField(): boolean; + getEnumField(): proto.jspb.test.DefaultValues.Enum; + setEnumField(value: proto.jspb.test.DefaultValues.Enum): proto.jspb.test.DefaultValues; + clearEnumField(): proto.jspb.test.DefaultValues; + hasEnumField(): boolean; + getEmptyField(): string; + setEmptyField(value: string): proto.jspb.test.DefaultValues; + clearEmptyField(): proto.jspb.test.DefaultValues; + hasEmptyField(): boolean; + getBytesField(): (string|Uint8Array); + getBytesField_asB64(): string; + getBytesField_asU8(): Uint8Array; + setBytesField(value: (string|Uint8Array)): proto.jspb.test.DefaultValues; + clearBytesField(): proto.jspb.test.DefaultValues; + hasBytesField(): boolean; + } + + export class FloatingPointFields extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): GlobalObject; + static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.FloatingPointFields): GlobalObject; + static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.FloatingPointFields; + static deserializeBinaryFromReader(msg: proto.jspb.test.FloatingPointFields, reader: jspb.BinaryReader): proto.jspb.test.FloatingPointFields; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: proto.jspb.test.FloatingPointFields, writer: jspb.BinaryWriter): void; + getOptionalFloatField(): number; + setOptionalFloatField(value: number): proto.jspb.test.FloatingPointFields; + clearOptionalFloatField(): proto.jspb.test.FloatingPointFields; + hasOptionalFloatField(): boolean; + getRequiredFloatField(): number; + setRequiredFloatField(value: number): proto.jspb.test.FloatingPointFields; + clearRequiredFloatField(): proto.jspb.test.FloatingPointFields; + hasRequiredFloatField(): boolean; + getRepeatedFloatFieldList(): number[]; + setRepeatedFloatFieldList(value: number[]): proto.jspb.test.FloatingPointFields; + addRepeatedFloatField(value: number, index?: number): proto.jspb.test.FloatingPointFields; + clearRepeatedFloatFieldList(): proto.jspb.test.FloatingPointFields; + getDefaultFloatField(): number; + setDefaultFloatField(value: number): proto.jspb.test.FloatingPointFields; + clearDefaultFloatField(): proto.jspb.test.FloatingPointFields; + hasDefaultFloatField(): boolean; + getOptionalDoubleField(): number; + setOptionalDoubleField(value: number): proto.jspb.test.FloatingPointFields; + clearOptionalDoubleField(): proto.jspb.test.FloatingPointFields; + hasOptionalDoubleField(): boolean; + getRequiredDoubleField(): number; + setRequiredDoubleField(value: number): proto.jspb.test.FloatingPointFields; + clearRequiredDoubleField(): proto.jspb.test.FloatingPointFields; + hasRequiredDoubleField(): boolean; + getRepeatedDoubleFieldList(): number[]; + setRepeatedDoubleFieldList(value: number[]): proto.jspb.test.FloatingPointFields; + addRepeatedDoubleField(value: number, index?: number): proto.jspb.test.FloatingPointFields; + clearRepeatedDoubleFieldList(): proto.jspb.test.FloatingPointFields; + getDefaultDoubleField(): number; + setDefaultDoubleField(value: number): proto.jspb.test.FloatingPointFields; + clearDefaultDoubleField(): proto.jspb.test.FloatingPointFields; + hasDefaultDoubleField(): boolean; + } + + export class BooleanFields extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): GlobalObject; + static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.BooleanFields): GlobalObject; + static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.BooleanFields; + static deserializeBinaryFromReader(msg: proto.jspb.test.BooleanFields, reader: jspb.BinaryReader): proto.jspb.test.BooleanFields; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: proto.jspb.test.BooleanFields, writer: jspb.BinaryWriter): void; + getOptionalBooleanField(): boolean; + setOptionalBooleanField(value: boolean): proto.jspb.test.BooleanFields; + clearOptionalBooleanField(): proto.jspb.test.BooleanFields; + hasOptionalBooleanField(): boolean; + getRequiredBooleanField(): boolean; + setRequiredBooleanField(value: boolean): proto.jspb.test.BooleanFields; + clearRequiredBooleanField(): proto.jspb.test.BooleanFields; + hasRequiredBooleanField(): boolean; + getRepeatedBooleanFieldList(): boolean[]; + setRepeatedBooleanFieldList(value: boolean[]): proto.jspb.test.BooleanFields; + addRepeatedBooleanField(value: boolean, index?: number): proto.jspb.test.BooleanFields; + clearRepeatedBooleanFieldList(): proto.jspb.test.BooleanFields; + getDefaultBooleanField(): boolean; + setDefaultBooleanField(value: boolean): proto.jspb.test.BooleanFields; + clearDefaultBooleanField(): proto.jspb.test.BooleanFields; + hasDefaultBooleanField(): boolean; + } + + export class TestClone extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): GlobalObject; + static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.TestClone): GlobalObject; + static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.TestClone; + static deserializeBinaryFromReader(msg: proto.jspb.test.TestClone, reader: jspb.BinaryReader): proto.jspb.test.TestClone; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: proto.jspb.test.TestClone, writer: jspb.BinaryWriter): void; + getStr(): string; + setStr(value: string): proto.jspb.test.TestClone; + clearStr(): proto.jspb.test.TestClone; + hasStr(): boolean; + getSimple1(): proto.jspb.test.Simple1 | null; + setSimple1(value: proto.jspb.test.Simple1 | null | undefined): proto.jspb.test.TestClone; + clearSimple1(): proto.jspb.test.TestClone; + hasSimple1(): boolean; + getSimple2List(): proto.jspb.test.Simple1[]; + setSimple2List(value: proto.jspb.test.Simple1[]): proto.jspb.test.TestClone; + addSimple2(value?: proto.jspb.test.Simple1, index?: number): proto.jspb.test.Simple1; + clearSimple2List(): proto.jspb.test.TestClone; + getBytesField(): (string|Uint8Array); + getBytesField_asB64(): string; + getBytesField_asU8(): Uint8Array; + setBytesField(value: (string|Uint8Array)): proto.jspb.test.TestClone; + clearBytesField(): proto.jspb.test.TestClone; + hasBytesField(): boolean; + getUnused(): string; + setUnused(value: string): proto.jspb.test.TestClone; + clearUnused(): proto.jspb.test.TestClone; + hasUnused(): boolean; + } + + export class TestCloneExtension extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): GlobalObject; + static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.TestCloneExtension): GlobalObject; + static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.TestCloneExtension; + static deserializeBinaryFromReader(msg: proto.jspb.test.TestCloneExtension, reader: jspb.BinaryReader): proto.jspb.test.TestCloneExtension; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: proto.jspb.test.TestCloneExtension, writer: jspb.BinaryWriter): void; + getF(): number; + setF(value: number): proto.jspb.test.TestCloneExtension; + clearF(): proto.jspb.test.TestCloneExtension; + hasF(): boolean; + } + + export class CloneExtension extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): GlobalObject; + static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.CloneExtension): GlobalObject; + static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.CloneExtension; + static deserializeBinaryFromReader(msg: proto.jspb.test.CloneExtension, reader: jspb.BinaryReader): proto.jspb.test.CloneExtension; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: proto.jspb.test.CloneExtension, writer: jspb.BinaryWriter): void; + getExt(): string; + setExt(value: string): proto.jspb.test.CloneExtension; + clearExt(): proto.jspb.test.CloneExtension; + hasExt(): boolean; + } + + export class TestGroup extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): GlobalObject; + static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.TestGroup): GlobalObject; + static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.TestGroup; + static deserializeBinaryFromReader(msg: proto.jspb.test.TestGroup, reader: jspb.BinaryReader): proto.jspb.test.TestGroup; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: proto.jspb.test.TestGroup, writer: jspb.BinaryWriter): void; + export class RepeatedGroup extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): GlobalObject; + static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.TestGroup.RepeatedGroup): GlobalObject; + static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.TestGroup.RepeatedGroup; + static deserializeBinaryFromReader(msg: proto.jspb.test.TestGroup.RepeatedGroup, reader: jspb.BinaryReader): proto.jspb.test.TestGroup.RepeatedGroup; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: proto.jspb.test.TestGroup.RepeatedGroup, writer: jspb.BinaryWriter): void; + getId(): string; + setId(value: string): proto.jspb.test.TestGroup.RepeatedGroup; + clearId(): proto.jspb.test.TestGroup.RepeatedGroup; + hasId(): boolean; + getSomeBoolList(): boolean[]; + setSomeBoolList(value: boolean[]): proto.jspb.test.TestGroup.RepeatedGroup; + addSomeBool(value: boolean, index?: number): proto.jspb.test.TestGroup.RepeatedGroup; + clearSomeBoolList(): proto.jspb.test.TestGroup.RepeatedGroup; + } + + export class RequiredGroup extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): GlobalObject; + static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.TestGroup.RequiredGroup): GlobalObject; + static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.TestGroup.RequiredGroup; + static deserializeBinaryFromReader(msg: proto.jspb.test.TestGroup.RequiredGroup, reader: jspb.BinaryReader): proto.jspb.test.TestGroup.RequiredGroup; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: proto.jspb.test.TestGroup.RequiredGroup, writer: jspb.BinaryWriter): void; + getId(): string; + setId(value: string): proto.jspb.test.TestGroup.RequiredGroup; + clearId(): proto.jspb.test.TestGroup.RequiredGroup; + hasId(): boolean; + } + + export class OptionalGroup extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): GlobalObject; + static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.TestGroup.OptionalGroup): GlobalObject; + static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.TestGroup.OptionalGroup; + static deserializeBinaryFromReader(msg: proto.jspb.test.TestGroup.OptionalGroup, reader: jspb.BinaryReader): proto.jspb.test.TestGroup.OptionalGroup; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: proto.jspb.test.TestGroup.OptionalGroup, writer: jspb.BinaryWriter): void; + getId(): string; + setId(value: string): proto.jspb.test.TestGroup.OptionalGroup; + clearId(): proto.jspb.test.TestGroup.OptionalGroup; + hasId(): boolean; + } + + getRepeatedGroupList(): proto.jspb.test.TestGroup.RepeatedGroup[]; + setRepeatedGroupList(value: proto.jspb.test.TestGroup.RepeatedGroup[]): proto.jspb.test.TestGroup; + addRepeatedGroup(value?: proto.jspb.test.TestGroup.RepeatedGroup, index?: number): proto.jspb.test.TestGroup.RepeatedGroup; + clearRepeatedGroupList(): proto.jspb.test.TestGroup; + getRequiredGroup(): proto.jspb.test.TestGroup.RequiredGroup; + setRequiredGroup(value: proto.jspb.test.TestGroup.RequiredGroup): proto.jspb.test.TestGroup; + clearRequiredGroup(): proto.jspb.test.TestGroup; + hasRequiredGroup(): boolean; + getOptionalGroup(): proto.jspb.test.TestGroup.OptionalGroup | null; + setOptionalGroup(value: proto.jspb.test.TestGroup.OptionalGroup | null | undefined): proto.jspb.test.TestGroup; + clearOptionalGroup(): proto.jspb.test.TestGroup; + hasOptionalGroup(): boolean; + getId(): string; + setId(value: string): proto.jspb.test.TestGroup; + clearId(): proto.jspb.test.TestGroup; + hasId(): boolean; + getRequiredSimple(): proto.jspb.test.Simple2; + setRequiredSimple(value: proto.jspb.test.Simple2): proto.jspb.test.TestGroup; + clearRequiredSimple(): proto.jspb.test.TestGroup; + hasRequiredSimple(): boolean; + getOptionalSimple(): proto.jspb.test.Simple2 | null; + setOptionalSimple(value: proto.jspb.test.Simple2 | null | undefined): proto.jspb.test.TestGroup; + clearOptionalSimple(): proto.jspb.test.TestGroup; + hasOptionalSimple(): boolean; + } + + export class TestGroup1 extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): GlobalObject; + static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.TestGroup1): GlobalObject; + static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.TestGroup1; + static deserializeBinaryFromReader(msg: proto.jspb.test.TestGroup1, reader: jspb.BinaryReader): proto.jspb.test.TestGroup1; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: proto.jspb.test.TestGroup1, writer: jspb.BinaryWriter): void; + getGroup(): proto.jspb.test.TestGroup.RepeatedGroup | null; + setGroup(value: proto.jspb.test.TestGroup.RepeatedGroup | null | undefined): proto.jspb.test.TestGroup1; + clearGroup(): proto.jspb.test.TestGroup1; + hasGroup(): boolean; + } + + export class TestReservedNames extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): GlobalObject; + static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.TestReservedNames): GlobalObject; + static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.TestReservedNames; + static deserializeBinaryFromReader(msg: proto.jspb.test.TestReservedNames, reader: jspb.BinaryReader): proto.jspb.test.TestReservedNames; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: proto.jspb.test.TestReservedNames, writer: jspb.BinaryWriter): void; + getExtension$(): number; + setExtension$(value: number): proto.jspb.test.TestReservedNames; + clearExtension$(): proto.jspb.test.TestReservedNames; + hasExtension$(): boolean; + } + + export class TestReservedNamesExtension extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): GlobalObject; + static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.TestReservedNamesExtension): GlobalObject; + static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.TestReservedNamesExtension; + static deserializeBinaryFromReader(msg: proto.jspb.test.TestReservedNamesExtension, reader: jspb.BinaryReader): proto.jspb.test.TestReservedNamesExtension; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: proto.jspb.test.TestReservedNamesExtension, writer: jspb.BinaryWriter): void; + } + + export class TestMessageWithOneof extends jspb.Message { + constructor(data?: any[] | null); + enum PartialOneofCase = { + PARTIAL_ONEOF_NOT_SET: 0, + PONE: 3, + PTHREE: 5, + }; + getPartialOneofCase(): proto.jspb.test.TestMessageWithOneof.PartialOneofCase; + enum RecursiveOneofCase = { + RECURSIVE_ONEOF_NOT_SET: 0, + RONE: 6, + RTWO: 7, + }; + getRecursiveOneofCase(): proto.jspb.test.TestMessageWithOneof.RecursiveOneofCase; + enum DefaultOneofACase = { + DEFAULT_ONEOF_A_NOT_SET: 0, + AONE: 10, + ATWO: 11, + }; + getDefaultOneofACase(): proto.jspb.test.TestMessageWithOneof.DefaultOneofACase; + enum DefaultOneofBCase = { + DEFAULT_ONEOF_B_NOT_SET: 0, + BONE: 12, + BTWO: 13, + }; + getDefaultOneofBCase(): proto.jspb.test.TestMessageWithOneof.DefaultOneofBCase; + toObject(includeInstance?: boolean): GlobalObject; + static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.TestMessageWithOneof): GlobalObject; + static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.TestMessageWithOneof; + static deserializeBinaryFromReader(msg: proto.jspb.test.TestMessageWithOneof, reader: jspb.BinaryReader): proto.jspb.test.TestMessageWithOneof; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: proto.jspb.test.TestMessageWithOneof, writer: jspb.BinaryWriter): void; + getPone(): string; + setPone(value: string): proto.jspb.test.TestMessageWithOneof; + clearPone(): proto.jspb.test.TestMessageWithOneof; + hasPone(): boolean; + getPthree(): string; + setPthree(value: string): proto.jspb.test.TestMessageWithOneof; + clearPthree(): proto.jspb.test.TestMessageWithOneof; + hasPthree(): boolean; + getRone(): proto.jspb.test.TestMessageWithOneof | null; + setRone(value: proto.jspb.test.TestMessageWithOneof | null | undefined): proto.jspb.test.TestMessageWithOneof; + clearRone(): proto.jspb.test.TestMessageWithOneof; + hasRone(): boolean; + getRtwo(): string; + setRtwo(value: string): proto.jspb.test.TestMessageWithOneof; + clearRtwo(): proto.jspb.test.TestMessageWithOneof; + hasRtwo(): boolean; + getNormalField(): boolean; + setNormalField(value: boolean): proto.jspb.test.TestMessageWithOneof; + clearNormalField(): proto.jspb.test.TestMessageWithOneof; + hasNormalField(): boolean; + getRepeatedFieldList(): string[]; + setRepeatedFieldList(value: string[]): proto.jspb.test.TestMessageWithOneof; + addRepeatedField(value: string, index?: number): proto.jspb.test.TestMessageWithOneof; + clearRepeatedFieldList(): proto.jspb.test.TestMessageWithOneof; + getAone(): number; + setAone(value: number): proto.jspb.test.TestMessageWithOneof; + clearAone(): proto.jspb.test.TestMessageWithOneof; + hasAone(): boolean; + getAtwo(): number; + setAtwo(value: number): proto.jspb.test.TestMessageWithOneof; + clearAtwo(): proto.jspb.test.TestMessageWithOneof; + hasAtwo(): boolean; + getBone(): number; + setBone(value: number): proto.jspb.test.TestMessageWithOneof; + clearBone(): proto.jspb.test.TestMessageWithOneof; + hasBone(): boolean; + getBtwo(): number; + setBtwo(value: number): proto.jspb.test.TestMessageWithOneof; + clearBtwo(): proto.jspb.test.TestMessageWithOneof; + hasBtwo(): boolean; + } + + export class TestEndsWithBytes extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): GlobalObject; + static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.TestEndsWithBytes): GlobalObject; + static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.TestEndsWithBytes; + static deserializeBinaryFromReader(msg: proto.jspb.test.TestEndsWithBytes, reader: jspb.BinaryReader): proto.jspb.test.TestEndsWithBytes; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: proto.jspb.test.TestEndsWithBytes, writer: jspb.BinaryWriter): void; + getValue(): number; + setValue(value: number): proto.jspb.test.TestEndsWithBytes; + clearValue(): proto.jspb.test.TestEndsWithBytes; + hasValue(): boolean; + getData(): (string|Uint8Array); + getData_asB64(): string; + getData_asU8(): Uint8Array; + setData(value: (string|Uint8Array)): proto.jspb.test.TestEndsWithBytes; + clearData(): proto.jspb.test.TestEndsWithBytes; + hasData(): boolean; + } + + export class TestLastFieldBeforePivot extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): GlobalObject; + static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.TestLastFieldBeforePivot): GlobalObject; + static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.TestLastFieldBeforePivot; + static deserializeBinaryFromReader(msg: proto.jspb.test.TestLastFieldBeforePivot, reader: jspb.BinaryReader): proto.jspb.test.TestLastFieldBeforePivot; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: proto.jspb.test.TestLastFieldBeforePivot, writer: jspb.BinaryWriter): void; + getLastFieldBeforePivot(): number; + setLastFieldBeforePivot(value: number): proto.jspb.test.TestLastFieldBeforePivot; + clearLastFieldBeforePivot(): proto.jspb.test.TestLastFieldBeforePivot; + hasLastFieldBeforePivot(): boolean; + } + + export class Int64Types extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): GlobalObject; + static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.Int64Types): GlobalObject; + static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.Int64Types; + static deserializeBinaryFromReader(msg: proto.jspb.test.Int64Types, reader: jspb.BinaryReader): proto.jspb.test.Int64Types; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: proto.jspb.test.Int64Types, writer: jspb.BinaryWriter): void; + getInt64Normal(): number; + setInt64Normal(value: number): proto.jspb.test.Int64Types; + clearInt64Normal(): proto.jspb.test.Int64Types; + hasInt64Normal(): boolean; + getInt64String(): string; + setInt64String(value: string): proto.jspb.test.Int64Types; + clearInt64String(): proto.jspb.test.Int64Types; + hasInt64String(): boolean; + getInt64Number(): number; + setInt64Number(value: number): proto.jspb.test.Int64Types; + clearInt64Number(): proto.jspb.test.Int64Types; + hasInt64Number(): boolean; + } + + export class TestMapFieldsNoBinary extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): GlobalObject; + static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.TestMapFieldsNoBinary): GlobalObject; + static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.TestMapFieldsNoBinary; + static deserializeBinaryFromReader(msg: proto.jspb.test.TestMapFieldsNoBinary, reader: jspb.BinaryReader): proto.jspb.test.TestMapFieldsNoBinary; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: proto.jspb.test.TestMapFieldsNoBinary, writer: jspb.BinaryWriter): void; + getMapStringStringMap(noLazyCreate?: boolean): jspb.Map | undefined; + clearMapStringStringMap(): proto.jspb.test.TestMapFieldsNoBinary; + getMapStringInt32Map(noLazyCreate?: boolean): jspb.Map | undefined; + clearMapStringInt32Map(): proto.jspb.test.TestMapFieldsNoBinary; + getMapStringInt64Map(noLazyCreate?: boolean): jspb.Map | undefined; + clearMapStringInt64Map(): proto.jspb.test.TestMapFieldsNoBinary; + getMapStringBoolMap(noLazyCreate?: boolean): jspb.Map | undefined; + clearMapStringBoolMap(): proto.jspb.test.TestMapFieldsNoBinary; + getMapStringDoubleMap(noLazyCreate?: boolean): jspb.Map | undefined; + clearMapStringDoubleMap(): proto.jspb.test.TestMapFieldsNoBinary; + getMapStringEnumMap(noLazyCreate?: boolean): jspb.Map | undefined; + clearMapStringEnumMap(): proto.jspb.test.TestMapFieldsNoBinary; + getMapStringMsgMap(noLazyCreate?: boolean): jspb.Map | undefined; + clearMapStringMsgMap(): proto.jspb.test.TestMapFieldsNoBinary; + getMapInt32StringMap(noLazyCreate?: boolean): jspb.Map | undefined; + clearMapInt32StringMap(): proto.jspb.test.TestMapFieldsNoBinary; + getMapInt64StringMap(noLazyCreate?: boolean): jspb.Map | undefined; + clearMapInt64StringMap(): proto.jspb.test.TestMapFieldsNoBinary; + getMapBoolStringMap(noLazyCreate?: boolean): jspb.Map | undefined; + clearMapBoolStringMap(): proto.jspb.test.TestMapFieldsNoBinary; + getTestMapFields(): proto.jspb.test.TestMapFieldsNoBinary | null; + setTestMapFields(value: proto.jspb.test.TestMapFieldsNoBinary | null | undefined): proto.jspb.test.TestMapFieldsNoBinary; + clearTestMapFields(): proto.jspb.test.TestMapFieldsNoBinary; + hasTestMapFields(): boolean; + getMapStringTestmapfieldsMap(noLazyCreate?: boolean): jspb.Map | undefined; + clearMapStringTestmapfieldsMap(): proto.jspb.test.TestMapFieldsNoBinary; + } + + export class MapValueMessageNoBinary extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): GlobalObject; + static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.MapValueMessageNoBinary): GlobalObject; + static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.MapValueMessageNoBinary; + static deserializeBinaryFromReader(msg: proto.jspb.test.MapValueMessageNoBinary, reader: jspb.BinaryReader): proto.jspb.test.MapValueMessageNoBinary; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: proto.jspb.test.MapValueMessageNoBinary, writer: jspb.BinaryWriter): void; + getFoo(): number; + setFoo(value: number): proto.jspb.test.MapValueMessageNoBinary; + clearFoo(): proto.jspb.test.MapValueMessageNoBinary; + hasFoo(): boolean; + } + + export class Deeply extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): GlobalObject; + static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.Deeply): GlobalObject; + static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.Deeply; + static deserializeBinaryFromReader(msg: proto.jspb.test.Deeply, reader: jspb.BinaryReader): proto.jspb.test.Deeply; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: proto.jspb.test.Deeply, writer: jspb.BinaryWriter): void; + export class Nested extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): GlobalObject; + static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.Deeply.Nested): GlobalObject; + static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.Deeply.Nested; + static deserializeBinaryFromReader(msg: proto.jspb.test.Deeply.Nested, reader: jspb.BinaryReader): proto.jspb.test.Deeply.Nested; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: proto.jspb.test.Deeply.Nested, writer: jspb.BinaryWriter): void; + export class Message extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): GlobalObject; + static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.Deeply.Nested.Message): GlobalObject; + static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.Deeply.Nested.Message; + static deserializeBinaryFromReader(msg: proto.jspb.test.Deeply.Nested.Message, reader: jspb.BinaryReader): proto.jspb.test.Deeply.Nested.Message; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: proto.jspb.test.Deeply.Nested.Message, writer: jspb.BinaryWriter): void; + getCount(): number; + setCount(value: number): proto.jspb.test.Deeply.Nested.Message; + clearCount(): proto.jspb.test.Deeply.Nested.Message; + hasCount(): boolean; + } + + } + + } + + enum OuterEnum { + FOO = 1, + BAR = 2, + } + + enum MapValueEnumNoBinary { + MAP_VALUE_FOO_NOBINARY = 0, + MAP_VALUE_BAR_NOBINARY = 1, + MAP_VALUE_BAZ_NOBINARY = 2, + } + + enum TestAllowAliasEnum { + TEST_ALLOW_ALIAS_DEFAULT = 0, + VALUE1 = 1, + } + +} + +declare module "goog:proto.jspb.test.BooleanFields " { + import BooleanFields = proto.jspb.test.BooleanFields; + export default BooleanFields; +} + +declare module "goog:proto.jspb.test.CloneExtension " { + import CloneExtension = proto.jspb.test.CloneExtension; + export default CloneExtension; +} + +declare module "goog:proto.jspb.test.Complex " { + import Complex = proto.jspb.test.Complex; + export default Complex; +} + +declare module "goog:proto.jspb.test.Deeply " { + import Deeply = proto.jspb.test.Deeply; + export default Deeply; +} + +declare module "goog:proto.jspb.test.DefaultValues " { + import DefaultValues = proto.jspb.test.DefaultValues; + export default DefaultValues; +} + +declare module "goog:proto.jspb.test.Empty " { + import Empty = proto.jspb.test.Empty; + export default Empty; +} + +declare module "goog:proto.jspb.test.EnumContainer " { + import EnumContainer = proto.jspb.test.EnumContainer; + export default EnumContainer; +} + +declare module "goog:proto.jspb.test.FloatingPointFields " { + import FloatingPointFields = proto.jspb.test.FloatingPointFields; + export default FloatingPointFields; +} + +declare module "goog:proto.jspb.test.HasExtensions " { + import HasExtensions = proto.jspb.test.HasExtensions; + export default HasExtensions; +} + +declare module "goog:proto.jspb.test.IndirectExtension " { + import IndirectExtension = proto.jspb.test.IndirectExtension; + export default IndirectExtension; +} + +declare module "goog:proto.jspb.test.Int64Types " { + import Int64Types = proto.jspb.test.Int64Types; + export default Int64Types; +} + +declare module "goog:proto.jspb.test.IsExtension " { + import IsExtension = proto.jspb.test.IsExtension; + export default IsExtension; +} + +declare module "goog:proto.jspb.test.MapValueEnumNoBinary " { + import MapValueEnumNoBinary = proto.jspb.test.MapValueEnumNoBinary; + export default MapValueEnumNoBinary; +} + +declare module "goog:proto.jspb.test.MapValueMessageNoBinary " { + import MapValueMessageNoBinary = proto.jspb.test.MapValueMessageNoBinary; + export default MapValueMessageNoBinary; +} + +declare module "goog:proto.jspb.test.MineField " { + import MineField = proto.jspb.test.MineField; + export default MineField; +} + +declare module "goog:proto.jspb.test.OptionalFields " { + import OptionalFields = proto.jspb.test.OptionalFields; + export default OptionalFields; +} + +declare module "goog:proto.jspb.test.OuterEnum " { + import OuterEnum = proto.jspb.test.OuterEnum; + export default OuterEnum; +} + +declare module "goog:proto.jspb.test.OuterMessage " { + import OuterMessage = proto.jspb.test.OuterMessage; + export default OuterMessage; +} + +declare module "goog:proto.jspb.test.Simple1 " { + import Simple1 = proto.jspb.test.Simple1; + export default Simple1; +} + +declare module "goog:proto.jspb.test.Simple2 " { + import Simple2 = proto.jspb.test.Simple2; + export default Simple2; +} + +declare module "goog:proto.jspb.test.SpecialCases " { + import SpecialCases = proto.jspb.test.SpecialCases; + export default SpecialCases; +} + +declare module "goog:proto.jspb.test.TestAllowAliasEnum " { + import TestAllowAliasEnum = proto.jspb.test.TestAllowAliasEnum; + export default TestAllowAliasEnum; +} + +declare module "goog:proto.jspb.test.TestClone " { + import TestClone = proto.jspb.test.TestClone; + export default TestClone; +} + +declare module "goog:proto.jspb.test.TestCloneExtension " { + import TestCloneExtension = proto.jspb.test.TestCloneExtension; + export default TestCloneExtension; +} + +declare module "goog:proto.jspb.test.TestEndsWithBytes " { + import TestEndsWithBytes = proto.jspb.test.TestEndsWithBytes; + export default TestEndsWithBytes; +} + +declare module "goog:proto.jspb.test.TestGroup " { + import TestGroup = proto.jspb.test.TestGroup; + export default TestGroup; +} + +declare module "goog:proto.jspb.test.TestGroup1 " { + import TestGroup1 = proto.jspb.test.TestGroup1; + export default TestGroup1; +} + +declare module "goog:proto.jspb.test.TestLastFieldBeforePivot " { + import TestLastFieldBeforePivot = proto.jspb.test.TestLastFieldBeforePivot; + export default TestLastFieldBeforePivot; +} + +declare module "goog:proto.jspb.test.TestMapFieldsNoBinary " { + import TestMapFieldsNoBinary = proto.jspb.test.TestMapFieldsNoBinary; + export default TestMapFieldsNoBinary; +} + +declare module "goog:proto.jspb.test.TestMessageWithOneof " { + import TestMessageWithOneof = proto.jspb.test.TestMessageWithOneof; + export default TestMessageWithOneof; +} + +declare module "goog:proto.jspb.test.TestReservedNames " { + import TestReservedNames = proto.jspb.test.TestReservedNames; + export default TestReservedNames; +} + +declare module "goog:proto.jspb.test.TestReservedNamesExtension " { + import TestReservedNamesExtension = proto.jspb.test.TestReservedNamesExtension; + export default TestReservedNamesExtension; +} + +import BooleanFields = proto.jspb.test.BooleanFields; +import CloneExtension = proto.jspb.test.CloneExtension; +import Complex = proto.jspb.test.Complex; +import Deeply = proto.jspb.test.Deeply; +import DefaultValues = proto.jspb.test.DefaultValues; +import Empty = proto.jspb.test.Empty; +import EnumContainer = proto.jspb.test.EnumContainer; +import FloatingPointFields = proto.jspb.test.FloatingPointFields; +import HasExtensions = proto.jspb.test.HasExtensions; +import IndirectExtension = proto.jspb.test.IndirectExtension; +import Int64Types = proto.jspb.test.Int64Types; +import IsExtension = proto.jspb.test.IsExtension; +import MapValueEnumNoBinary = proto.jspb.test.MapValueEnumNoBinary; +import MapValueMessageNoBinary = proto.jspb.test.MapValueMessageNoBinary; +import MineField = proto.jspb.test.MineField; +import OptionalFields = proto.jspb.test.OptionalFields; +import OuterEnum = proto.jspb.test.OuterEnum; +import OuterMessage = proto.jspb.test.OuterMessage; +import Simple1 = proto.jspb.test.Simple1; +import Simple2 = proto.jspb.test.Simple2; +import SpecialCases = proto.jspb.test.SpecialCases; +import TestAllowAliasEnum = proto.jspb.test.TestAllowAliasEnum; +import TestClone = proto.jspb.test.TestClone; +import TestCloneExtension = proto.jspb.test.TestCloneExtension; +import TestEndsWithBytes = proto.jspb.test.TestEndsWithBytes; +import TestGroup = proto.jspb.test.TestGroup; +import TestGroup1 = proto.jspb.test.TestGroup1; +import TestLastFieldBeforePivot = proto.jspb.test.TestLastFieldBeforePivot; +import TestMapFieldsNoBinary = proto.jspb.test.TestMapFieldsNoBinary; +import TestMessageWithOneof = proto.jspb.test.TestMessageWithOneof; +import TestReservedNames = proto.jspb.test.TestReservedNames; +import TestReservedNamesExtension = proto.jspb.test.TestReservedNamesExtension; + +export { + BooleanFields, + CloneExtension, + Complex, + Deeply, + DefaultValues, + Empty, + EnumContainer, + FloatingPointFields, + HasExtensions, + IndirectExtension, + Int64Types, + IsExtension, + MapValueEnumNoBinary, + MapValueMessageNoBinary, + MineField, + OptionalFields, + OuterEnum, + OuterMessage, + Simple1, + Simple2, + SpecialCases, + TestAllowAliasEnum, + TestClone, + TestCloneExtension, + TestEndsWithBytes, + TestGroup, + TestGroup1, + TestLastFieldBeforePivot, + TestMapFieldsNoBinary, + TestMessageWithOneof, + TestReservedNames, + TestReservedNamesExtension, +}; diff --git a/example/test.js b/example/test.js new file mode 100644 index 0000000..f73fc75 --- /dev/null +++ b/example/test.js @@ -0,0 +1,9993 @@ +// source: test.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +import * as jspb from 'google-protobuf'; +var goog = jspb; +var proto = {}; + +import * as google_protobuf_descriptor_pb from 'google-protobuf/google/protobuf/descriptor.js'; +goog.object.extend(proto, google_protobuf_descriptor_pb); +goog.exportSymbol('proto.jspb.test.BooleanFields', null, global); +goog.exportSymbol('proto.jspb.test.CloneExtension', null, global); +goog.exportSymbol('proto.jspb.test.Complex', null, global); +goog.exportSymbol('proto.jspb.test.Complex.Nested', null, global); +goog.exportSymbol('proto.jspb.test.Deeply', null, global); +goog.exportSymbol('proto.jspb.test.Deeply.Nested', null, global); +goog.exportSymbol('proto.jspb.test.Deeply.Nested.Message', null, global); +goog.exportSymbol('proto.jspb.test.DefaultValues', null, global); +goog.exportSymbol('proto.jspb.test.DefaultValues.Enum', null, global); +goog.exportSymbol('proto.jspb.test.Empty', null, global); +goog.exportSymbol('proto.jspb.test.EnumContainer', null, global); +goog.exportSymbol('proto.jspb.test.FloatingPointFields', null, global); +goog.exportSymbol('proto.jspb.test.HasExtensions', null, global); +goog.exportSymbol('proto.jspb.test.IndirectExtension', null, global); +goog.exportSymbol('proto.jspb.test.Int64Types', null, global); +goog.exportSymbol('proto.jspb.test.IsExtension', null, global); +goog.exportSymbol('proto.jspb.test.MapValueEnumNoBinary', null, global); +goog.exportSymbol('proto.jspb.test.MapValueMessageNoBinary', null, global); +goog.exportSymbol('proto.jspb.test.MineField', null, global); +goog.exportSymbol('proto.jspb.test.OptionalFields', null, global); +goog.exportSymbol('proto.jspb.test.OptionalFields.Nested', null, global); +goog.exportSymbol('proto.jspb.test.OuterEnum', null, global); +goog.exportSymbol('proto.jspb.test.OuterMessage', null, global); +goog.exportSymbol('proto.jspb.test.OuterMessage.Complex', null, global); +goog.exportSymbol('proto.jspb.test.Simple1', null, global); +goog.exportSymbol('proto.jspb.test.Simple2', null, global); +goog.exportSymbol('proto.jspb.test.SpecialCases', null, global); +goog.exportSymbol('proto.jspb.test.TestAllowAliasEnum', null, global); +goog.exportSymbol('proto.jspb.test.TestClone', null, global); +goog.exportSymbol('proto.jspb.test.TestCloneExtension', null, global); +goog.exportSymbol('proto.jspb.test.TestEndsWithBytes', null, global); +goog.exportSymbol('proto.jspb.test.TestGroup', null, global); +goog.exportSymbol('proto.jspb.test.TestGroup.OptionalGroup', null, global); +goog.exportSymbol('proto.jspb.test.TestGroup.RepeatedGroup', null, global); +goog.exportSymbol('proto.jspb.test.TestGroup.RequiredGroup', null, global); +goog.exportSymbol('proto.jspb.test.TestGroup1', null, global); +goog.exportSymbol('proto.jspb.test.TestLastFieldBeforePivot', null, global); +goog.exportSymbol('proto.jspb.test.TestMapFieldsNoBinary', null, global); +goog.exportSymbol('proto.jspb.test.TestMessageWithOneof', null, global); +goog.exportSymbol('proto.jspb.test.TestMessageWithOneof.DefaultOneofACase', null, global); +goog.exportSymbol('proto.jspb.test.TestMessageWithOneof.DefaultOneofBCase', null, global); +goog.exportSymbol('proto.jspb.test.TestMessageWithOneof.PartialOneofCase', null, global); +goog.exportSymbol('proto.jspb.test.TestMessageWithOneof.RecursiveOneofCase', null, global); +goog.exportSymbol('proto.jspb.test.TestReservedNames', null, global); +goog.exportSymbol('proto.jspb.test.TestReservedNamesExtension', null, global); +goog.exportSymbol('proto.jspb.test.extendTestLastFieldBeforePivotField', null, global); +goog.exportSymbol('proto.jspb.test.simple1', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.Empty = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.Empty, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.Empty.displayName = 'proto.jspb.test.Empty'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.EnumContainer = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.EnumContainer, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.EnumContainer.displayName = 'proto.jspb.test.EnumContainer'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.Simple1 = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.jspb.test.Simple1.repeatedFields_, null); +}; +goog.inherits(proto.jspb.test.Simple1, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.Simple1.displayName = 'proto.jspb.test.Simple1'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.Simple2 = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.jspb.test.Simple2.repeatedFields_, null); +}; +goog.inherits(proto.jspb.test.Simple2, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.Simple2.displayName = 'proto.jspb.test.Simple2'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.SpecialCases = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.SpecialCases, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.SpecialCases.displayName = 'proto.jspb.test.SpecialCases'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.OptionalFields = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.jspb.test.OptionalFields.repeatedFields_, null); +}; +goog.inherits(proto.jspb.test.OptionalFields, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.OptionalFields.displayName = 'proto.jspb.test.OptionalFields'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.OptionalFields.Nested = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.OptionalFields.Nested, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.OptionalFields.Nested.displayName = 'proto.jspb.test.OptionalFields.Nested'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.HasExtensions = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, 4, null, null); +}; +goog.inherits(proto.jspb.test.HasExtensions, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.HasExtensions.displayName = 'proto.jspb.test.HasExtensions'; +} + +/** + * The extensions registered with this message class. This is a map of + * extension field number to fieldInfo object. + * + * For example: + * { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, ctor: proto.example.MyMessage} } + * + * fieldName contains the JsCompiler renamed field name property so that it + * works in OPTIMIZED mode. + * + * @type {!Object} + */ +proto.jspb.test.HasExtensions.extensions = {}; + + +/** + * The extensions registered with this message class. This is a map of + * extension field number to fieldInfo object. + * + * For example: + * { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, ctor: proto.example.MyMessage} } + * + * fieldName contains the JsCompiler renamed field name property so that it + * works in OPTIMIZED mode. + * + * @type {!Object} + */ +proto.jspb.test.HasExtensions.extensionsBinary = {}; + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.Complex = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.jspb.test.Complex.repeatedFields_, null); +}; +goog.inherits(proto.jspb.test.Complex, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.Complex.displayName = 'proto.jspb.test.Complex'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.Complex.Nested = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.Complex.Nested, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.Complex.Nested.displayName = 'proto.jspb.test.Complex.Nested'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.OuterMessage = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.OuterMessage, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.OuterMessage.displayName = 'proto.jspb.test.OuterMessage'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.OuterMessage.Complex = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.OuterMessage.Complex, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.OuterMessage.Complex.displayName = 'proto.jspb.test.OuterMessage.Complex'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.MineField = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.MineField, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.MineField.displayName = 'proto.jspb.test.MineField'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.IsExtension = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.IsExtension, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.IsExtension.displayName = 'proto.jspb.test.IsExtension'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.IndirectExtension = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.IndirectExtension, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.IndirectExtension.displayName = 'proto.jspb.test.IndirectExtension'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.DefaultValues = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.DefaultValues, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.DefaultValues.displayName = 'proto.jspb.test.DefaultValues'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.FloatingPointFields = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.jspb.test.FloatingPointFields.repeatedFields_, null); +}; +goog.inherits(proto.jspb.test.FloatingPointFields, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.FloatingPointFields.displayName = 'proto.jspb.test.FloatingPointFields'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.BooleanFields = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.jspb.test.BooleanFields.repeatedFields_, null); +}; +goog.inherits(proto.jspb.test.BooleanFields, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.BooleanFields.displayName = 'proto.jspb.test.BooleanFields'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.TestClone = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, 8, proto.jspb.test.TestClone.repeatedFields_, null); +}; +goog.inherits(proto.jspb.test.TestClone, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.TestClone.displayName = 'proto.jspb.test.TestClone'; +} + +/** + * The extensions registered with this message class. This is a map of + * extension field number to fieldInfo object. + * + * For example: + * { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, ctor: proto.example.MyMessage} } + * + * fieldName contains the JsCompiler renamed field name property so that it + * works in OPTIMIZED mode. + * + * @type {!Object} + */ +proto.jspb.test.TestClone.extensions = {}; + + +/** + * The extensions registered with this message class. This is a map of + * extension field number to fieldInfo object. + * + * For example: + * { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, ctor: proto.example.MyMessage} } + * + * fieldName contains the JsCompiler renamed field name property so that it + * works in OPTIMIZED mode. + * + * @type {!Object} + */ +proto.jspb.test.TestClone.extensionsBinary = {}; + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.TestCloneExtension = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.TestCloneExtension, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.TestCloneExtension.displayName = 'proto.jspb.test.TestCloneExtension'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.CloneExtension = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.CloneExtension, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.CloneExtension.displayName = 'proto.jspb.test.CloneExtension'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.TestGroup = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.jspb.test.TestGroup.repeatedFields_, null); +}; +goog.inherits(proto.jspb.test.TestGroup, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.TestGroup.displayName = 'proto.jspb.test.TestGroup'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.TestGroup.RepeatedGroup = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.jspb.test.TestGroup.RepeatedGroup.repeatedFields_, null); +}; +goog.inherits(proto.jspb.test.TestGroup.RepeatedGroup, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.TestGroup.RepeatedGroup.displayName = 'proto.jspb.test.TestGroup.RepeatedGroup'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.TestGroup.RequiredGroup = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.TestGroup.RequiredGroup, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.TestGroup.RequiredGroup.displayName = 'proto.jspb.test.TestGroup.RequiredGroup'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.TestGroup.OptionalGroup = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.TestGroup.OptionalGroup, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.TestGroup.OptionalGroup.displayName = 'proto.jspb.test.TestGroup.OptionalGroup'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.TestGroup1 = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.TestGroup1, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.TestGroup1.displayName = 'proto.jspb.test.TestGroup1'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.TestReservedNames = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, 2, null, null); +}; +goog.inherits(proto.jspb.test.TestReservedNames, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.TestReservedNames.displayName = 'proto.jspb.test.TestReservedNames'; +} + +/** + * The extensions registered with this message class. This is a map of + * extension field number to fieldInfo object. + * + * For example: + * { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, ctor: proto.example.MyMessage} } + * + * fieldName contains the JsCompiler renamed field name property so that it + * works in OPTIMIZED mode. + * + * @type {!Object} + */ +proto.jspb.test.TestReservedNames.extensions = {}; + + +/** + * The extensions registered with this message class. This is a map of + * extension field number to fieldInfo object. + * + * For example: + * { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, ctor: proto.example.MyMessage} } + * + * fieldName contains the JsCompiler renamed field name property so that it + * works in OPTIMIZED mode. + * + * @type {!Object} + */ +proto.jspb.test.TestReservedNames.extensionsBinary = {}; + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.TestReservedNamesExtension = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.TestReservedNamesExtension, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.TestReservedNamesExtension.displayName = 'proto.jspb.test.TestReservedNamesExtension'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.TestMessageWithOneof = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.jspb.test.TestMessageWithOneof.repeatedFields_, proto.jspb.test.TestMessageWithOneof.oneofGroups_); +}; +goog.inherits(proto.jspb.test.TestMessageWithOneof, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.TestMessageWithOneof.displayName = 'proto.jspb.test.TestMessageWithOneof'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.TestEndsWithBytes = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.TestEndsWithBytes, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.TestEndsWithBytes.displayName = 'proto.jspb.test.TestEndsWithBytes'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.TestLastFieldBeforePivot = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, 2, null, null); +}; +goog.inherits(proto.jspb.test.TestLastFieldBeforePivot, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.TestLastFieldBeforePivot.displayName = 'proto.jspb.test.TestLastFieldBeforePivot'; +} + +/** + * The extensions registered with this message class. This is a map of + * extension field number to fieldInfo object. + * + * For example: + * { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, ctor: proto.example.MyMessage} } + * + * fieldName contains the JsCompiler renamed field name property so that it + * works in OPTIMIZED mode. + * + * @type {!Object} + */ +proto.jspb.test.TestLastFieldBeforePivot.extensions = {}; + + +/** + * The extensions registered with this message class. This is a map of + * extension field number to fieldInfo object. + * + * For example: + * { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, ctor: proto.example.MyMessage} } + * + * fieldName contains the JsCompiler renamed field name property so that it + * works in OPTIMIZED mode. + * + * @type {!Object} + */ +proto.jspb.test.TestLastFieldBeforePivot.extensionsBinary = {}; + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.Int64Types = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.Int64Types, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.Int64Types.displayName = 'proto.jspb.test.Int64Types'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.TestMapFieldsNoBinary = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.TestMapFieldsNoBinary, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.TestMapFieldsNoBinary.displayName = 'proto.jspb.test.TestMapFieldsNoBinary'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.MapValueMessageNoBinary = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.MapValueMessageNoBinary, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.MapValueMessageNoBinary.displayName = 'proto.jspb.test.MapValueMessageNoBinary'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.Deeply = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.Deeply, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.Deeply.displayName = 'proto.jspb.test.Deeply'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.Deeply.Nested = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.Deeply.Nested, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.Deeply.Nested.displayName = 'proto.jspb.test.Deeply.Nested'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.Deeply.Nested.Message = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.Deeply.Nested.Message, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.Deeply.Nested.Message.displayName = 'proto.jspb.test.Deeply.Nested.Message'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.Empty.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.Empty.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.Empty} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Empty.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.Empty} + */ +proto.jspb.test.Empty.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.Empty; + return proto.jspb.test.Empty.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.Empty} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.Empty} + */ +proto.jspb.test.Empty.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.Empty.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.Empty.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.Empty} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Empty.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.EnumContainer.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.EnumContainer.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.EnumContainer} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.EnumContainer.toObject = function(includeInstance, msg) { + var f, obj = { +outerEnum: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.EnumContainer} + */ +proto.jspb.test.EnumContainer.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.EnumContainer; + return proto.jspb.test.EnumContainer.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.EnumContainer} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.EnumContainer} + */ +proto.jspb.test.EnumContainer.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.jspb.test.OuterEnum} */ (reader.readEnum()); + msg.setOuterEnum(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.EnumContainer.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.EnumContainer.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.EnumContainer} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.EnumContainer.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {!proto.jspb.test.OuterEnum} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeEnum( + 1, + f + ); + } +}; + + +/** + * optional OuterEnum outer_enum = 1; + * @return {!proto.jspb.test.OuterEnum} + */ +proto.jspb.test.EnumContainer.prototype.getOuterEnum = function() { + return /** @type {!proto.jspb.test.OuterEnum} */ (jspb.Message.getFieldWithDefault(this, 1, 1)); +}; + + +/** + * @param {!proto.jspb.test.OuterEnum} value + * @return {!proto.jspb.test.EnumContainer} returns this + */ +proto.jspb.test.EnumContainer.prototype.setOuterEnum = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.EnumContainer} returns this + */ +proto.jspb.test.EnumContainer.prototype.clearOuterEnum = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.EnumContainer.prototype.hasOuterEnum = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.jspb.test.Simple1.repeatedFields_ = [2]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.Simple1.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.Simple1.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.Simple1} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Simple1.toObject = function(includeInstance, msg) { + var f, obj = { +aString: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, +aRepeatedStringList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? undefined : f, +aBoolean: (f = jspb.Message.getBooleanField(msg, 3)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.Simple1} + */ +proto.jspb.test.Simple1.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.Simple1; + return proto.jspb.test.Simple1.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.Simple1} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.Simple1} + */ +proto.jspb.test.Simple1.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setAString(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.addARepeatedString(value); + break; + case 3: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setABoolean(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.Simple1.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.Simple1.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.Simple1} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Simple1.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } + f = message.getARepeatedStringList(); + if (f.length > 0) { + writer.writeRepeatedString( + 2, + f + ); + } + f = /** @type {boolean} */ (jspb.Message.getField(message, 3)); + if (f != null) { + writer.writeBool( + 3, + f + ); + } +}; + + +/** + * required string a_string = 1; + * @return {string} + */ +proto.jspb.test.Simple1.prototype.getAString = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.Simple1} returns this + */ +proto.jspb.test.Simple1.prototype.setAString = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.Simple1} returns this + */ +proto.jspb.test.Simple1.prototype.clearAString = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.Simple1.prototype.hasAString = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * repeated string a_repeated_string = 2; + * @return {!Array} + */ +proto.jspb.test.Simple1.prototype.getARepeatedStringList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.jspb.test.Simple1} returns this + */ +proto.jspb.test.Simple1.prototype.setARepeatedStringList = function(value) { + return jspb.Message.setField(this, 2, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.jspb.test.Simple1} returns this + */ +proto.jspb.test.Simple1.prototype.addARepeatedString = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 2, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.jspb.test.Simple1} returns this + */ +proto.jspb.test.Simple1.prototype.clearARepeatedStringList = function() { + return this.setARepeatedStringList([]); +}; + + +/** + * optional bool a_boolean = 3; + * @return {boolean} + */ +proto.jspb.test.Simple1.prototype.getABoolean = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.jspb.test.Simple1} returns this + */ +proto.jspb.test.Simple1.prototype.setABoolean = function(value) { + return jspb.Message.setField(this, 3, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.Simple1} returns this + */ +proto.jspb.test.Simple1.prototype.clearABoolean = function() { + return jspb.Message.setField(this, 3, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.Simple1.prototype.hasABoolean = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.jspb.test.Simple2.repeatedFields_ = [2]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.Simple2.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.Simple2.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.Simple2} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Simple2.toObject = function(includeInstance, msg) { + var f, obj = { +aString: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, +aRepeatedStringList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.Simple2} + */ +proto.jspb.test.Simple2.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.Simple2; + return proto.jspb.test.Simple2.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.Simple2} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.Simple2} + */ +proto.jspb.test.Simple2.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setAString(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.addARepeatedString(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.Simple2.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.Simple2.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.Simple2} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Simple2.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } + f = message.getARepeatedStringList(); + if (f.length > 0) { + writer.writeRepeatedString( + 2, + f + ); + } +}; + + +/** + * required string a_string = 1; + * @return {string} + */ +proto.jspb.test.Simple2.prototype.getAString = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.Simple2} returns this + */ +proto.jspb.test.Simple2.prototype.setAString = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.Simple2} returns this + */ +proto.jspb.test.Simple2.prototype.clearAString = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.Simple2.prototype.hasAString = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * repeated string a_repeated_string = 2; + * @return {!Array} + */ +proto.jspb.test.Simple2.prototype.getARepeatedStringList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.jspb.test.Simple2} returns this + */ +proto.jspb.test.Simple2.prototype.setARepeatedStringList = function(value) { + return jspb.Message.setField(this, 2, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.jspb.test.Simple2} returns this + */ +proto.jspb.test.Simple2.prototype.addARepeatedString = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 2, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.jspb.test.Simple2} returns this + */ +proto.jspb.test.Simple2.prototype.clearARepeatedStringList = function() { + return this.setARepeatedStringList([]); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.SpecialCases.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.SpecialCases.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.SpecialCases} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.SpecialCases.toObject = function(includeInstance, msg) { + var f, obj = { +normal: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, +pb_default: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f, +pb_function: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f, +pb_var: (f = jspb.Message.getField(msg, 4)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.SpecialCases} + */ +proto.jspb.test.SpecialCases.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.SpecialCases; + return proto.jspb.test.SpecialCases.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.SpecialCases} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.SpecialCases} + */ +proto.jspb.test.SpecialCases.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setNormal(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setDefault(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setFunction(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setVar(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.SpecialCases.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.SpecialCases.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.SpecialCases} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.SpecialCases.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeString( + 2, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 3)); + if (f != null) { + writer.writeString( + 3, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 4)); + if (f != null) { + writer.writeString( + 4, + f + ); + } +}; + + +/** + * required string normal = 1; + * @return {string} + */ +proto.jspb.test.SpecialCases.prototype.getNormal = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.SpecialCases} returns this + */ +proto.jspb.test.SpecialCases.prototype.setNormal = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.SpecialCases} returns this + */ +proto.jspb.test.SpecialCases.prototype.clearNormal = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.SpecialCases.prototype.hasNormal = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * required string default = 2; + * @return {string} + */ +proto.jspb.test.SpecialCases.prototype.getDefault = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.SpecialCases} returns this + */ +proto.jspb.test.SpecialCases.prototype.setDefault = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.SpecialCases} returns this + */ +proto.jspb.test.SpecialCases.prototype.clearDefault = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.SpecialCases.prototype.hasDefault = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * required string function = 3; + * @return {string} + */ +proto.jspb.test.SpecialCases.prototype.getFunction = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.SpecialCases} returns this + */ +proto.jspb.test.SpecialCases.prototype.setFunction = function(value) { + return jspb.Message.setField(this, 3, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.SpecialCases} returns this + */ +proto.jspb.test.SpecialCases.prototype.clearFunction = function() { + return jspb.Message.setField(this, 3, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.SpecialCases.prototype.hasFunction = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * required string var = 4; + * @return {string} + */ +proto.jspb.test.SpecialCases.prototype.getVar = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.SpecialCases} returns this + */ +proto.jspb.test.SpecialCases.prototype.setVar = function(value) { + return jspb.Message.setField(this, 4, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.SpecialCases} returns this + */ +proto.jspb.test.SpecialCases.prototype.clearVar = function() { + return jspb.Message.setField(this, 4, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.SpecialCases.prototype.hasVar = function() { + return jspb.Message.getField(this, 4) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.jspb.test.OptionalFields.repeatedFields_ = [4,5]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.OptionalFields.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.OptionalFields.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.OptionalFields} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.OptionalFields.toObject = function(includeInstance, msg) { + var f, obj = { +aString: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, +aBool: (f = jspb.Message.getBooleanField(msg, 2)) == null ? undefined : f, +aNestedMessage: (f = msg.getANestedMessage()) && proto.jspb.test.OptionalFields.Nested.toObject(includeInstance, f), +aRepeatedMessageList: jspb.Message.toObjectList(msg.getARepeatedMessageList(), + proto.jspb.test.OptionalFields.Nested.toObject, includeInstance), +aRepeatedStringList: (f = jspb.Message.getRepeatedField(msg, 5)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.OptionalFields} + */ +proto.jspb.test.OptionalFields.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.OptionalFields; + return proto.jspb.test.OptionalFields.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.OptionalFields} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.OptionalFields} + */ +proto.jspb.test.OptionalFields.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setAString(value); + break; + case 2: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setABool(value); + break; + case 3: + var value = new proto.jspb.test.OptionalFields.Nested; + reader.readMessage(value,proto.jspb.test.OptionalFields.Nested.deserializeBinaryFromReader); + msg.setANestedMessage(value); + break; + case 4: + var value = new proto.jspb.test.OptionalFields.Nested; + reader.readMessage(value,proto.jspb.test.OptionalFields.Nested.deserializeBinaryFromReader); + msg.addARepeatedMessage(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.addARepeatedString(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.OptionalFields.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.OptionalFields.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.OptionalFields} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.OptionalFields.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } + f = /** @type {boolean} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeBool( + 2, + f + ); + } + f = message.getANestedMessage(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.jspb.test.OptionalFields.Nested.serializeBinaryToWriter + ); + } + f = message.getARepeatedMessageList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 4, + f, + proto.jspb.test.OptionalFields.Nested.serializeBinaryToWriter + ); + } + f = message.getARepeatedStringList(); + if (f.length > 0) { + writer.writeRepeatedString( + 5, + f + ); + } +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.OptionalFields.Nested.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.OptionalFields.Nested.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.OptionalFields.Nested} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.OptionalFields.Nested.toObject = function(includeInstance, msg) { + var f, obj = { +anInt: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.OptionalFields.Nested} + */ +proto.jspb.test.OptionalFields.Nested.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.OptionalFields.Nested; + return proto.jspb.test.OptionalFields.Nested.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.OptionalFields.Nested} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.OptionalFields.Nested} + */ +proto.jspb.test.OptionalFields.Nested.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt32()); + msg.setAnInt(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.OptionalFields.Nested.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.OptionalFields.Nested.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.OptionalFields.Nested} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.OptionalFields.Nested.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {number} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeInt32( + 1, + f + ); + } +}; + + +/** + * optional int32 an_int = 1; + * @return {number} + */ +proto.jspb.test.OptionalFields.Nested.prototype.getAnInt = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.OptionalFields.Nested} returns this + */ +proto.jspb.test.OptionalFields.Nested.prototype.setAnInt = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.OptionalFields.Nested} returns this + */ +proto.jspb.test.OptionalFields.Nested.prototype.clearAnInt = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.OptionalFields.Nested.prototype.hasAnInt = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional string a_string = 1; + * @return {string} + */ +proto.jspb.test.OptionalFields.prototype.getAString = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.OptionalFields} returns this + */ +proto.jspb.test.OptionalFields.prototype.setAString = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.OptionalFields} returns this + */ +proto.jspb.test.OptionalFields.prototype.clearAString = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.OptionalFields.prototype.hasAString = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * required bool a_bool = 2; + * @return {boolean} + */ +proto.jspb.test.OptionalFields.prototype.getABool = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.jspb.test.OptionalFields} returns this + */ +proto.jspb.test.OptionalFields.prototype.setABool = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.OptionalFields} returns this + */ +proto.jspb.test.OptionalFields.prototype.clearABool = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.OptionalFields.prototype.hasABool = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional Nested a_nested_message = 3; + * @return {?proto.jspb.test.OptionalFields.Nested} + */ +proto.jspb.test.OptionalFields.prototype.getANestedMessage = function() { + return /** @type{?proto.jspb.test.OptionalFields.Nested} */ ( + jspb.Message.getWrapperField(this, proto.jspb.test.OptionalFields.Nested, 3)); +}; + + +/** + * @param {?proto.jspb.test.OptionalFields.Nested|undefined} value + * @return {!proto.jspb.test.OptionalFields} returns this +*/ +proto.jspb.test.OptionalFields.prototype.setANestedMessage = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.jspb.test.OptionalFields} returns this + */ +proto.jspb.test.OptionalFields.prototype.clearANestedMessage = function() { + return this.setANestedMessage(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.OptionalFields.prototype.hasANestedMessage = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * repeated Nested a_repeated_message = 4; + * @return {!Array} + */ +proto.jspb.test.OptionalFields.prototype.getARepeatedMessageList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.jspb.test.OptionalFields.Nested, 4)); +}; + + +/** + * @param {!Array} value + * @return {!proto.jspb.test.OptionalFields} returns this +*/ +proto.jspb.test.OptionalFields.prototype.setARepeatedMessageList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 4, value); +}; + + +/** + * @param {!proto.jspb.test.OptionalFields.Nested=} opt_value + * @param {number=} opt_index + * @return {!proto.jspb.test.OptionalFields.Nested} + */ +proto.jspb.test.OptionalFields.prototype.addARepeatedMessage = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.jspb.test.OptionalFields.Nested, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.jspb.test.OptionalFields} returns this + */ +proto.jspb.test.OptionalFields.prototype.clearARepeatedMessageList = function() { + return this.setARepeatedMessageList([]); +}; + + +/** + * repeated string a_repeated_string = 5; + * @return {!Array} + */ +proto.jspb.test.OptionalFields.prototype.getARepeatedStringList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 5)); +}; + + +/** + * @param {!Array} value + * @return {!proto.jspb.test.OptionalFields} returns this + */ +proto.jspb.test.OptionalFields.prototype.setARepeatedStringList = function(value) { + return jspb.Message.setField(this, 5, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.jspb.test.OptionalFields} returns this + */ +proto.jspb.test.OptionalFields.prototype.addARepeatedString = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 5, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.jspb.test.OptionalFields} returns this + */ +proto.jspb.test.OptionalFields.prototype.clearARepeatedStringList = function() { + return this.setARepeatedStringList([]); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.HasExtensions.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.HasExtensions.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.HasExtensions} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.HasExtensions.toObject = function(includeInstance, msg) { + var f, obj = { +str1: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, +str2: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f, +str3: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f + }; + + jspb.Message.toObjectExtension(/** @type {!jspb.Message} */ (msg), obj, + proto.jspb.test.HasExtensions.extensions, proto.jspb.test.HasExtensions.prototype.getExtension, + includeInstance); + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.HasExtensions} + */ +proto.jspb.test.HasExtensions.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.HasExtensions; + return proto.jspb.test.HasExtensions.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.HasExtensions} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.HasExtensions} + */ +proto.jspb.test.HasExtensions.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setStr1(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setStr2(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setStr3(value); + break; + default: + jspb.Message.readBinaryExtension(msg, reader, + proto.jspb.test.HasExtensions.extensionsBinary, + proto.jspb.test.HasExtensions.prototype.getExtension, + proto.jspb.test.HasExtensions.prototype.setExtension); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.HasExtensions.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.HasExtensions.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.HasExtensions} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.HasExtensions.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeString( + 2, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 3)); + if (f != null) { + writer.writeString( + 3, + f + ); + } + jspb.Message.serializeBinaryExtensions(message, writer, + proto.jspb.test.HasExtensions.extensionsBinary, proto.jspb.test.HasExtensions.prototype.getExtension); +}; + + +/** + * optional string str1 = 1; + * @return {string} + */ +proto.jspb.test.HasExtensions.prototype.getStr1 = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.HasExtensions} returns this + */ +proto.jspb.test.HasExtensions.prototype.setStr1 = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.HasExtensions} returns this + */ +proto.jspb.test.HasExtensions.prototype.clearStr1 = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.HasExtensions.prototype.hasStr1 = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional string str2 = 2; + * @return {string} + */ +proto.jspb.test.HasExtensions.prototype.getStr2 = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.HasExtensions} returns this + */ +proto.jspb.test.HasExtensions.prototype.setStr2 = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.HasExtensions} returns this + */ +proto.jspb.test.HasExtensions.prototype.clearStr2 = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.HasExtensions.prototype.hasStr2 = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional string str3 = 3; + * @return {string} + */ +proto.jspb.test.HasExtensions.prototype.getStr3 = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.HasExtensions} returns this + */ +proto.jspb.test.HasExtensions.prototype.setStr3 = function(value) { + return jspb.Message.setField(this, 3, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.HasExtensions} returns this + */ +proto.jspb.test.HasExtensions.prototype.clearStr3 = function() { + return jspb.Message.setField(this, 3, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.HasExtensions.prototype.hasStr3 = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.jspb.test.Complex.repeatedFields_ = [5,7]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.Complex.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.Complex.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.Complex} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Complex.toObject = function(includeInstance, msg) { + var f, obj = { +aString: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, +anOutOfOrderBool: (f = jspb.Message.getBooleanField(msg, 9)) == null ? undefined : f, +aNestedMessage: (f = msg.getANestedMessage()) && proto.jspb.test.Complex.Nested.toObject(includeInstance, f), +aRepeatedMessageList: jspb.Message.toObjectList(msg.getARepeatedMessageList(), + proto.jspb.test.Complex.Nested.toObject, includeInstance), +aRepeatedStringList: (f = jspb.Message.getRepeatedField(msg, 7)) == null ? undefined : f, +aFloatingPointField: (f = jspb.Message.getOptionalFloatingPointField(msg, 10)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.Complex} + */ +proto.jspb.test.Complex.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.Complex; + return proto.jspb.test.Complex.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.Complex} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.Complex} + */ +proto.jspb.test.Complex.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setAString(value); + break; + case 9: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setAnOutOfOrderBool(value); + break; + case 4: + var value = new proto.jspb.test.Complex.Nested; + reader.readMessage(value,proto.jspb.test.Complex.Nested.deserializeBinaryFromReader); + msg.setANestedMessage(value); + break; + case 5: + var value = new proto.jspb.test.Complex.Nested; + reader.readMessage(value,proto.jspb.test.Complex.Nested.deserializeBinaryFromReader); + msg.addARepeatedMessage(value); + break; + case 7: + var value = /** @type {string} */ (reader.readString()); + msg.addARepeatedString(value); + break; + case 10: + var value = /** @type {number} */ (reader.readDouble()); + msg.setAFloatingPointField(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.Complex.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.Complex.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.Complex} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Complex.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } + f = /** @type {boolean} */ (jspb.Message.getField(message, 9)); + if (f != null) { + writer.writeBool( + 9, + f + ); + } + f = message.getANestedMessage(); + if (f != null) { + writer.writeMessage( + 4, + f, + proto.jspb.test.Complex.Nested.serializeBinaryToWriter + ); + } + f = message.getARepeatedMessageList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 5, + f, + proto.jspb.test.Complex.Nested.serializeBinaryToWriter + ); + } + f = message.getARepeatedStringList(); + if (f.length > 0) { + writer.writeRepeatedString( + 7, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 10)); + if (f != null) { + writer.writeDouble( + 10, + f + ); + } +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.Complex.Nested.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.Complex.Nested.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.Complex.Nested} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Complex.Nested.toObject = function(includeInstance, msg) { + var f, obj = { +anInt: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.Complex.Nested} + */ +proto.jspb.test.Complex.Nested.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.Complex.Nested; + return proto.jspb.test.Complex.Nested.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.Complex.Nested} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.Complex.Nested} + */ +proto.jspb.test.Complex.Nested.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 2: + var value = /** @type {number} */ (reader.readInt32()); + msg.setAnInt(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.Complex.Nested.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.Complex.Nested.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.Complex.Nested} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Complex.Nested.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {number} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeInt32( + 2, + f + ); + } +}; + + +/** + * required int32 an_int = 2; + * @return {number} + */ +proto.jspb.test.Complex.Nested.prototype.getAnInt = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.Complex.Nested} returns this + */ +proto.jspb.test.Complex.Nested.prototype.setAnInt = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.Complex.Nested} returns this + */ +proto.jspb.test.Complex.Nested.prototype.clearAnInt = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.Complex.Nested.prototype.hasAnInt = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * required string a_string = 1; + * @return {string} + */ +proto.jspb.test.Complex.prototype.getAString = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.Complex} returns this + */ +proto.jspb.test.Complex.prototype.setAString = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.Complex} returns this + */ +proto.jspb.test.Complex.prototype.clearAString = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.Complex.prototype.hasAString = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional bool an_out_of_order_bool = 9; + * @return {boolean} + */ +proto.jspb.test.Complex.prototype.getAnOutOfOrderBool = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 9, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.jspb.test.Complex} returns this + */ +proto.jspb.test.Complex.prototype.setAnOutOfOrderBool = function(value) { + return jspb.Message.setField(this, 9, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.Complex} returns this + */ +proto.jspb.test.Complex.prototype.clearAnOutOfOrderBool = function() { + return jspb.Message.setField(this, 9, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.Complex.prototype.hasAnOutOfOrderBool = function() { + return jspb.Message.getField(this, 9) != null; +}; + + +/** + * optional Nested a_nested_message = 4; + * @return {?proto.jspb.test.Complex.Nested} + */ +proto.jspb.test.Complex.prototype.getANestedMessage = function() { + return /** @type{?proto.jspb.test.Complex.Nested} */ ( + jspb.Message.getWrapperField(this, proto.jspb.test.Complex.Nested, 4)); +}; + + +/** + * @param {?proto.jspb.test.Complex.Nested|undefined} value + * @return {!proto.jspb.test.Complex} returns this +*/ +proto.jspb.test.Complex.prototype.setANestedMessage = function(value) { + return jspb.Message.setWrapperField(this, 4, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.jspb.test.Complex} returns this + */ +proto.jspb.test.Complex.prototype.clearANestedMessage = function() { + return this.setANestedMessage(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.Complex.prototype.hasANestedMessage = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * repeated Nested a_repeated_message = 5; + * @return {!Array} + */ +proto.jspb.test.Complex.prototype.getARepeatedMessageList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.jspb.test.Complex.Nested, 5)); +}; + + +/** + * @param {!Array} value + * @return {!proto.jspb.test.Complex} returns this +*/ +proto.jspb.test.Complex.prototype.setARepeatedMessageList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 5, value); +}; + + +/** + * @param {!proto.jspb.test.Complex.Nested=} opt_value + * @param {number=} opt_index + * @return {!proto.jspb.test.Complex.Nested} + */ +proto.jspb.test.Complex.prototype.addARepeatedMessage = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, proto.jspb.test.Complex.Nested, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.jspb.test.Complex} returns this + */ +proto.jspb.test.Complex.prototype.clearARepeatedMessageList = function() { + return this.setARepeatedMessageList([]); +}; + + +/** + * repeated string a_repeated_string = 7; + * @return {!Array} + */ +proto.jspb.test.Complex.prototype.getARepeatedStringList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 7)); +}; + + +/** + * @param {!Array} value + * @return {!proto.jspb.test.Complex} returns this + */ +proto.jspb.test.Complex.prototype.setARepeatedStringList = function(value) { + return jspb.Message.setField(this, 7, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.jspb.test.Complex} returns this + */ +proto.jspb.test.Complex.prototype.addARepeatedString = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 7, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.jspb.test.Complex} returns this + */ +proto.jspb.test.Complex.prototype.clearARepeatedStringList = function() { + return this.setARepeatedStringList([]); +}; + + +/** + * optional double a_floating_point_field = 10; + * @return {number} + */ +proto.jspb.test.Complex.prototype.getAFloatingPointField = function() { + return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 10, 0.0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.Complex} returns this + */ +proto.jspb.test.Complex.prototype.setAFloatingPointField = function(value) { + return jspb.Message.setField(this, 10, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.Complex} returns this + */ +proto.jspb.test.Complex.prototype.clearAFloatingPointField = function() { + return jspb.Message.setField(this, 10, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.Complex.prototype.hasAFloatingPointField = function() { + return jspb.Message.getField(this, 10) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.OuterMessage.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.OuterMessage.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.OuterMessage} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.OuterMessage.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.OuterMessage} + */ +proto.jspb.test.OuterMessage.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.OuterMessage; + return proto.jspb.test.OuterMessage.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.OuterMessage} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.OuterMessage} + */ +proto.jspb.test.OuterMessage.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.OuterMessage.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.OuterMessage.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.OuterMessage} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.OuterMessage.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.OuterMessage.Complex.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.OuterMessage.Complex.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.OuterMessage.Complex} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.OuterMessage.Complex.toObject = function(includeInstance, msg) { + var f, obj = { +innerComplexField: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.OuterMessage.Complex} + */ +proto.jspb.test.OuterMessage.Complex.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.OuterMessage.Complex; + return proto.jspb.test.OuterMessage.Complex.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.OuterMessage.Complex} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.OuterMessage.Complex} + */ +proto.jspb.test.OuterMessage.Complex.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt32()); + msg.setInnerComplexField(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.OuterMessage.Complex.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.OuterMessage.Complex.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.OuterMessage.Complex} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.OuterMessage.Complex.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {number} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeInt32( + 1, + f + ); + } +}; + + +/** + * optional int32 inner_complex_field = 1; + * @return {number} + */ +proto.jspb.test.OuterMessage.Complex.prototype.getInnerComplexField = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.OuterMessage.Complex} returns this + */ +proto.jspb.test.OuterMessage.Complex.prototype.setInnerComplexField = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.OuterMessage.Complex} returns this + */ +proto.jspb.test.OuterMessage.Complex.prototype.clearInnerComplexField = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.OuterMessage.Complex.prototype.hasInnerComplexField = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.MineField.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.MineField.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.MineField} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.MineField.toObject = function(includeInstance, msg) { + var f, obj = { +cookie: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.MineField} + */ +proto.jspb.test.MineField.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.MineField; + return proto.jspb.test.MineField.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.MineField} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.MineField} + */ +proto.jspb.test.MineField.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setCookie(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.MineField.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.MineField.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.MineField} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.MineField.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string cookie = 1; + * @return {string} + */ +proto.jspb.test.MineField.prototype.getCookie = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.MineField} returns this + */ +proto.jspb.test.MineField.prototype.setCookie = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.MineField} returns this + */ +proto.jspb.test.MineField.prototype.clearCookie = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.MineField.prototype.hasCookie = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.IsExtension.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.IsExtension.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.IsExtension} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.IsExtension.toObject = function(includeInstance, msg) { + var f, obj = { +ext1: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.IsExtension} + */ +proto.jspb.test.IsExtension.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.IsExtension; + return proto.jspb.test.IsExtension.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.IsExtension} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.IsExtension} + */ +proto.jspb.test.IsExtension.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setExt1(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.IsExtension.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.IsExtension.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.IsExtension} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.IsExtension.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } +}; + + + +/** + * A tuple of {field number, class constructor} for the extension + * field named `extField`. + * @type {!jspb.ExtensionFieldInfo} + */ +proto.jspb.test.IsExtension.extField = new jspb.ExtensionFieldInfo( + 100, + {extField: 0}, + proto.jspb.test.IsExtension, + /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( + proto.jspb.test.IsExtension.toObject), + 0); + +proto.jspb.test.HasExtensions.extensionsBinary[100] = new jspb.ExtensionFieldBinaryInfo( + proto.jspb.test.IsExtension.extField, + jspb.BinaryReader.prototype.readMessage, + jspb.BinaryWriter.prototype.writeMessage, + proto.jspb.test.IsExtension.serializeBinaryToWriter, + proto.jspb.test.IsExtension.deserializeBinaryFromReader, + false); +// This registers the extension field with the extended class, so that +// toObject() will function correctly. +proto.jspb.test.HasExtensions.extensions[100] = proto.jspb.test.IsExtension.extField; + +/** + * optional string ext1 = 1; + * @return {string} + */ +proto.jspb.test.IsExtension.prototype.getExt1 = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.IsExtension} returns this + */ +proto.jspb.test.IsExtension.prototype.setExt1 = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.IsExtension} returns this + */ +proto.jspb.test.IsExtension.prototype.clearExt1 = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.IsExtension.prototype.hasExt1 = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + +/** + * A tuple of {field number, class constructor} for the extension + * field named `extField`. + * @type {!jspb.ExtensionFieldInfo} + */ +proto.jspb.test.IsExtension.extField = new jspb.ExtensionFieldInfo( + 100, + {extField: 0}, + proto.jspb.test.IsExtension, + /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( + proto.jspb.test.IsExtension.toObject), + 0); + +proto.jspb.test.HasExtensions.extensionsBinary[100] = new jspb.ExtensionFieldBinaryInfo( + proto.jspb.test.IsExtension.extField, + jspb.BinaryReader.prototype.readMessage, + jspb.BinaryWriter.prototype.writeMessage, + proto.jspb.test.IsExtension.serializeBinaryToWriter, + proto.jspb.test.IsExtension.deserializeBinaryFromReader, + false); +// This registers the extension field with the extended class, so that +// toObject() will function correctly. +proto.jspb.test.HasExtensions.extensions[100] = proto.jspb.test.IsExtension.extField; + + +/** + * A tuple of {field number, class constructor} for the extension + * field named `simpleOption`. + * @type {!jspb.ExtensionFieldInfo} + */ +proto.jspb.test.IsExtension.simpleOption = new jspb.ExtensionFieldInfo( + 42113038, + {simpleOption: 0}, + null, + /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( + null), + 0); + +google_protobuf_descriptor_pb.EnumOptions.extensionsBinary[42113038] = new jspb.ExtensionFieldBinaryInfo( + proto.jspb.test.IsExtension.simpleOption, + jspb.BinaryReader.prototype.readString, + jspb.BinaryWriter.prototype.writeString, + undefined, + undefined, + false); +// This registers the extension field with the extended class, so that +// toObject() will function correctly. +google_protobuf_descriptor_pb.EnumOptions.extensions[42113038] = proto.jspb.test.IsExtension.simpleOption; + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.IndirectExtension.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.IndirectExtension.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.IndirectExtension} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.IndirectExtension.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.IndirectExtension} + */ +proto.jspb.test.IndirectExtension.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.IndirectExtension; + return proto.jspb.test.IndirectExtension.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.IndirectExtension} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.IndirectExtension} + */ +proto.jspb.test.IndirectExtension.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.IndirectExtension.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.IndirectExtension.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.IndirectExtension} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.IndirectExtension.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + +/** + * A tuple of {field number, class constructor} for the extension + * field named `simple`. + * @type {!jspb.ExtensionFieldInfo} + */ +proto.jspb.test.IndirectExtension.simple = new jspb.ExtensionFieldInfo( + 101, + {simple: 0}, + proto.jspb.test.Simple1, + /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( + proto.jspb.test.Simple1.toObject), + 0); + +proto.jspb.test.HasExtensions.extensionsBinary[101] = new jspb.ExtensionFieldBinaryInfo( + proto.jspb.test.IndirectExtension.simple, + jspb.BinaryReader.prototype.readMessage, + jspb.BinaryWriter.prototype.writeMessage, + proto.jspb.test.Simple1.serializeBinaryToWriter, + proto.jspb.test.Simple1.deserializeBinaryFromReader, + false); +// This registers the extension field with the extended class, so that +// toObject() will function correctly. +proto.jspb.test.HasExtensions.extensions[101] = proto.jspb.test.IndirectExtension.simple; + + +/** + * A tuple of {field number, class constructor} for the extension + * field named `str`. + * @type {!jspb.ExtensionFieldInfo} + */ +proto.jspb.test.IndirectExtension.str = new jspb.ExtensionFieldInfo( + 102, + {str: 0}, + null, + /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( + null), + 0); + +proto.jspb.test.HasExtensions.extensionsBinary[102] = new jspb.ExtensionFieldBinaryInfo( + proto.jspb.test.IndirectExtension.str, + jspb.BinaryReader.prototype.readString, + jspb.BinaryWriter.prototype.writeString, + undefined, + undefined, + false); +// This registers the extension field with the extended class, so that +// toObject() will function correctly. +proto.jspb.test.HasExtensions.extensions[102] = proto.jspb.test.IndirectExtension.str; + + +/** + * A tuple of {field number, class constructor} for the extension + * field named `repeatedStrList`. + * @type {!jspb.ExtensionFieldInfo>} + */ +proto.jspb.test.IndirectExtension.repeatedStrList = new jspb.ExtensionFieldInfo( + 103, + {repeatedStrList: 0}, + null, + /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( + null), + 1); + +proto.jspb.test.HasExtensions.extensionsBinary[103] = new jspb.ExtensionFieldBinaryInfo( + proto.jspb.test.IndirectExtension.repeatedStrList, + jspb.BinaryReader.prototype.readString, + jspb.BinaryWriter.prototype.writeRepeatedString, + undefined, + undefined, + false); +// This registers the extension field with the extended class, so that +// toObject() will function correctly. +proto.jspb.test.HasExtensions.extensions[103] = proto.jspb.test.IndirectExtension.repeatedStrList; + + +/** + * A tuple of {field number, class constructor} for the extension + * field named `repeatedSimpleList`. + * @type {!jspb.ExtensionFieldInfo>} + */ +proto.jspb.test.IndirectExtension.repeatedSimpleList = new jspb.ExtensionFieldInfo( + 104, + {repeatedSimpleList: 0}, + proto.jspb.test.Simple1, + /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( + proto.jspb.test.Simple1.toObject), + 1); + +proto.jspb.test.HasExtensions.extensionsBinary[104] = new jspb.ExtensionFieldBinaryInfo( + proto.jspb.test.IndirectExtension.repeatedSimpleList, + jspb.BinaryReader.prototype.readMessage, + jspb.BinaryWriter.prototype.writeRepeatedMessage, + proto.jspb.test.Simple1.serializeBinaryToWriter, + proto.jspb.test.Simple1.deserializeBinaryFromReader, + false); +// This registers the extension field with the extended class, so that +// toObject() will function correctly. +proto.jspb.test.HasExtensions.extensions[104] = proto.jspb.test.IndirectExtension.repeatedSimpleList; + + +/** + * A tuple of {field number, class constructor} for the extension + * field named `simple`. + * @type {!jspb.ExtensionFieldInfo} + */ +proto.jspb.test.IndirectExtension.simple = new jspb.ExtensionFieldInfo( + 101, + {simple: 0}, + proto.jspb.test.Simple1, + /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( + proto.jspb.test.Simple1.toObject), + 0); + +proto.jspb.test.HasExtensions.extensionsBinary[101] = new jspb.ExtensionFieldBinaryInfo( + proto.jspb.test.IndirectExtension.simple, + jspb.BinaryReader.prototype.readMessage, + jspb.BinaryWriter.prototype.writeMessage, + proto.jspb.test.Simple1.serializeBinaryToWriter, + proto.jspb.test.Simple1.deserializeBinaryFromReader, + false); +// This registers the extension field with the extended class, so that +// toObject() will function correctly. +proto.jspb.test.HasExtensions.extensions[101] = proto.jspb.test.IndirectExtension.simple; + + +/** + * A tuple of {field number, class constructor} for the extension + * field named `str`. + * @type {!jspb.ExtensionFieldInfo} + */ +proto.jspb.test.IndirectExtension.str = new jspb.ExtensionFieldInfo( + 102, + {str: 0}, + null, + /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( + null), + 0); + +proto.jspb.test.HasExtensions.extensionsBinary[102] = new jspb.ExtensionFieldBinaryInfo( + proto.jspb.test.IndirectExtension.str, + jspb.BinaryReader.prototype.readString, + jspb.BinaryWriter.prototype.writeString, + undefined, + undefined, + false); +// This registers the extension field with the extended class, so that +// toObject() will function correctly. +proto.jspb.test.HasExtensions.extensions[102] = proto.jspb.test.IndirectExtension.str; + + +/** + * A tuple of {field number, class constructor} for the extension + * field named `repeatedStrList`. + * @type {!jspb.ExtensionFieldInfo>} + */ +proto.jspb.test.IndirectExtension.repeatedStrList = new jspb.ExtensionFieldInfo( + 103, + {repeatedStrList: 0}, + null, + /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( + null), + 1); + +proto.jspb.test.HasExtensions.extensionsBinary[103] = new jspb.ExtensionFieldBinaryInfo( + proto.jspb.test.IndirectExtension.repeatedStrList, + jspb.BinaryReader.prototype.readString, + jspb.BinaryWriter.prototype.writeRepeatedString, + undefined, + undefined, + false); +// This registers the extension field with the extended class, so that +// toObject() will function correctly. +proto.jspb.test.HasExtensions.extensions[103] = proto.jspb.test.IndirectExtension.repeatedStrList; + + +/** + * A tuple of {field number, class constructor} for the extension + * field named `repeatedSimpleList`. + * @type {!jspb.ExtensionFieldInfo>} + */ +proto.jspb.test.IndirectExtension.repeatedSimpleList = new jspb.ExtensionFieldInfo( + 104, + {repeatedSimpleList: 0}, + proto.jspb.test.Simple1, + /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( + proto.jspb.test.Simple1.toObject), + 1); + +proto.jspb.test.HasExtensions.extensionsBinary[104] = new jspb.ExtensionFieldBinaryInfo( + proto.jspb.test.IndirectExtension.repeatedSimpleList, + jspb.BinaryReader.prototype.readMessage, + jspb.BinaryWriter.prototype.writeRepeatedMessage, + proto.jspb.test.Simple1.serializeBinaryToWriter, + proto.jspb.test.Simple1.deserializeBinaryFromReader, + false); +// This registers the extension field with the extended class, so that +// toObject() will function correctly. +proto.jspb.test.HasExtensions.extensions[104] = proto.jspb.test.IndirectExtension.repeatedSimpleList; + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.DefaultValues.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.DefaultValues.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.DefaultValues} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.DefaultValues.toObject = function(includeInstance, msg) { + var f, obj = { +stringField: jspb.Message.getFieldWithDefault(msg, 1, "default\x3c\x3e\x27\x22abc"), +boolField: jspb.Message.getBooleanFieldWithDefault(msg, 2, true), +intField: jspb.Message.getFieldWithDefault(msg, 3, 11), +enumField: jspb.Message.getFieldWithDefault(msg, 4, 13), +emptyField: jspb.Message.getFieldWithDefault(msg, 6, ""), +bytesField: msg.getBytesField_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.DefaultValues} + */ +proto.jspb.test.DefaultValues.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.DefaultValues; + return proto.jspb.test.DefaultValues.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.DefaultValues} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.DefaultValues} + */ +proto.jspb.test.DefaultValues.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setStringField(value); + break; + case 2: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setBoolField(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt64()); + msg.setIntField(value); + break; + case 4: + var value = /** @type {!proto.jspb.test.DefaultValues.Enum} */ (reader.readEnum()); + msg.setEnumField(value); + break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.setEmptyField(value); + break; + case 8: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setBytesField(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.DefaultValues.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.DefaultValues.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.DefaultValues} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.DefaultValues.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } + f = /** @type {boolean} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeBool( + 2, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 3)); + if (f != null) { + writer.writeInt64( + 3, + f + ); + } + f = /** @type {!proto.jspb.test.DefaultValues.Enum} */ (jspb.Message.getField(message, 4)); + if (f != null) { + writer.writeEnum( + 4, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 6)); + if (f != null) { + writer.writeString( + 6, + f + ); + } + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 8)); + if (f != null) { + writer.writeBytes( + 8, + f + ); + } +}; + + +/** + * @enum {number} + */ +proto.jspb.test.DefaultValues.Enum = { + E1: 13, + E2: 77 +}; + +/** + * optional string string_field = 1; + * @return {string} + */ +proto.jspb.test.DefaultValues.prototype.getStringField = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "default\x3c\x3e\x27\x22abc")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.DefaultValues} returns this + */ +proto.jspb.test.DefaultValues.prototype.setStringField = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.DefaultValues} returns this + */ +proto.jspb.test.DefaultValues.prototype.clearStringField = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.DefaultValues.prototype.hasStringField = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional bool bool_field = 2; + * @return {boolean} + */ +proto.jspb.test.DefaultValues.prototype.getBoolField = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, true)); +}; + + +/** + * @param {boolean} value + * @return {!proto.jspb.test.DefaultValues} returns this + */ +proto.jspb.test.DefaultValues.prototype.setBoolField = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.DefaultValues} returns this + */ +proto.jspb.test.DefaultValues.prototype.clearBoolField = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.DefaultValues.prototype.hasBoolField = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional int64 int_field = 3; + * @return {number} + */ +proto.jspb.test.DefaultValues.prototype.getIntField = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 11)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.DefaultValues} returns this + */ +proto.jspb.test.DefaultValues.prototype.setIntField = function(value) { + return jspb.Message.setField(this, 3, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.DefaultValues} returns this + */ +proto.jspb.test.DefaultValues.prototype.clearIntField = function() { + return jspb.Message.setField(this, 3, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.DefaultValues.prototype.hasIntField = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional Enum enum_field = 4; + * @return {!proto.jspb.test.DefaultValues.Enum} + */ +proto.jspb.test.DefaultValues.prototype.getEnumField = function() { + return /** @type {!proto.jspb.test.DefaultValues.Enum} */ (jspb.Message.getFieldWithDefault(this, 4, 13)); +}; + + +/** + * @param {!proto.jspb.test.DefaultValues.Enum} value + * @return {!proto.jspb.test.DefaultValues} returns this + */ +proto.jspb.test.DefaultValues.prototype.setEnumField = function(value) { + return jspb.Message.setField(this, 4, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.DefaultValues} returns this + */ +proto.jspb.test.DefaultValues.prototype.clearEnumField = function() { + return jspb.Message.setField(this, 4, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.DefaultValues.prototype.hasEnumField = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * optional string empty_field = 6; + * @return {string} + */ +proto.jspb.test.DefaultValues.prototype.getEmptyField = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.DefaultValues} returns this + */ +proto.jspb.test.DefaultValues.prototype.setEmptyField = function(value) { + return jspb.Message.setField(this, 6, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.DefaultValues} returns this + */ +proto.jspb.test.DefaultValues.prototype.clearEmptyField = function() { + return jspb.Message.setField(this, 6, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.DefaultValues.prototype.hasEmptyField = function() { + return jspb.Message.getField(this, 6) != null; +}; + + +/** + * optional bytes bytes_field = 8; + * @return {!(string|Uint8Array)} + */ +proto.jspb.test.DefaultValues.prototype.getBytesField = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 8, "bW9v")); +}; + + +/** + * optional bytes bytes_field = 8; + * This is a type-conversion wrapper around `getBytesField()` + * @return {string} + */ +proto.jspb.test.DefaultValues.prototype.getBytesField_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getBytesField())); +}; + + +/** + * optional bytes bytes_field = 8; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getBytesField()` + * @return {!Uint8Array} + */ +proto.jspb.test.DefaultValues.prototype.getBytesField_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getBytesField())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.jspb.test.DefaultValues} returns this + */ +proto.jspb.test.DefaultValues.prototype.setBytesField = function(value) { + return jspb.Message.setField(this, 8, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.DefaultValues} returns this + */ +proto.jspb.test.DefaultValues.prototype.clearBytesField = function() { + return jspb.Message.setField(this, 8, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.DefaultValues.prototype.hasBytesField = function() { + return jspb.Message.getField(this, 8) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.jspb.test.FloatingPointFields.repeatedFields_ = [3,7]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.FloatingPointFields.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.FloatingPointFields.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.FloatingPointFields} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.FloatingPointFields.toObject = function(includeInstance, msg) { + var f, obj = { +optionalFloatField: (f = jspb.Message.getOptionalFloatingPointField(msg, 1)) == null ? undefined : f, +requiredFloatField: (f = jspb.Message.getOptionalFloatingPointField(msg, 2)) == null ? undefined : f, +repeatedFloatFieldList: (f = jspb.Message.getRepeatedFloatingPointField(msg, 3)) == null ? undefined : f, +defaultFloatField: jspb.Message.getFloatingPointFieldWithDefault(msg, 4, 2.0), +optionalDoubleField: (f = jspb.Message.getOptionalFloatingPointField(msg, 5)) == null ? undefined : f, +requiredDoubleField: (f = jspb.Message.getOptionalFloatingPointField(msg, 6)) == null ? undefined : f, +repeatedDoubleFieldList: (f = jspb.Message.getRepeatedFloatingPointField(msg, 7)) == null ? undefined : f, +defaultDoubleField: jspb.Message.getFloatingPointFieldWithDefault(msg, 8, 2.0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.FloatingPointFields} + */ +proto.jspb.test.FloatingPointFields.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.FloatingPointFields; + return proto.jspb.test.FloatingPointFields.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.FloatingPointFields} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.FloatingPointFields} + */ +proto.jspb.test.FloatingPointFields.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readFloat()); + msg.setOptionalFloatField(value); + break; + case 2: + var value = /** @type {number} */ (reader.readFloat()); + msg.setRequiredFloatField(value); + break; + case 3: + var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readFloat() : [reader.readFloat()]); + for (var i = 0; i < values.length; i++) { + msg.addRepeatedFloatField(values[i]); + } + break; + case 4: + var value = /** @type {number} */ (reader.readFloat()); + msg.setDefaultFloatField(value); + break; + case 5: + var value = /** @type {number} */ (reader.readDouble()); + msg.setOptionalDoubleField(value); + break; + case 6: + var value = /** @type {number} */ (reader.readDouble()); + msg.setRequiredDoubleField(value); + break; + case 7: + var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readDouble() : [reader.readDouble()]); + for (var i = 0; i < values.length; i++) { + msg.addRepeatedDoubleField(values[i]); + } + break; + case 8: + var value = /** @type {number} */ (reader.readDouble()); + msg.setDefaultDoubleField(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.FloatingPointFields.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.FloatingPointFields.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.FloatingPointFields} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.FloatingPointFields.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {number} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeFloat( + 1, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeFloat( + 2, + f + ); + } + f = message.getRepeatedFloatFieldList(); + if (f.length > 0) { + writer.writeRepeatedFloat( + 3, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 4)); + if (f != null) { + writer.writeFloat( + 4, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 5)); + if (f != null) { + writer.writeDouble( + 5, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 6)); + if (f != null) { + writer.writeDouble( + 6, + f + ); + } + f = message.getRepeatedDoubleFieldList(); + if (f.length > 0) { + writer.writeRepeatedDouble( + 7, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 8)); + if (f != null) { + writer.writeDouble( + 8, + f + ); + } +}; + + +/** + * optional float optional_float_field = 1; + * @return {number} + */ +proto.jspb.test.FloatingPointFields.prototype.getOptionalFloatField = function() { + return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 1, 0.0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.setOptionalFloatField = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.clearOptionalFloatField = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.FloatingPointFields.prototype.hasOptionalFloatField = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * required float required_float_field = 2; + * @return {number} + */ +proto.jspb.test.FloatingPointFields.prototype.getRequiredFloatField = function() { + return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 2, 0.0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.setRequiredFloatField = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.clearRequiredFloatField = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.FloatingPointFields.prototype.hasRequiredFloatField = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * repeated float repeated_float_field = 3; + * @return {!Array} + */ +proto.jspb.test.FloatingPointFields.prototype.getRepeatedFloatFieldList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedFloatingPointField(this, 3)); +}; + + +/** + * @param {!Array} value + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.setRepeatedFloatFieldList = function(value) { + return jspb.Message.setField(this, 3, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.addRepeatedFloatField = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 3, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.clearRepeatedFloatFieldList = function() { + return this.setRepeatedFloatFieldList([]); +}; + + +/** + * optional float default_float_field = 4; + * @return {number} + */ +proto.jspb.test.FloatingPointFields.prototype.getDefaultFloatField = function() { + return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 4, 2.0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.setDefaultFloatField = function(value) { + return jspb.Message.setField(this, 4, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.clearDefaultFloatField = function() { + return jspb.Message.setField(this, 4, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.FloatingPointFields.prototype.hasDefaultFloatField = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * optional double optional_double_field = 5; + * @return {number} + */ +proto.jspb.test.FloatingPointFields.prototype.getOptionalDoubleField = function() { + return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 5, 0.0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.setOptionalDoubleField = function(value) { + return jspb.Message.setField(this, 5, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.clearOptionalDoubleField = function() { + return jspb.Message.setField(this, 5, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.FloatingPointFields.prototype.hasOptionalDoubleField = function() { + return jspb.Message.getField(this, 5) != null; +}; + + +/** + * required double required_double_field = 6; + * @return {number} + */ +proto.jspb.test.FloatingPointFields.prototype.getRequiredDoubleField = function() { + return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 6, 0.0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.setRequiredDoubleField = function(value) { + return jspb.Message.setField(this, 6, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.clearRequiredDoubleField = function() { + return jspb.Message.setField(this, 6, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.FloatingPointFields.prototype.hasRequiredDoubleField = function() { + return jspb.Message.getField(this, 6) != null; +}; + + +/** + * repeated double repeated_double_field = 7; + * @return {!Array} + */ +proto.jspb.test.FloatingPointFields.prototype.getRepeatedDoubleFieldList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedFloatingPointField(this, 7)); +}; + + +/** + * @param {!Array} value + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.setRepeatedDoubleFieldList = function(value) { + return jspb.Message.setField(this, 7, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.addRepeatedDoubleField = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 7, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.clearRepeatedDoubleFieldList = function() { + return this.setRepeatedDoubleFieldList([]); +}; + + +/** + * optional double default_double_field = 8; + * @return {number} + */ +proto.jspb.test.FloatingPointFields.prototype.getDefaultDoubleField = function() { + return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 8, 2.0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.setDefaultDoubleField = function(value) { + return jspb.Message.setField(this, 8, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.clearDefaultDoubleField = function() { + return jspb.Message.setField(this, 8, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.FloatingPointFields.prototype.hasDefaultDoubleField = function() { + return jspb.Message.getField(this, 8) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.jspb.test.BooleanFields.repeatedFields_ = [3]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.BooleanFields.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.BooleanFields.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.BooleanFields} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.BooleanFields.toObject = function(includeInstance, msg) { + var f, obj = { +optionalBooleanField: (f = jspb.Message.getBooleanField(msg, 1)) == null ? undefined : f, +requiredBooleanField: (f = jspb.Message.getBooleanField(msg, 2)) == null ? undefined : f, +repeatedBooleanFieldList: (f = jspb.Message.getRepeatedBooleanField(msg, 3)) == null ? undefined : f, +defaultBooleanField: jspb.Message.getBooleanFieldWithDefault(msg, 4, true) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.BooleanFields} + */ +proto.jspb.test.BooleanFields.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.BooleanFields; + return proto.jspb.test.BooleanFields.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.BooleanFields} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.BooleanFields} + */ +proto.jspb.test.BooleanFields.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setOptionalBooleanField(value); + break; + case 2: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setRequiredBooleanField(value); + break; + case 3: + var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readBool() : [reader.readBool()]); + for (var i = 0; i < values.length; i++) { + msg.addRepeatedBooleanField(values[i]); + } + break; + case 4: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setDefaultBooleanField(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.BooleanFields.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.BooleanFields.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.BooleanFields} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.BooleanFields.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {boolean} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeBool( + 1, + f + ); + } + f = /** @type {boolean} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeBool( + 2, + f + ); + } + f = message.getRepeatedBooleanFieldList(); + if (f.length > 0) { + writer.writeRepeatedBool( + 3, + f + ); + } + f = /** @type {boolean} */ (jspb.Message.getField(message, 4)); + if (f != null) { + writer.writeBool( + 4, + f + ); + } +}; + + +/** + * optional bool optional_boolean_field = 1; + * @return {boolean} + */ +proto.jspb.test.BooleanFields.prototype.getOptionalBooleanField = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.jspb.test.BooleanFields} returns this + */ +proto.jspb.test.BooleanFields.prototype.setOptionalBooleanField = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.BooleanFields} returns this + */ +proto.jspb.test.BooleanFields.prototype.clearOptionalBooleanField = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.BooleanFields.prototype.hasOptionalBooleanField = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * required bool required_boolean_field = 2; + * @return {boolean} + */ +proto.jspb.test.BooleanFields.prototype.getRequiredBooleanField = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.jspb.test.BooleanFields} returns this + */ +proto.jspb.test.BooleanFields.prototype.setRequiredBooleanField = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.BooleanFields} returns this + */ +proto.jspb.test.BooleanFields.prototype.clearRequiredBooleanField = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.BooleanFields.prototype.hasRequiredBooleanField = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * repeated bool repeated_boolean_field = 3; + * @return {!Array} + */ +proto.jspb.test.BooleanFields.prototype.getRepeatedBooleanFieldList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedBooleanField(this, 3)); +}; + + +/** + * @param {!Array} value + * @return {!proto.jspb.test.BooleanFields} returns this + */ +proto.jspb.test.BooleanFields.prototype.setRepeatedBooleanFieldList = function(value) { + return jspb.Message.setField(this, 3, value || []); +}; + + +/** + * @param {boolean} value + * @param {number=} opt_index + * @return {!proto.jspb.test.BooleanFields} returns this + */ +proto.jspb.test.BooleanFields.prototype.addRepeatedBooleanField = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 3, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.jspb.test.BooleanFields} returns this + */ +proto.jspb.test.BooleanFields.prototype.clearRepeatedBooleanFieldList = function() { + return this.setRepeatedBooleanFieldList([]); +}; + + +/** + * optional bool default_boolean_field = 4; + * @return {boolean} + */ +proto.jspb.test.BooleanFields.prototype.getDefaultBooleanField = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, true)); +}; + + +/** + * @param {boolean} value + * @return {!proto.jspb.test.BooleanFields} returns this + */ +proto.jspb.test.BooleanFields.prototype.setDefaultBooleanField = function(value) { + return jspb.Message.setField(this, 4, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.BooleanFields} returns this + */ +proto.jspb.test.BooleanFields.prototype.clearDefaultBooleanField = function() { + return jspb.Message.setField(this, 4, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.BooleanFields.prototype.hasDefaultBooleanField = function() { + return jspb.Message.getField(this, 4) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.jspb.test.TestClone.repeatedFields_ = [5]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.TestClone.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.TestClone.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.TestClone} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestClone.toObject = function(includeInstance, msg) { + var f, obj = { +str: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, +simple1: (f = msg.getSimple1()) && proto.jspb.test.Simple1.toObject(includeInstance, f), +simple2List: jspb.Message.toObjectList(msg.getSimple2List(), + proto.jspb.test.Simple1.toObject, includeInstance), +bytesField: msg.getBytesField_asB64(), +unused: (f = jspb.Message.getField(msg, 7)) == null ? undefined : f + }; + + jspb.Message.toObjectExtension(/** @type {!jspb.Message} */ (msg), obj, + proto.jspb.test.TestClone.extensions, proto.jspb.test.TestClone.prototype.getExtension, + includeInstance); + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.TestClone} + */ +proto.jspb.test.TestClone.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.TestClone; + return proto.jspb.test.TestClone.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.TestClone} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.TestClone} + */ +proto.jspb.test.TestClone.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setStr(value); + break; + case 3: + var value = new proto.jspb.test.Simple1; + reader.readMessage(value,proto.jspb.test.Simple1.deserializeBinaryFromReader); + msg.setSimple1(value); + break; + case 5: + var value = new proto.jspb.test.Simple1; + reader.readMessage(value,proto.jspb.test.Simple1.deserializeBinaryFromReader); + msg.addSimple2(value); + break; + case 6: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setBytesField(value); + break; + case 7: + var value = /** @type {string} */ (reader.readString()); + msg.setUnused(value); + break; + default: + jspb.Message.readBinaryExtension(msg, reader, + proto.jspb.test.TestClone.extensionsBinary, + proto.jspb.test.TestClone.prototype.getExtension, + proto.jspb.test.TestClone.prototype.setExtension); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.TestClone.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.TestClone.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.TestClone} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestClone.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } + f = message.getSimple1(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.jspb.test.Simple1.serializeBinaryToWriter + ); + } + f = message.getSimple2List(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 5, + f, + proto.jspb.test.Simple1.serializeBinaryToWriter + ); + } + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 6)); + if (f != null) { + writer.writeBytes( + 6, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 7)); + if (f != null) { + writer.writeString( + 7, + f + ); + } + jspb.Message.serializeBinaryExtensions(message, writer, + proto.jspb.test.TestClone.extensionsBinary, proto.jspb.test.TestClone.prototype.getExtension); +}; + + +/** + * optional string str = 1; + * @return {string} + */ +proto.jspb.test.TestClone.prototype.getStr = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.TestClone} returns this + */ +proto.jspb.test.TestClone.prototype.setStr = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestClone} returns this + */ +proto.jspb.test.TestClone.prototype.clearStr = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestClone.prototype.hasStr = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional Simple1 simple1 = 3; + * @return {?proto.jspb.test.Simple1} + */ +proto.jspb.test.TestClone.prototype.getSimple1 = function() { + return /** @type{?proto.jspb.test.Simple1} */ ( + jspb.Message.getWrapperField(this, proto.jspb.test.Simple1, 3)); +}; + + +/** + * @param {?proto.jspb.test.Simple1|undefined} value + * @return {!proto.jspb.test.TestClone} returns this +*/ +proto.jspb.test.TestClone.prototype.setSimple1 = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.jspb.test.TestClone} returns this + */ +proto.jspb.test.TestClone.prototype.clearSimple1 = function() { + return this.setSimple1(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestClone.prototype.hasSimple1 = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * repeated Simple1 simple2 = 5; + * @return {!Array} + */ +proto.jspb.test.TestClone.prototype.getSimple2List = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.jspb.test.Simple1, 5)); +}; + + +/** + * @param {!Array} value + * @return {!proto.jspb.test.TestClone} returns this +*/ +proto.jspb.test.TestClone.prototype.setSimple2List = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 5, value); +}; + + +/** + * @param {!proto.jspb.test.Simple1=} opt_value + * @param {number=} opt_index + * @return {!proto.jspb.test.Simple1} + */ +proto.jspb.test.TestClone.prototype.addSimple2 = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, proto.jspb.test.Simple1, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.jspb.test.TestClone} returns this + */ +proto.jspb.test.TestClone.prototype.clearSimple2List = function() { + return this.setSimple2List([]); +}; + + +/** + * optional bytes bytes_field = 6; + * @return {!(string|Uint8Array)} + */ +proto.jspb.test.TestClone.prototype.getBytesField = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** + * optional bytes bytes_field = 6; + * This is a type-conversion wrapper around `getBytesField()` + * @return {string} + */ +proto.jspb.test.TestClone.prototype.getBytesField_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getBytesField())); +}; + + +/** + * optional bytes bytes_field = 6; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getBytesField()` + * @return {!Uint8Array} + */ +proto.jspb.test.TestClone.prototype.getBytesField_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getBytesField())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.jspb.test.TestClone} returns this + */ +proto.jspb.test.TestClone.prototype.setBytesField = function(value) { + return jspb.Message.setField(this, 6, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestClone} returns this + */ +proto.jspb.test.TestClone.prototype.clearBytesField = function() { + return jspb.Message.setField(this, 6, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestClone.prototype.hasBytesField = function() { + return jspb.Message.getField(this, 6) != null; +}; + + +/** + * optional string unused = 7; + * @return {string} + */ +proto.jspb.test.TestClone.prototype.getUnused = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.TestClone} returns this + */ +proto.jspb.test.TestClone.prototype.setUnused = function(value) { + return jspb.Message.setField(this, 7, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestClone} returns this + */ +proto.jspb.test.TestClone.prototype.clearUnused = function() { + return jspb.Message.setField(this, 7, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestClone.prototype.hasUnused = function() { + return jspb.Message.getField(this, 7) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.TestCloneExtension.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.TestCloneExtension.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.TestCloneExtension} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestCloneExtension.toObject = function(includeInstance, msg) { + var f, obj = { +f: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.TestCloneExtension} + */ +proto.jspb.test.TestCloneExtension.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.TestCloneExtension; + return proto.jspb.test.TestCloneExtension.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.TestCloneExtension} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.TestCloneExtension} + */ +proto.jspb.test.TestCloneExtension.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt32()); + msg.setF(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.TestCloneExtension.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.TestCloneExtension.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.TestCloneExtension} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestCloneExtension.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {number} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeInt32( + 1, + f + ); + } +}; + + + +/** + * A tuple of {field number, class constructor} for the extension + * field named `lowExt`. + * @type {!jspb.ExtensionFieldInfo} + */ +proto.jspb.test.TestCloneExtension.lowExt = new jspb.ExtensionFieldInfo( + 11, + {lowExt: 0}, + proto.jspb.test.TestCloneExtension, + /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( + proto.jspb.test.TestCloneExtension.toObject), + 0); + +proto.jspb.test.TestClone.extensionsBinary[11] = new jspb.ExtensionFieldBinaryInfo( + proto.jspb.test.TestCloneExtension.lowExt, + jspb.BinaryReader.prototype.readMessage, + jspb.BinaryWriter.prototype.writeMessage, + proto.jspb.test.TestCloneExtension.serializeBinaryToWriter, + proto.jspb.test.TestCloneExtension.deserializeBinaryFromReader, + false); +// This registers the extension field with the extended class, so that +// toObject() will function correctly. +proto.jspb.test.TestClone.extensions[11] = proto.jspb.test.TestCloneExtension.lowExt; + +/** + * optional int32 f = 1; + * @return {number} + */ +proto.jspb.test.TestCloneExtension.prototype.getF = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.TestCloneExtension} returns this + */ +proto.jspb.test.TestCloneExtension.prototype.setF = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestCloneExtension} returns this + */ +proto.jspb.test.TestCloneExtension.prototype.clearF = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestCloneExtension.prototype.hasF = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + +/** + * A tuple of {field number, class constructor} for the extension + * field named `lowExt`. + * @type {!jspb.ExtensionFieldInfo} + */ +proto.jspb.test.TestCloneExtension.lowExt = new jspb.ExtensionFieldInfo( + 11, + {lowExt: 0}, + proto.jspb.test.TestCloneExtension, + /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( + proto.jspb.test.TestCloneExtension.toObject), + 0); + +proto.jspb.test.TestClone.extensionsBinary[11] = new jspb.ExtensionFieldBinaryInfo( + proto.jspb.test.TestCloneExtension.lowExt, + jspb.BinaryReader.prototype.readMessage, + jspb.BinaryWriter.prototype.writeMessage, + proto.jspb.test.TestCloneExtension.serializeBinaryToWriter, + proto.jspb.test.TestCloneExtension.deserializeBinaryFromReader, + false); +// This registers the extension field with the extended class, so that +// toObject() will function correctly. +proto.jspb.test.TestClone.extensions[11] = proto.jspb.test.TestCloneExtension.lowExt; + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.CloneExtension.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.CloneExtension.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.CloneExtension} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.CloneExtension.toObject = function(includeInstance, msg) { + var f, obj = { +ext: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.CloneExtension} + */ +proto.jspb.test.CloneExtension.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.CloneExtension; + return proto.jspb.test.CloneExtension.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.CloneExtension} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.CloneExtension} + */ +proto.jspb.test.CloneExtension.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setExt(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.CloneExtension.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.CloneExtension.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.CloneExtension} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.CloneExtension.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeString( + 2, + f + ); + } +}; + + + +/** + * A tuple of {field number, class constructor} for the extension + * field named `extField`. + * @type {!jspb.ExtensionFieldInfo} + */ +proto.jspb.test.CloneExtension.extField = new jspb.ExtensionFieldInfo( + 100, + {extField: 0}, + proto.jspb.test.CloneExtension, + /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( + proto.jspb.test.CloneExtension.toObject), + 0); + +proto.jspb.test.TestClone.extensionsBinary[100] = new jspb.ExtensionFieldBinaryInfo( + proto.jspb.test.CloneExtension.extField, + jspb.BinaryReader.prototype.readMessage, + jspb.BinaryWriter.prototype.writeMessage, + proto.jspb.test.CloneExtension.serializeBinaryToWriter, + proto.jspb.test.CloneExtension.deserializeBinaryFromReader, + false); +// This registers the extension field with the extended class, so that +// toObject() will function correctly. +proto.jspb.test.TestClone.extensions[100] = proto.jspb.test.CloneExtension.extField; + +/** + * optional string ext = 2; + * @return {string} + */ +proto.jspb.test.CloneExtension.prototype.getExt = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.CloneExtension} returns this + */ +proto.jspb.test.CloneExtension.prototype.setExt = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.CloneExtension} returns this + */ +proto.jspb.test.CloneExtension.prototype.clearExt = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.CloneExtension.prototype.hasExt = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + +/** + * A tuple of {field number, class constructor} for the extension + * field named `extField`. + * @type {!jspb.ExtensionFieldInfo} + */ +proto.jspb.test.CloneExtension.extField = new jspb.ExtensionFieldInfo( + 100, + {extField: 0}, + proto.jspb.test.CloneExtension, + /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( + proto.jspb.test.CloneExtension.toObject), + 0); + +proto.jspb.test.TestClone.extensionsBinary[100] = new jspb.ExtensionFieldBinaryInfo( + proto.jspb.test.CloneExtension.extField, + jspb.BinaryReader.prototype.readMessage, + jspb.BinaryWriter.prototype.writeMessage, + proto.jspb.test.CloneExtension.serializeBinaryToWriter, + proto.jspb.test.CloneExtension.deserializeBinaryFromReader, + false); +// This registers the extension field with the extended class, so that +// toObject() will function correctly. +proto.jspb.test.TestClone.extensions[100] = proto.jspb.test.CloneExtension.extField; + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.jspb.test.TestGroup.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.TestGroup.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.TestGroup.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.TestGroup} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestGroup.toObject = function(includeInstance, msg) { + var f, obj = { +repeatedGroupList: jspb.Message.toObjectList(msg.getRepeatedGroupList(), + proto.jspb.test.TestGroup.RepeatedGroup.toObject, includeInstance), +requiredGroup: (f = msg.getRequiredGroup()) && proto.jspb.test.TestGroup.RequiredGroup.toObject(includeInstance, f), +optionalGroup: (f = msg.getOptionalGroup()) && proto.jspb.test.TestGroup.OptionalGroup.toObject(includeInstance, f), +id: (f = jspb.Message.getField(msg, 4)) == null ? undefined : f, +requiredSimple: (f = msg.getRequiredSimple()) && proto.jspb.test.Simple2.toObject(includeInstance, f), +optionalSimple: (f = msg.getOptionalSimple()) && proto.jspb.test.Simple2.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.TestGroup} + */ +proto.jspb.test.TestGroup.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.TestGroup; + return proto.jspb.test.TestGroup.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.TestGroup} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.TestGroup} + */ +proto.jspb.test.TestGroup.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.jspb.test.TestGroup.RepeatedGroup; + reader.readGroup(1, value,proto.jspb.test.TestGroup.RepeatedGroup.deserializeBinaryFromReader); + msg.addRepeatedGroup(value); + break; + case 2: + var value = new proto.jspb.test.TestGroup.RequiredGroup; + reader.readGroup(2, value,proto.jspb.test.TestGroup.RequiredGroup.deserializeBinaryFromReader); + msg.setRequiredGroup(value); + break; + case 3: + var value = new proto.jspb.test.TestGroup.OptionalGroup; + reader.readGroup(3, value,proto.jspb.test.TestGroup.OptionalGroup.deserializeBinaryFromReader); + msg.setOptionalGroup(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setId(value); + break; + case 5: + var value = new proto.jspb.test.Simple2; + reader.readMessage(value,proto.jspb.test.Simple2.deserializeBinaryFromReader); + msg.setRequiredSimple(value); + break; + case 6: + var value = new proto.jspb.test.Simple2; + reader.readMessage(value,proto.jspb.test.Simple2.deserializeBinaryFromReader); + msg.setOptionalSimple(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.TestGroup.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.TestGroup.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.TestGroup} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestGroup.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getRepeatedGroupList(); + if (f.length > 0) { + writer.writeRepeatedGroup( + 1, + f, + proto.jspb.test.TestGroup.RepeatedGroup.serializeBinaryToWriter + ); + } + f = message.getRequiredGroup(); + if (f != null) { + writer.writeGroup( + 2, + f, + proto.jspb.test.TestGroup.RequiredGroup.serializeBinaryToWriter + ); + } + f = message.getOptionalGroup(); + if (f != null) { + writer.writeGroup( + 3, + f, + proto.jspb.test.TestGroup.OptionalGroup.serializeBinaryToWriter + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 4)); + if (f != null) { + writer.writeString( + 4, + f + ); + } + f = message.getRequiredSimple(); + if (f != null) { + writer.writeMessage( + 5, + f, + proto.jspb.test.Simple2.serializeBinaryToWriter + ); + } + f = message.getOptionalSimple(); + if (f != null) { + writer.writeMessage( + 6, + f, + proto.jspb.test.Simple2.serializeBinaryToWriter + ); + } +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.jspb.test.TestGroup.RepeatedGroup.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.TestGroup.RepeatedGroup.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.TestGroup.RepeatedGroup.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.TestGroup.RepeatedGroup} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestGroup.RepeatedGroup.toObject = function(includeInstance, msg) { + var f, obj = { +id: (f = jspb.Message.getField(msg, 0)) == null ? undefined : f, +someBoolList: (f = jspb.Message.getRepeatedBooleanField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.TestGroup.RepeatedGroup} + */ +proto.jspb.test.TestGroup.RepeatedGroup.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.TestGroup.RepeatedGroup; + return proto.jspb.test.TestGroup.RepeatedGroup.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.TestGroup.RepeatedGroup} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.TestGroup.RepeatedGroup} + */ +proto.jspb.test.TestGroup.RepeatedGroup.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setId(value); + break; + case 2: + var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readBool() : [reader.readBool()]); + for (var i = 0; i < values.length; i++) { + msg.addSomeBool(values[i]); + } + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.TestGroup.RepeatedGroup.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.TestGroup.RepeatedGroup.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.TestGroup.RepeatedGroup} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestGroup.RepeatedGroup.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 0)); + if (f != null) { + writer.writeString( + 1, + f + ); + } + f = message.getSomeBoolList(); + if (f.length > 0) { + writer.writeRepeatedBool( + 2, + f + ); + } +}; + + +/** + * required string id = 1; + * @return {string} + */ +proto.jspb.test.TestGroup.RepeatedGroup.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 0, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.TestGroup.RepeatedGroup} returns this + */ +proto.jspb.test.TestGroup.RepeatedGroup.prototype.setId = function(value) { + return jspb.Message.setField(this, 0, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestGroup.RepeatedGroup} returns this + */ +proto.jspb.test.TestGroup.RepeatedGroup.prototype.clearId = function() { + return jspb.Message.setField(this, 0, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestGroup.RepeatedGroup.prototype.hasId = function() { + return jspb.Message.getField(this, 0) != null; +}; + + +/** + * repeated bool some_bool = 2; + * @return {!Array} + */ +proto.jspb.test.TestGroup.RepeatedGroup.prototype.getSomeBoolList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedBooleanField(this, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.jspb.test.TestGroup.RepeatedGroup} returns this + */ +proto.jspb.test.TestGroup.RepeatedGroup.prototype.setSomeBoolList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {boolean} value + * @param {number=} opt_index + * @return {!proto.jspb.test.TestGroup.RepeatedGroup} returns this + */ +proto.jspb.test.TestGroup.RepeatedGroup.prototype.addSomeBool = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.jspb.test.TestGroup.RepeatedGroup} returns this + */ +proto.jspb.test.TestGroup.RepeatedGroup.prototype.clearSomeBoolList = function() { + return this.setSomeBoolList([]); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.TestGroup.RequiredGroup.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.TestGroup.RequiredGroup.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.TestGroup.RequiredGroup} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestGroup.RequiredGroup.toObject = function(includeInstance, msg) { + var f, obj = { +id: (f = jspb.Message.getField(msg, -1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.TestGroup.RequiredGroup} + */ +proto.jspb.test.TestGroup.RequiredGroup.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.TestGroup.RequiredGroup; + return proto.jspb.test.TestGroup.RequiredGroup.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.TestGroup.RequiredGroup} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.TestGroup.RequiredGroup} + */ +proto.jspb.test.TestGroup.RequiredGroup.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.TestGroup.RequiredGroup.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.TestGroup.RequiredGroup.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.TestGroup.RequiredGroup} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestGroup.RequiredGroup.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, -1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * required string id = 1; + * @return {string} + */ +proto.jspb.test.TestGroup.RequiredGroup.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, -1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.TestGroup.RequiredGroup} returns this + */ +proto.jspb.test.TestGroup.RequiredGroup.prototype.setId = function(value) { + return jspb.Message.setField(this, -1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestGroup.RequiredGroup} returns this + */ +proto.jspb.test.TestGroup.RequiredGroup.prototype.clearId = function() { + return jspb.Message.setField(this, -1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestGroup.RequiredGroup.prototype.hasId = function() { + return jspb.Message.getField(this, -1) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.TestGroup.OptionalGroup.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.TestGroup.OptionalGroup.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.TestGroup.OptionalGroup} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestGroup.OptionalGroup.toObject = function(includeInstance, msg) { + var f, obj = { +id: (f = jspb.Message.getField(msg, -2)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.TestGroup.OptionalGroup} + */ +proto.jspb.test.TestGroup.OptionalGroup.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.TestGroup.OptionalGroup; + return proto.jspb.test.TestGroup.OptionalGroup.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.TestGroup.OptionalGroup} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.TestGroup.OptionalGroup} + */ +proto.jspb.test.TestGroup.OptionalGroup.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.TestGroup.OptionalGroup.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.TestGroup.OptionalGroup.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.TestGroup.OptionalGroup} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestGroup.OptionalGroup.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, -2)); + if (f != null) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * required string id = 1; + * @return {string} + */ +proto.jspb.test.TestGroup.OptionalGroup.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, -2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.TestGroup.OptionalGroup} returns this + */ +proto.jspb.test.TestGroup.OptionalGroup.prototype.setId = function(value) { + return jspb.Message.setField(this, -2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestGroup.OptionalGroup} returns this + */ +proto.jspb.test.TestGroup.OptionalGroup.prototype.clearId = function() { + return jspb.Message.setField(this, -2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestGroup.OptionalGroup.prototype.hasId = function() { + return jspb.Message.getField(this, -2) != null; +}; + + +/** + * repeated group RepeatedGroup = 1; + * @return {!Array} + */ +proto.jspb.test.TestGroup.prototype.getRepeatedGroupList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.jspb.test.TestGroup.RepeatedGroup, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.jspb.test.TestGroup} returns this +*/ +proto.jspb.test.TestGroup.prototype.setRepeatedGroupList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.jspb.test.TestGroup.RepeatedGroup=} opt_value + * @param {number=} opt_index + * @return {!proto.jspb.test.TestGroup.RepeatedGroup} + */ +proto.jspb.test.TestGroup.prototype.addRepeatedGroup = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.jspb.test.TestGroup.RepeatedGroup, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.jspb.test.TestGroup} returns this + */ +proto.jspb.test.TestGroup.prototype.clearRepeatedGroupList = function() { + return this.setRepeatedGroupList([]); +}; + + +/** + * required group RequiredGroup = 2; + * @return {!proto.jspb.test.TestGroup.RequiredGroup} + */ +proto.jspb.test.TestGroup.prototype.getRequiredGroup = function() { + return /** @type{!proto.jspb.test.TestGroup.RequiredGroup} */ ( + jspb.Message.getWrapperField(this, proto.jspb.test.TestGroup.RequiredGroup, 2, 1)); +}; + + +/** + * @param {!proto.jspb.test.TestGroup.RequiredGroup} value + * @return {!proto.jspb.test.TestGroup} returns this +*/ +proto.jspb.test.TestGroup.prototype.setRequiredGroup = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestGroup} returns this + */ +proto.jspb.test.TestGroup.prototype.clearRequiredGroup = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestGroup.prototype.hasRequiredGroup = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional group OptionalGroup = 3; + * @return {?proto.jspb.test.TestGroup.OptionalGroup} + */ +proto.jspb.test.TestGroup.prototype.getOptionalGroup = function() { + return /** @type{?proto.jspb.test.TestGroup.OptionalGroup} */ ( + jspb.Message.getWrapperField(this, proto.jspb.test.TestGroup.OptionalGroup, 3)); +}; + + +/** + * @param {?proto.jspb.test.TestGroup.OptionalGroup|undefined} value + * @return {!proto.jspb.test.TestGroup} returns this +*/ +proto.jspb.test.TestGroup.prototype.setOptionalGroup = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.jspb.test.TestGroup} returns this + */ +proto.jspb.test.TestGroup.prototype.clearOptionalGroup = function() { + return this.setOptionalGroup(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestGroup.prototype.hasOptionalGroup = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional string id = 4; + * @return {string} + */ +proto.jspb.test.TestGroup.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.TestGroup} returns this + */ +proto.jspb.test.TestGroup.prototype.setId = function(value) { + return jspb.Message.setField(this, 4, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestGroup} returns this + */ +proto.jspb.test.TestGroup.prototype.clearId = function() { + return jspb.Message.setField(this, 4, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestGroup.prototype.hasId = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * required Simple2 required_simple = 5; + * @return {!proto.jspb.test.Simple2} + */ +proto.jspb.test.TestGroup.prototype.getRequiredSimple = function() { + return /** @type{!proto.jspb.test.Simple2} */ ( + jspb.Message.getWrapperField(this, proto.jspb.test.Simple2, 5, 1)); +}; + + +/** + * @param {!proto.jspb.test.Simple2} value + * @return {!proto.jspb.test.TestGroup} returns this +*/ +proto.jspb.test.TestGroup.prototype.setRequiredSimple = function(value) { + return jspb.Message.setWrapperField(this, 5, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestGroup} returns this + */ +proto.jspb.test.TestGroup.prototype.clearRequiredSimple = function() { + return jspb.Message.setField(this, 5, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestGroup.prototype.hasRequiredSimple = function() { + return jspb.Message.getField(this, 5) != null; +}; + + +/** + * optional Simple2 optional_simple = 6; + * @return {?proto.jspb.test.Simple2} + */ +proto.jspb.test.TestGroup.prototype.getOptionalSimple = function() { + return /** @type{?proto.jspb.test.Simple2} */ ( + jspb.Message.getWrapperField(this, proto.jspb.test.Simple2, 6)); +}; + + +/** + * @param {?proto.jspb.test.Simple2|undefined} value + * @return {!proto.jspb.test.TestGroup} returns this +*/ +proto.jspb.test.TestGroup.prototype.setOptionalSimple = function(value) { + return jspb.Message.setWrapperField(this, 6, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.jspb.test.TestGroup} returns this + */ +proto.jspb.test.TestGroup.prototype.clearOptionalSimple = function() { + return this.setOptionalSimple(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestGroup.prototype.hasOptionalSimple = function() { + return jspb.Message.getField(this, 6) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.TestGroup1.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.TestGroup1.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.TestGroup1} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestGroup1.toObject = function(includeInstance, msg) { + var f, obj = { +group: (f = msg.getGroup()) && proto.jspb.test.TestGroup.RepeatedGroup.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.TestGroup1} + */ +proto.jspb.test.TestGroup1.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.TestGroup1; + return proto.jspb.test.TestGroup1.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.TestGroup1} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.TestGroup1} + */ +proto.jspb.test.TestGroup1.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.jspb.test.TestGroup.RepeatedGroup; + reader.readMessage(value,proto.jspb.test.TestGroup.RepeatedGroup.deserializeBinaryFromReader); + msg.setGroup(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.TestGroup1.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.TestGroup1.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.TestGroup1} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestGroup1.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getGroup(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.jspb.test.TestGroup.RepeatedGroup.serializeBinaryToWriter + ); + } +}; + + +/** + * optional TestGroup.RepeatedGroup group = 1; + * @return {?proto.jspb.test.TestGroup.RepeatedGroup} + */ +proto.jspb.test.TestGroup1.prototype.getGroup = function() { + return /** @type{?proto.jspb.test.TestGroup.RepeatedGroup} */ ( + jspb.Message.getWrapperField(this, proto.jspb.test.TestGroup.RepeatedGroup, 1)); +}; + + +/** + * @param {?proto.jspb.test.TestGroup.RepeatedGroup|undefined} value + * @return {!proto.jspb.test.TestGroup1} returns this +*/ +proto.jspb.test.TestGroup1.prototype.setGroup = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.jspb.test.TestGroup1} returns this + */ +proto.jspb.test.TestGroup1.prototype.clearGroup = function() { + return this.setGroup(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestGroup1.prototype.hasGroup = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.TestReservedNames.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.TestReservedNames.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.TestReservedNames} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestReservedNames.toObject = function(includeInstance, msg) { + var f, obj = { +extension: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f + }; + + jspb.Message.toObjectExtension(/** @type {!jspb.Message} */ (msg), obj, + proto.jspb.test.TestReservedNames.extensions, proto.jspb.test.TestReservedNames.prototype.getExtension, + includeInstance); + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.TestReservedNames} + */ +proto.jspb.test.TestReservedNames.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.TestReservedNames; + return proto.jspb.test.TestReservedNames.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.TestReservedNames} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.TestReservedNames} + */ +proto.jspb.test.TestReservedNames.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt32()); + msg.setExtension$(value); + break; + default: + jspb.Message.readBinaryExtension(msg, reader, + proto.jspb.test.TestReservedNames.extensionsBinary, + proto.jspb.test.TestReservedNames.prototype.getExtension, + proto.jspb.test.TestReservedNames.prototype.setExtension); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.TestReservedNames.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.TestReservedNames.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.TestReservedNames} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestReservedNames.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {number} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeInt32( + 1, + f + ); + } + jspb.Message.serializeBinaryExtensions(message, writer, + proto.jspb.test.TestReservedNames.extensionsBinary, proto.jspb.test.TestReservedNames.prototype.getExtension); +}; + + +/** + * optional int32 extension = 1; + * @return {number} + */ +proto.jspb.test.TestReservedNames.prototype.getExtension$ = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.TestReservedNames} returns this + */ +proto.jspb.test.TestReservedNames.prototype.setExtension$ = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestReservedNames} returns this + */ +proto.jspb.test.TestReservedNames.prototype.clearExtension$ = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestReservedNames.prototype.hasExtension$ = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.TestReservedNamesExtension.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.TestReservedNamesExtension.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.TestReservedNamesExtension} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestReservedNamesExtension.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.TestReservedNamesExtension} + */ +proto.jspb.test.TestReservedNamesExtension.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.TestReservedNamesExtension; + return proto.jspb.test.TestReservedNamesExtension.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.TestReservedNamesExtension} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.TestReservedNamesExtension} + */ +proto.jspb.test.TestReservedNamesExtension.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.TestReservedNamesExtension.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.TestReservedNamesExtension.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.TestReservedNamesExtension} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestReservedNamesExtension.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + +/** + * A tuple of {field number, class constructor} for the extension + * field named `foo`. + * @type {!jspb.ExtensionFieldInfo} + */ +proto.jspb.test.TestReservedNamesExtension.foo = new jspb.ExtensionFieldInfo( + 10, + {foo: 0}, + null, + /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( + null), + 0); + +proto.jspb.test.TestReservedNames.extensionsBinary[10] = new jspb.ExtensionFieldBinaryInfo( + proto.jspb.test.TestReservedNamesExtension.foo, + jspb.BinaryReader.prototype.readInt32, + jspb.BinaryWriter.prototype.writeInt32, + undefined, + undefined, + false); +// This registers the extension field with the extended class, so that +// toObject() will function correctly. +proto.jspb.test.TestReservedNames.extensions[10] = proto.jspb.test.TestReservedNamesExtension.foo; + + +/** + * A tuple of {field number, class constructor} for the extension + * field named `foo`. + * @type {!jspb.ExtensionFieldInfo} + */ +proto.jspb.test.TestReservedNamesExtension.foo = new jspb.ExtensionFieldInfo( + 10, + {foo: 0}, + null, + /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( + null), + 0); + +proto.jspb.test.TestReservedNames.extensionsBinary[10] = new jspb.ExtensionFieldBinaryInfo( + proto.jspb.test.TestReservedNamesExtension.foo, + jspb.BinaryReader.prototype.readInt32, + jspb.BinaryWriter.prototype.writeInt32, + undefined, + undefined, + false); +// This registers the extension field with the extended class, so that +// toObject() will function correctly. +proto.jspb.test.TestReservedNames.extensions[10] = proto.jspb.test.TestReservedNamesExtension.foo; + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.jspb.test.TestMessageWithOneof.repeatedFields_ = [9]; + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.jspb.test.TestMessageWithOneof.oneofGroups_ = [[3,5],[6,7],[10,11],[12,13]]; + +/** + * @enum {number} + */ +proto.jspb.test.TestMessageWithOneof.PartialOneofCase = { + PARTIAL_ONEOF_NOT_SET: 0, + PONE: 3, + PTHREE: 5 +}; + +/** + * @return {proto.jspb.test.TestMessageWithOneof.PartialOneofCase} + */ +proto.jspb.test.TestMessageWithOneof.prototype.getPartialOneofCase = function() { + return /** @type {proto.jspb.test.TestMessageWithOneof.PartialOneofCase} */(jspb.Message.computeOneofCase(this, proto.jspb.test.TestMessageWithOneof.oneofGroups_[0])); +}; + +/** + * @enum {number} + */ +proto.jspb.test.TestMessageWithOneof.RecursiveOneofCase = { + RECURSIVE_ONEOF_NOT_SET: 0, + RONE: 6, + RTWO: 7 +}; + +/** + * @return {proto.jspb.test.TestMessageWithOneof.RecursiveOneofCase} + */ +proto.jspb.test.TestMessageWithOneof.prototype.getRecursiveOneofCase = function() { + return /** @type {proto.jspb.test.TestMessageWithOneof.RecursiveOneofCase} */(jspb.Message.computeOneofCase(this, proto.jspb.test.TestMessageWithOneof.oneofGroups_[1])); +}; + +/** + * @enum {number} + */ +proto.jspb.test.TestMessageWithOneof.DefaultOneofACase = { + DEFAULT_ONEOF_A_NOT_SET: 0, + AONE: 10, + ATWO: 11 +}; + +/** + * @return {proto.jspb.test.TestMessageWithOneof.DefaultOneofACase} + */ +proto.jspb.test.TestMessageWithOneof.prototype.getDefaultOneofACase = function() { + return /** @type {proto.jspb.test.TestMessageWithOneof.DefaultOneofACase} */(jspb.Message.computeOneofCase(this, proto.jspb.test.TestMessageWithOneof.oneofGroups_[2])); +}; + +/** + * @enum {number} + */ +proto.jspb.test.TestMessageWithOneof.DefaultOneofBCase = { + DEFAULT_ONEOF_B_NOT_SET: 0, + BONE: 12, + BTWO: 13 +}; + +/** + * @return {proto.jspb.test.TestMessageWithOneof.DefaultOneofBCase} + */ +proto.jspb.test.TestMessageWithOneof.prototype.getDefaultOneofBCase = function() { + return /** @type {proto.jspb.test.TestMessageWithOneof.DefaultOneofBCase} */(jspb.Message.computeOneofCase(this, proto.jspb.test.TestMessageWithOneof.oneofGroups_[3])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.TestMessageWithOneof.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.TestMessageWithOneof.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.TestMessageWithOneof} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestMessageWithOneof.toObject = function(includeInstance, msg) { + var f, obj = { +pone: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f, +pthree: (f = jspb.Message.getField(msg, 5)) == null ? undefined : f, +rone: (f = msg.getRone()) && proto.jspb.test.TestMessageWithOneof.toObject(includeInstance, f), +rtwo: (f = jspb.Message.getField(msg, 7)) == null ? undefined : f, +normalField: (f = jspb.Message.getBooleanField(msg, 8)) == null ? undefined : f, +repeatedFieldList: (f = jspb.Message.getRepeatedField(msg, 9)) == null ? undefined : f, +aone: jspb.Message.getFieldWithDefault(msg, 10, 1234), +atwo: (f = jspb.Message.getField(msg, 11)) == null ? undefined : f, +bone: (f = jspb.Message.getField(msg, 12)) == null ? undefined : f, +btwo: jspb.Message.getFieldWithDefault(msg, 13, 1234) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.TestMessageWithOneof} + */ +proto.jspb.test.TestMessageWithOneof.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.TestMessageWithOneof; + return proto.jspb.test.TestMessageWithOneof.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.TestMessageWithOneof} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.TestMessageWithOneof} + */ +proto.jspb.test.TestMessageWithOneof.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setPone(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.setPthree(value); + break; + case 6: + var value = new proto.jspb.test.TestMessageWithOneof; + reader.readMessage(value,proto.jspb.test.TestMessageWithOneof.deserializeBinaryFromReader); + msg.setRone(value); + break; + case 7: + var value = /** @type {string} */ (reader.readString()); + msg.setRtwo(value); + break; + case 8: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setNormalField(value); + break; + case 9: + var value = /** @type {string} */ (reader.readString()); + msg.addRepeatedField(value); + break; + case 10: + var value = /** @type {number} */ (reader.readInt32()); + msg.setAone(value); + break; + case 11: + var value = /** @type {number} */ (reader.readInt32()); + msg.setAtwo(value); + break; + case 12: + var value = /** @type {number} */ (reader.readInt32()); + msg.setBone(value); + break; + case 13: + var value = /** @type {number} */ (reader.readInt32()); + msg.setBtwo(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.TestMessageWithOneof.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.TestMessageWithOneof.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.TestMessageWithOneof} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestMessageWithOneof.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 3)); + if (f != null) { + writer.writeString( + 3, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 5)); + if (f != null) { + writer.writeString( + 5, + f + ); + } + f = message.getRone(); + if (f != null) { + writer.writeMessage( + 6, + f, + proto.jspb.test.TestMessageWithOneof.serializeBinaryToWriter + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 7)); + if (f != null) { + writer.writeString( + 7, + f + ); + } + f = /** @type {boolean} */ (jspb.Message.getField(message, 8)); + if (f != null) { + writer.writeBool( + 8, + f + ); + } + f = message.getRepeatedFieldList(); + if (f.length > 0) { + writer.writeRepeatedString( + 9, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 10)); + if (f != null) { + writer.writeInt32( + 10, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 11)); + if (f != null) { + writer.writeInt32( + 11, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 12)); + if (f != null) { + writer.writeInt32( + 12, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 13)); + if (f != null) { + writer.writeInt32( + 13, + f + ); + } +}; + + +/** + * optional string pone = 3; + * @return {string} + */ +proto.jspb.test.TestMessageWithOneof.prototype.getPone = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.setPone = function(value) { + return jspb.Message.setOneofField(this, 3, proto.jspb.test.TestMessageWithOneof.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.clearPone = function() { + return jspb.Message.setOneofField(this, 3, proto.jspb.test.TestMessageWithOneof.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestMessageWithOneof.prototype.hasPone = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional string pthree = 5; + * @return {string} + */ +proto.jspb.test.TestMessageWithOneof.prototype.getPthree = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.setPthree = function(value) { + return jspb.Message.setOneofField(this, 5, proto.jspb.test.TestMessageWithOneof.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.clearPthree = function() { + return jspb.Message.setOneofField(this, 5, proto.jspb.test.TestMessageWithOneof.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestMessageWithOneof.prototype.hasPthree = function() { + return jspb.Message.getField(this, 5) != null; +}; + + +/** + * optional TestMessageWithOneof rone = 6; + * @return {?proto.jspb.test.TestMessageWithOneof} + */ +proto.jspb.test.TestMessageWithOneof.prototype.getRone = function() { + return /** @type{?proto.jspb.test.TestMessageWithOneof} */ ( + jspb.Message.getWrapperField(this, proto.jspb.test.TestMessageWithOneof, 6)); +}; + + +/** + * @param {?proto.jspb.test.TestMessageWithOneof|undefined} value + * @return {!proto.jspb.test.TestMessageWithOneof} returns this +*/ +proto.jspb.test.TestMessageWithOneof.prototype.setRone = function(value) { + return jspb.Message.setOneofWrapperField(this, 6, proto.jspb.test.TestMessageWithOneof.oneofGroups_[1], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.clearRone = function() { + return this.setRone(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestMessageWithOneof.prototype.hasRone = function() { + return jspb.Message.getField(this, 6) != null; +}; + + +/** + * optional string rtwo = 7; + * @return {string} + */ +proto.jspb.test.TestMessageWithOneof.prototype.getRtwo = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.setRtwo = function(value) { + return jspb.Message.setOneofField(this, 7, proto.jspb.test.TestMessageWithOneof.oneofGroups_[1], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.clearRtwo = function() { + return jspb.Message.setOneofField(this, 7, proto.jspb.test.TestMessageWithOneof.oneofGroups_[1], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestMessageWithOneof.prototype.hasRtwo = function() { + return jspb.Message.getField(this, 7) != null; +}; + + +/** + * optional bool normal_field = 8; + * @return {boolean} + */ +proto.jspb.test.TestMessageWithOneof.prototype.getNormalField = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 8, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.setNormalField = function(value) { + return jspb.Message.setField(this, 8, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.clearNormalField = function() { + return jspb.Message.setField(this, 8, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestMessageWithOneof.prototype.hasNormalField = function() { + return jspb.Message.getField(this, 8) != null; +}; + + +/** + * repeated string repeated_field = 9; + * @return {!Array} + */ +proto.jspb.test.TestMessageWithOneof.prototype.getRepeatedFieldList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 9)); +}; + + +/** + * @param {!Array} value + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.setRepeatedFieldList = function(value) { + return jspb.Message.setField(this, 9, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.addRepeatedField = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 9, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.clearRepeatedFieldList = function() { + return this.setRepeatedFieldList([]); +}; + + +/** + * optional int32 aone = 10; + * @return {number} + */ +proto.jspb.test.TestMessageWithOneof.prototype.getAone = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 10, 1234)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.setAone = function(value) { + return jspb.Message.setOneofField(this, 10, proto.jspb.test.TestMessageWithOneof.oneofGroups_[2], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.clearAone = function() { + return jspb.Message.setOneofField(this, 10, proto.jspb.test.TestMessageWithOneof.oneofGroups_[2], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestMessageWithOneof.prototype.hasAone = function() { + return jspb.Message.getField(this, 10) != null; +}; + + +/** + * optional int32 atwo = 11; + * @return {number} + */ +proto.jspb.test.TestMessageWithOneof.prototype.getAtwo = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 11, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.setAtwo = function(value) { + return jspb.Message.setOneofField(this, 11, proto.jspb.test.TestMessageWithOneof.oneofGroups_[2], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.clearAtwo = function() { + return jspb.Message.setOneofField(this, 11, proto.jspb.test.TestMessageWithOneof.oneofGroups_[2], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestMessageWithOneof.prototype.hasAtwo = function() { + return jspb.Message.getField(this, 11) != null; +}; + + +/** + * optional int32 bone = 12; + * @return {number} + */ +proto.jspb.test.TestMessageWithOneof.prototype.getBone = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 12, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.setBone = function(value) { + return jspb.Message.setOneofField(this, 12, proto.jspb.test.TestMessageWithOneof.oneofGroups_[3], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.clearBone = function() { + return jspb.Message.setOneofField(this, 12, proto.jspb.test.TestMessageWithOneof.oneofGroups_[3], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestMessageWithOneof.prototype.hasBone = function() { + return jspb.Message.getField(this, 12) != null; +}; + + +/** + * optional int32 btwo = 13; + * @return {number} + */ +proto.jspb.test.TestMessageWithOneof.prototype.getBtwo = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 13, 1234)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.setBtwo = function(value) { + return jspb.Message.setOneofField(this, 13, proto.jspb.test.TestMessageWithOneof.oneofGroups_[3], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.clearBtwo = function() { + return jspb.Message.setOneofField(this, 13, proto.jspb.test.TestMessageWithOneof.oneofGroups_[3], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestMessageWithOneof.prototype.hasBtwo = function() { + return jspb.Message.getField(this, 13) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.TestEndsWithBytes.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.TestEndsWithBytes.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.TestEndsWithBytes} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestEndsWithBytes.toObject = function(includeInstance, msg) { + var f, obj = { +value: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, +data: msg.getData_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.TestEndsWithBytes} + */ +proto.jspb.test.TestEndsWithBytes.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.TestEndsWithBytes; + return proto.jspb.test.TestEndsWithBytes.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.TestEndsWithBytes} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.TestEndsWithBytes} + */ +proto.jspb.test.TestEndsWithBytes.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt32()); + msg.setValue(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setData(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.TestEndsWithBytes.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.TestEndsWithBytes.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.TestEndsWithBytes} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestEndsWithBytes.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {number} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeInt32( + 1, + f + ); + } + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeBytes( + 2, + f + ); + } +}; + + +/** + * optional int32 value = 1; + * @return {number} + */ +proto.jspb.test.TestEndsWithBytes.prototype.getValue = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.TestEndsWithBytes} returns this + */ +proto.jspb.test.TestEndsWithBytes.prototype.setValue = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestEndsWithBytes} returns this + */ +proto.jspb.test.TestEndsWithBytes.prototype.clearValue = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestEndsWithBytes.prototype.hasValue = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional bytes data = 2; + * @return {!(string|Uint8Array)} + */ +proto.jspb.test.TestEndsWithBytes.prototype.getData = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes data = 2; + * This is a type-conversion wrapper around `getData()` + * @return {string} + */ +proto.jspb.test.TestEndsWithBytes.prototype.getData_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getData())); +}; + + +/** + * optional bytes data = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getData()` + * @return {!Uint8Array} + */ +proto.jspb.test.TestEndsWithBytes.prototype.getData_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getData())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.jspb.test.TestEndsWithBytes} returns this + */ +proto.jspb.test.TestEndsWithBytes.prototype.setData = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestEndsWithBytes} returns this + */ +proto.jspb.test.TestEndsWithBytes.prototype.clearData = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestEndsWithBytes.prototype.hasData = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.TestLastFieldBeforePivot.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.TestLastFieldBeforePivot.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.TestLastFieldBeforePivot} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestLastFieldBeforePivot.toObject = function(includeInstance, msg) { + var f, obj = { +lastFieldBeforePivot: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f + }; + + jspb.Message.toObjectExtension(/** @type {!jspb.Message} */ (msg), obj, + proto.jspb.test.TestLastFieldBeforePivot.extensions, proto.jspb.test.TestLastFieldBeforePivot.prototype.getExtension, + includeInstance); + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.TestLastFieldBeforePivot} + */ +proto.jspb.test.TestLastFieldBeforePivot.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.TestLastFieldBeforePivot; + return proto.jspb.test.TestLastFieldBeforePivot.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.TestLastFieldBeforePivot} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.TestLastFieldBeforePivot} + */ +proto.jspb.test.TestLastFieldBeforePivot.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt32()); + msg.setLastFieldBeforePivot(value); + break; + default: + jspb.Message.readBinaryExtension(msg, reader, + proto.jspb.test.TestLastFieldBeforePivot.extensionsBinary, + proto.jspb.test.TestLastFieldBeforePivot.prototype.getExtension, + proto.jspb.test.TestLastFieldBeforePivot.prototype.setExtension); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.TestLastFieldBeforePivot.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.TestLastFieldBeforePivot.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.TestLastFieldBeforePivot} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestLastFieldBeforePivot.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {number} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeInt32( + 1, + f + ); + } + jspb.Message.serializeBinaryExtensions(message, writer, + proto.jspb.test.TestLastFieldBeforePivot.extensionsBinary, proto.jspb.test.TestLastFieldBeforePivot.prototype.getExtension); +}; + + +/** + * optional int32 last_field_before_pivot = 1; + * @return {number} + */ +proto.jspb.test.TestLastFieldBeforePivot.prototype.getLastFieldBeforePivot = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.TestLastFieldBeforePivot} returns this + */ +proto.jspb.test.TestLastFieldBeforePivot.prototype.setLastFieldBeforePivot = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestLastFieldBeforePivot} returns this + */ +proto.jspb.test.TestLastFieldBeforePivot.prototype.clearLastFieldBeforePivot = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestLastFieldBeforePivot.prototype.hasLastFieldBeforePivot = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.Int64Types.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.Int64Types.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.Int64Types} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Int64Types.toObject = function(includeInstance, msg) { + var f, obj = { +int64Normal: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, +int64String: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f, +int64Number: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.Int64Types} + */ +proto.jspb.test.Int64Types.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.Int64Types; + return proto.jspb.test.Int64Types.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.Int64Types} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.Int64Types} + */ +proto.jspb.test.Int64Types.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt64()); + msg.setInt64Normal(value); + break; + case 2: + var value = /** @type {string} */ (reader.readSint64String()); + msg.setInt64String(value); + break; + case 3: + var value = /** @type {number} */ (reader.readUint64()); + msg.setInt64Number(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.Int64Types.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.Int64Types.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.Int64Types} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Int64Types.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {number} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeInt64( + 1, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeSint64String( + 2, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 3)); + if (f != null) { + writer.writeUint64( + 3, + f + ); + } +}; + + +/** + * optional int64 int64_normal = 1; + * @return {number} + */ +proto.jspb.test.Int64Types.prototype.getInt64Normal = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.Int64Types} returns this + */ +proto.jspb.test.Int64Types.prototype.setInt64Normal = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.Int64Types} returns this + */ +proto.jspb.test.Int64Types.prototype.clearInt64Normal = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.Int64Types.prototype.hasInt64Normal = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional sint64 int64_string = 2; + * @return {string} + */ +proto.jspb.test.Int64Types.prototype.getInt64String = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "0")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.Int64Types} returns this + */ +proto.jspb.test.Int64Types.prototype.setInt64String = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.Int64Types} returns this + */ +proto.jspb.test.Int64Types.prototype.clearInt64String = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.Int64Types.prototype.hasInt64String = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional uint64 int64_number = 3; + * @return {number} + */ +proto.jspb.test.Int64Types.prototype.getInt64Number = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.Int64Types} returns this + */ +proto.jspb.test.Int64Types.prototype.setInt64Number = function(value) { + return jspb.Message.setField(this, 3, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.Int64Types} returns this + */ +proto.jspb.test.Int64Types.prototype.clearInt64Number = function() { + return jspb.Message.setField(this, 3, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.Int64Types.prototype.hasInt64Number = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.TestMapFieldsNoBinary.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.TestMapFieldsNoBinary} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestMapFieldsNoBinary.toObject = function(includeInstance, msg) { + var f, obj = { +mapStringStringMap: (f = msg.getMapStringStringMap()) ? f.toObject(includeInstance, undefined) : [], +mapStringInt32Map: (f = msg.getMapStringInt32Map()) ? f.toObject(includeInstance, undefined) : [], +mapStringInt64Map: (f = msg.getMapStringInt64Map()) ? f.toObject(includeInstance, undefined) : [], +mapStringBoolMap: (f = msg.getMapStringBoolMap()) ? f.toObject(includeInstance, undefined) : [], +mapStringDoubleMap: (f = msg.getMapStringDoubleMap()) ? f.toObject(includeInstance, undefined) : [], +mapStringEnumMap: (f = msg.getMapStringEnumMap()) ? f.toObject(includeInstance, undefined) : [], +mapStringMsgMap: (f = msg.getMapStringMsgMap()) ? f.toObject(includeInstance, proto.jspb.test.MapValueMessageNoBinary.toObject) : [], +mapInt32StringMap: (f = msg.getMapInt32StringMap()) ? f.toObject(includeInstance, undefined) : [], +mapInt64StringMap: (f = msg.getMapInt64StringMap()) ? f.toObject(includeInstance, undefined) : [], +mapBoolStringMap: (f = msg.getMapBoolStringMap()) ? f.toObject(includeInstance, undefined) : [], +testMapFields: (f = msg.getTestMapFields()) && proto.jspb.test.TestMapFieldsNoBinary.toObject(includeInstance, f), +mapStringTestmapfieldsMap: (f = msg.getMapStringTestmapfieldsMap()) ? f.toObject(includeInstance, proto.jspb.test.TestMapFieldsNoBinary.toObject) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.TestMapFieldsNoBinary} + */ +proto.jspb.test.TestMapFieldsNoBinary.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.TestMapFieldsNoBinary; + return proto.jspb.test.TestMapFieldsNoBinary.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.TestMapFieldsNoBinary} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.TestMapFieldsNoBinary} + */ +proto.jspb.test.TestMapFieldsNoBinary.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = msg.getMapStringStringMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; + case 2: + var value = msg.getMapStringInt32Map(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readInt32, null, "", 0); + }); + break; + case 3: + var value = msg.getMapStringInt64Map(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readInt64, null, "", 0); + }); + break; + case 4: + var value = msg.getMapStringBoolMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readBool, null, "", false); + }); + break; + case 5: + var value = msg.getMapStringDoubleMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readDouble, null, "", 0.0); + }); + break; + case 6: + var value = msg.getMapStringEnumMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readEnum, null, "", 0); + }); + break; + case 7: + var value = msg.getMapStringMsgMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.jspb.test.MapValueMessageNoBinary.deserializeBinaryFromReader, "", new proto.jspb.test.MapValueMessageNoBinary()); + }); + break; + case 8: + var value = msg.getMapInt32StringMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readInt32, jspb.BinaryReader.prototype.readString, null, 0, ""); + }); + break; + case 9: + var value = msg.getMapInt64StringMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readInt64, jspb.BinaryReader.prototype.readString, null, 0, ""); + }); + break; + case 10: + var value = msg.getMapBoolStringMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readBool, jspb.BinaryReader.prototype.readString, null, false, ""); + }); + break; + case 11: + var value = new proto.jspb.test.TestMapFieldsNoBinary; + reader.readMessage(value,proto.jspb.test.TestMapFieldsNoBinary.deserializeBinaryFromReader); + msg.setTestMapFields(value); + break; + case 12: + var value = msg.getMapStringTestmapfieldsMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.jspb.test.TestMapFieldsNoBinary.deserializeBinaryFromReader, "", new proto.jspb.test.TestMapFieldsNoBinary()); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.TestMapFieldsNoBinary.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.TestMapFieldsNoBinary} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestMapFieldsNoBinary.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getMapStringStringMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } + f = message.getMapStringInt32Map(true); + if (f && f.getLength() > 0) { + f.serializeBinary(2, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeInt32); + } + f = message.getMapStringInt64Map(true); + if (f && f.getLength() > 0) { + f.serializeBinary(3, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeInt64); + } + f = message.getMapStringBoolMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(4, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeBool); + } + f = message.getMapStringDoubleMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(5, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeDouble); + } + f = message.getMapStringEnumMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(6, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeEnum); + } + f = message.getMapStringMsgMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(7, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.jspb.test.MapValueMessageNoBinary.serializeBinaryToWriter); + } + f = message.getMapInt32StringMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(8, writer, jspb.BinaryWriter.prototype.writeInt32, jspb.BinaryWriter.prototype.writeString); + } + f = message.getMapInt64StringMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(9, writer, jspb.BinaryWriter.prototype.writeInt64, jspb.BinaryWriter.prototype.writeString); + } + f = message.getMapBoolStringMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(10, writer, jspb.BinaryWriter.prototype.writeBool, jspb.BinaryWriter.prototype.writeString); + } + f = message.getTestMapFields(); + if (f != null) { + writer.writeMessage( + 11, + f, + proto.jspb.test.TestMapFieldsNoBinary.serializeBinaryToWriter + ); + } + f = message.getMapStringTestmapfieldsMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(12, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.jspb.test.TestMapFieldsNoBinary.serializeBinaryToWriter); + } +}; + + +/** + * map map_string_string = 1; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapStringStringMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 1, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapStringStringMap = function() { + this.getMapStringStringMap().clear(); + return this; +}; + + +/** + * map map_string_int32 = 2; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapStringInt32Map = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 2, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapStringInt32Map = function() { + this.getMapStringInt32Map().clear(); + return this; +}; + + +/** + * map map_string_int64 = 3; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapStringInt64Map = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 3, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapStringInt64Map = function() { + this.getMapStringInt64Map().clear(); + return this; +}; + + +/** + * map map_string_bool = 4; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapStringBoolMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 4, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapStringBoolMap = function() { + this.getMapStringBoolMap().clear(); + return this; +}; + + +/** + * map map_string_double = 5; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapStringDoubleMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 5, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapStringDoubleMap = function() { + this.getMapStringDoubleMap().clear(); + return this; +}; + + +/** + * map map_string_enum = 6; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapStringEnumMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 6, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapStringEnumMap = function() { + this.getMapStringEnumMap().clear(); + return this; +}; + + +/** + * map map_string_msg = 7; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapStringMsgMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 7, opt_noLazyCreate, + proto.jspb.test.MapValueMessageNoBinary)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapStringMsgMap = function() { + this.getMapStringMsgMap().clear(); + return this; +}; + + +/** + * map map_int32_string = 8; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapInt32StringMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 8, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapInt32StringMap = function() { + this.getMapInt32StringMap().clear(); + return this; +}; + + +/** + * map map_int64_string = 9; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapInt64StringMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 9, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapInt64StringMap = function() { + this.getMapInt64StringMap().clear(); + return this; +}; + + +/** + * map map_bool_string = 10; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapBoolStringMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 10, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapBoolStringMap = function() { + this.getMapBoolStringMap().clear(); + return this; +}; + + +/** + * optional TestMapFieldsNoBinary test_map_fields = 11; + * @return {?proto.jspb.test.TestMapFieldsNoBinary} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.getTestMapFields = function() { + return /** @type{?proto.jspb.test.TestMapFieldsNoBinary} */ ( + jspb.Message.getWrapperField(this, proto.jspb.test.TestMapFieldsNoBinary, 11)); +}; + + +/** + * @param {?proto.jspb.test.TestMapFieldsNoBinary|undefined} value + * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this +*/ +proto.jspb.test.TestMapFieldsNoBinary.prototype.setTestMapFields = function(value) { + return jspb.Message.setWrapperField(this, 11, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.clearTestMapFields = function() { + return this.setTestMapFields(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.hasTestMapFields = function() { + return jspb.Message.getField(this, 11) != null; +}; + + +/** + * map map_string_testmapfields = 12; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapStringTestmapfieldsMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 12, opt_noLazyCreate, + proto.jspb.test.TestMapFieldsNoBinary)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapStringTestmapfieldsMap = function() { + this.getMapStringTestmapfieldsMap().clear(); + return this; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.MapValueMessageNoBinary.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.MapValueMessageNoBinary.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.MapValueMessageNoBinary} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.MapValueMessageNoBinary.toObject = function(includeInstance, msg) { + var f, obj = { +foo: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.MapValueMessageNoBinary} + */ +proto.jspb.test.MapValueMessageNoBinary.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.MapValueMessageNoBinary; + return proto.jspb.test.MapValueMessageNoBinary.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.MapValueMessageNoBinary} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.MapValueMessageNoBinary} + */ +proto.jspb.test.MapValueMessageNoBinary.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt32()); + msg.setFoo(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.MapValueMessageNoBinary.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.MapValueMessageNoBinary.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.MapValueMessageNoBinary} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.MapValueMessageNoBinary.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {number} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeInt32( + 1, + f + ); + } +}; + + +/** + * optional int32 foo = 1; + * @return {number} + */ +proto.jspb.test.MapValueMessageNoBinary.prototype.getFoo = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.MapValueMessageNoBinary} returns this + */ +proto.jspb.test.MapValueMessageNoBinary.prototype.setFoo = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.MapValueMessageNoBinary} returns this + */ +proto.jspb.test.MapValueMessageNoBinary.prototype.clearFoo = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.MapValueMessageNoBinary.prototype.hasFoo = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.Deeply.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.Deeply.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.Deeply} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Deeply.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.Deeply} + */ +proto.jspb.test.Deeply.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.Deeply; + return proto.jspb.test.Deeply.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.Deeply} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.Deeply} + */ +proto.jspb.test.Deeply.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.Deeply.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.Deeply.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.Deeply} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Deeply.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.Deeply.Nested.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.Deeply.Nested.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.Deeply.Nested} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Deeply.Nested.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.Deeply.Nested} + */ +proto.jspb.test.Deeply.Nested.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.Deeply.Nested; + return proto.jspb.test.Deeply.Nested.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.Deeply.Nested} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.Deeply.Nested} + */ +proto.jspb.test.Deeply.Nested.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.Deeply.Nested.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.Deeply.Nested.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.Deeply.Nested} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Deeply.Nested.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.Deeply.Nested.Message.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.Deeply.Nested.Message.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.Deeply.Nested.Message} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Deeply.Nested.Message.toObject = function(includeInstance, msg) { + var f, obj = { +count: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.Deeply.Nested.Message} + */ +proto.jspb.test.Deeply.Nested.Message.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.Deeply.Nested.Message; + return proto.jspb.test.Deeply.Nested.Message.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.Deeply.Nested.Message} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.Deeply.Nested.Message} + */ +proto.jspb.test.Deeply.Nested.Message.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt32()); + msg.setCount(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.Deeply.Nested.Message.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.Deeply.Nested.Message.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.Deeply.Nested.Message} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Deeply.Nested.Message.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {number} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeInt32( + 1, + f + ); + } +}; + + +/** + * optional int32 count = 1; + * @return {number} + */ +proto.jspb.test.Deeply.Nested.Message.prototype.getCount = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.Deeply.Nested.Message} returns this + */ +proto.jspb.test.Deeply.Nested.Message.prototype.setCount = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.Deeply.Nested.Message} returns this + */ +proto.jspb.test.Deeply.Nested.Message.prototype.clearCount = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.Deeply.Nested.Message.prototype.hasCount = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * @enum {number} + */ +proto.jspb.test.OuterEnum = { + FOO: 1, + BAR: 2 +}; + +/** + * @enum {number} + */ +proto.jspb.test.MapValueEnumNoBinary = { + MAP_VALUE_FOO_NOBINARY: 0, + MAP_VALUE_BAR_NOBINARY: 1, + MAP_VALUE_BAZ_NOBINARY: 2 +}; + +/** + * @enum {number} + */ +proto.jspb.test.TestAllowAliasEnum = { + TEST_ALLOW_ALIAS_DEFAULT: 0, + VALUE1: 1 +}; + + +/** + * A tuple of {field number, class constructor} for the extension + * field named `simple1`. + * @type {!jspb.ExtensionFieldInfo} + */ +proto.jspb.test.simple1 = new jspb.ExtensionFieldInfo( + 105, + {simple1: 0}, + proto.jspb.test.Simple1, + /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( + proto.jspb.test.Simple1.toObject), + 0); + +proto.jspb.test.HasExtensions.extensionsBinary[105] = new jspb.ExtensionFieldBinaryInfo( + proto.jspb.test.simple1, + jspb.BinaryReader.prototype.readMessage, + jspb.BinaryWriter.prototype.writeMessage, + proto.jspb.test.Simple1.serializeBinaryToWriter, + proto.jspb.test.Simple1.deserializeBinaryFromReader, + false); +// This registers the extension field with the extended class, so that +// toObject() will function correctly. +proto.jspb.test.HasExtensions.extensions[105] = proto.jspb.test.simple1; + + +/** + * A tuple of {field number, class constructor} for the extension + * field named `extendTestLastFieldBeforePivotField`. + * @type {!jspb.ExtensionFieldInfo} + */ +proto.jspb.test.extendTestLastFieldBeforePivotField = new jspb.ExtensionFieldInfo( + 101, + {extendTestLastFieldBeforePivotField: 0}, + null, + /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( + null), + 0); + +proto.jspb.test.TestLastFieldBeforePivot.extensionsBinary[101] = new jspb.ExtensionFieldBinaryInfo( + proto.jspb.test.extendTestLastFieldBeforePivotField, + jspb.BinaryReader.prototype.readInt32, + jspb.BinaryWriter.prototype.writeInt32, + undefined, + undefined, + false); +// This registers the extension field with the extended class, so that +// toObject() will function correctly. +proto.jspb.test.TestLastFieldBeforePivot.extensions[101] = proto.jspb.test.extendTestLastFieldBeforePivotField; + +export const BooleanFields = proto.jspb.test.BooleanFields; +export const CloneExtension = proto.jspb.test.CloneExtension; +export const Complex = proto.jspb.test.Complex; +export const ComplexNested = proto.jspb.test.Complex.Nested; +export const Deeply = proto.jspb.test.Deeply; +export const DeeplyNested = proto.jspb.test.Deeply.Nested; +export const DeeplyNestedMessage = proto.jspb.test.Deeply.Nested.Message; +export const DefaultValues = proto.jspb.test.DefaultValues; +export const DefaultValuesEnum = proto.jspb.test.DefaultValues.Enum; +export const Empty = proto.jspb.test.Empty; +export const EnumContainer = proto.jspb.test.EnumContainer; +export const FloatingPointFields = proto.jspb.test.FloatingPointFields; +export const HasExtensions = proto.jspb.test.HasExtensions; +export const IndirectExtension = proto.jspb.test.IndirectExtension; +export const Int64Types = proto.jspb.test.Int64Types; +export const IsExtension = proto.jspb.test.IsExtension; +export const MapValueEnumNoBinary = proto.jspb.test.MapValueEnumNoBinary; +export const MapValueMessageNoBinary = proto.jspb.test.MapValueMessageNoBinary; +export const MineField = proto.jspb.test.MineField; +export const OptionalFields = proto.jspb.test.OptionalFields; +export const OptionalFieldsNested = proto.jspb.test.OptionalFields.Nested; +export const OuterEnum = proto.jspb.test.OuterEnum; +export const OuterMessage = proto.jspb.test.OuterMessage; +export const OuterMessageComplex = proto.jspb.test.OuterMessage.Complex; +export const Simple1 = proto.jspb.test.Simple1; +export const Simple2 = proto.jspb.test.Simple2; +export const SpecialCases = proto.jspb.test.SpecialCases; +export const TestAllowAliasEnum = proto.jspb.test.TestAllowAliasEnum; +export const TestClone = proto.jspb.test.TestClone; +export const TestCloneExtension = proto.jspb.test.TestCloneExtension; +export const TestEndsWithBytes = proto.jspb.test.TestEndsWithBytes; +export const TestGroup = proto.jspb.test.TestGroup; +export const TestGroupOptionalGroup = proto.jspb.test.TestGroup.OptionalGroup; +export const TestGroupRepeatedGroup = proto.jspb.test.TestGroup.RepeatedGroup; +export const TestGroupRequiredGroup = proto.jspb.test.TestGroup.RequiredGroup; +export const TestGroup1 = proto.jspb.test.TestGroup1; +export const TestLastFieldBeforePivot = proto.jspb.test.TestLastFieldBeforePivot; +export const TestMapFieldsNoBinary = proto.jspb.test.TestMapFieldsNoBinary; +export const TestMessageWithOneof = proto.jspb.test.TestMessageWithOneof; +export const TestMessageWithOneofDefaultOneofACase = proto.jspb.test.TestMessageWithOneof.DefaultOneofACase; +export const TestMessageWithOneofDefaultOneofBCase = proto.jspb.test.TestMessageWithOneof.DefaultOneofBCase; +export const TestMessageWithOneofPartialOneofCase = proto.jspb.test.TestMessageWithOneof.PartialOneofCase; +export const TestMessageWithOneofRecursiveOneofCase = proto.jspb.test.TestMessageWithOneof.RecursiveOneofCase; +export const TestReservedNames = proto.jspb.test.TestReservedNames; +export const TestReservedNamesExtension = proto.jspb.test.TestReservedNamesExtension; +export const extendTestLastFieldBeforePivotField = proto.jspb.test.extendTestLastFieldBeforePivotField; +export const simple1 = proto.jspb.test.simple1; From e5abd3a7f413b68f149d052fc5d5c398e0addfdf Mon Sep 17 00:00:00 2001 From: Jacob Fugal Date: Mon, 6 Jan 2025 11:33:56 -0700 Subject: [PATCH 4/6] remove unneeded `goog.object.extend` --- example/test.js | 1 - generator/js_generator.cc | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/example/test.js b/example/test.js index f73fc75..6c46f57 100644 --- a/example/test.js +++ b/example/test.js @@ -16,7 +16,6 @@ var goog = jspb; var proto = {}; import * as google_protobuf_descriptor_pb from 'google-protobuf/google/protobuf/descriptor.js'; -goog.object.extend(proto, google_protobuf_descriptor_pb); goog.exportSymbol('proto.jspb.test.BooleanFields', null, global); goog.exportSymbol('proto.jspb.test.CloneExtension', null, global); goog.exportSymbol('proto.jspb.test.Complex', null, global); diff --git a/generator/js_generator.cc b/generator/js_generator.cc index 227529d..fcbd3bb 100644 --- a/generator/js_generator.cc +++ b/generator/js_generator.cc @@ -3680,10 +3680,10 @@ void Generator::GenerateFile(const GeneratorOptions& options, if (options.import_style == GeneratorOptions::kImportEs6) { for (int i = 0; i < file->dependency_count(); i++) { const std::string& name = file->dependency(i)->name(); - printer->Print("import * as $alias$ from '$file$';\n" - "goog.object.extend(proto, $alias$);\n", - "alias", ModuleAlias(name), "file", - GetRootPath(file->name(), name) + GetJSFilename(options, name)); + printer->Print( + "import * as $alias$ from '$file$';\n", "alias", ModuleAlias(name), + "file", + GetRootPath(file->name(), name) + GetJSFilename(options, name)); } } else { for (int i = 0; i < file->dependency_count(); i++) { From 1d39c5c6146db2190dea25113177a4d41fb2b5b0 Mon Sep 17 00:00:00 2001 From: Jacob Fugal Date: Wed, 15 Jan 2025 14:07:45 -0700 Subject: [PATCH 5/6] PR feedback --- example/test.d.ts | 1736 +++++++++----------- example/test.js | 2369 +++++++++++++-------------- generator/js_generator.cc | 627 ++++--- generator/js_generator.h | 10 +- generator/well_known_types_embed.cc | 288 +++- generator/well_known_types_embed.h | 1 + 6 files changed, 2579 insertions(+), 2452 deletions(-) diff --git a/example/test.d.ts b/example/test.d.ts index b5944de..918f9e5 100644 --- a/example/test.d.ts +++ b/example/test.d.ts @@ -1,1013 +1,809 @@ -declare namespace proto.jspb.test { - export class Empty extends jspb.Message { +import * as jspb from 'google-protobuf'; + +export class Empty extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): { [key: string]: unknown }; + static toObject(includeInstance: boolean | undefined, msg: Empty): { [key: string]: unknown }; + static deserializeBinary(bytes: jspb.ByteSource): Empty; + static deserializeBinaryFromReader(msg: Empty, reader: jspb.BinaryReader): Empty; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: Empty, writer: jspb.BinaryWriter): void; +} + +export class EnumContainer extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): { [key: string]: unknown }; + static toObject(includeInstance: boolean | undefined, msg: EnumContainer): { [key: string]: unknown }; + static deserializeBinary(bytes: jspb.ByteSource): EnumContainer; + static deserializeBinaryFromReader(msg: EnumContainer, reader: jspb.BinaryReader): EnumContainer; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: EnumContainer, writer: jspb.BinaryWriter): void; + getOuterEnum(): OuterEnum; + setOuterEnum(value: OuterEnum): EnumContainer; + clearOuterEnum(): EnumContainer; + hasOuterEnum(): boolean; +} + +export class Simple1 extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): { [key: string]: unknown }; + static toObject(includeInstance: boolean | undefined, msg: Simple1): { [key: string]: unknown }; + static deserializeBinary(bytes: jspb.ByteSource): Simple1; + static deserializeBinaryFromReader(msg: Simple1, reader: jspb.BinaryReader): Simple1; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: Simple1, writer: jspb.BinaryWriter): void; + getAString(): string; + setAString(value: string): Simple1; + clearAString(): Simple1; + hasAString(): boolean; + getARepeatedStringList(): string[]; + setARepeatedStringList(value: string[]): Simple1; + addARepeatedString(value: string, index?: number): Simple1; + clearARepeatedStringList(): Simple1; + getABoolean(): boolean; + setABoolean(value: boolean): Simple1; + clearABoolean(): Simple1; + hasABoolean(): boolean; +} + +export class Simple2 extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): { [key: string]: unknown }; + static toObject(includeInstance: boolean | undefined, msg: Simple2): { [key: string]: unknown }; + static deserializeBinary(bytes: jspb.ByteSource): Simple2; + static deserializeBinaryFromReader(msg: Simple2, reader: jspb.BinaryReader): Simple2; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: Simple2, writer: jspb.BinaryWriter): void; + getAString(): string; + setAString(value: string): Simple2; + clearAString(): Simple2; + hasAString(): boolean; + getARepeatedStringList(): string[]; + setARepeatedStringList(value: string[]): Simple2; + addARepeatedString(value: string, index?: number): Simple2; + clearARepeatedStringList(): Simple2; +} + +export class SpecialCases extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): { [key: string]: unknown }; + static toObject(includeInstance: boolean | undefined, msg: SpecialCases): { [key: string]: unknown }; + static deserializeBinary(bytes: jspb.ByteSource): SpecialCases; + static deserializeBinaryFromReader(msg: SpecialCases, reader: jspb.BinaryReader): SpecialCases; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: SpecialCases, writer: jspb.BinaryWriter): void; + getNormal(): string; + setNormal(value: string): SpecialCases; + clearNormal(): SpecialCases; + hasNormal(): boolean; + getDefault(): string; + setDefault(value: string): SpecialCases; + clearDefault(): SpecialCases; + hasDefault(): boolean; + getFunction(): string; + setFunction(value: string): SpecialCases; + clearFunction(): SpecialCases; + hasFunction(): boolean; + getVar(): string; + setVar(value: string): SpecialCases; + clearVar(): SpecialCases; + hasVar(): boolean; +} + +export class OptionalFields extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): { [key: string]: unknown }; + static toObject(includeInstance: boolean | undefined, msg: OptionalFields): { [key: string]: unknown }; + static deserializeBinary(bytes: jspb.ByteSource): OptionalFields; + static deserializeBinaryFromReader(msg: OptionalFields, reader: jspb.BinaryReader): OptionalFields; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: OptionalFields, writer: jspb.BinaryWriter): void; + getAString(): string; + setAString(value: string): OptionalFields; + clearAString(): OptionalFields; + hasAString(): boolean; + getABool(): boolean; + setABool(value: boolean): OptionalFields; + clearABool(): OptionalFields; + hasABool(): boolean; + getANestedMessage(): OptionalFields.Nested | null; + setANestedMessage(value: OptionalFields.Nested | null | undefined): OptionalFields; + clearANestedMessage(): OptionalFields; + hasANestedMessage(): boolean; + getARepeatedMessageList(): OptionalFields.Nested[]; + setARepeatedMessageList(value: OptionalFields.Nested[]): OptionalFields; + addARepeatedMessage(value?: OptionalFields.Nested, index?: number): OptionalFields.Nested; + clearARepeatedMessageList(): OptionalFields; + getARepeatedStringList(): string[]; + setARepeatedStringList(value: string[]): OptionalFields; + addARepeatedString(value: string, index?: number): OptionalFields; + clearARepeatedStringList(): OptionalFields; +} + +export namespace OptionalFields { + class Nested extends jspb.Message { constructor(data?: any[] | null); - toObject(includeInstance?: boolean): GlobalObject; - static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.Empty): GlobalObject; - static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.Empty; - static deserializeBinaryFromReader(msg: proto.jspb.test.Empty, reader: jspb.BinaryReader): proto.jspb.test.Empty; + toObject(includeInstance?: boolean): { [key: string]: unknown }; + static toObject(includeInstance: boolean | undefined, msg: OptionalFields.Nested): { [key: string]: unknown }; + static deserializeBinary(bytes: jspb.ByteSource): OptionalFields.Nested; + static deserializeBinaryFromReader(msg: OptionalFields.Nested, reader: jspb.BinaryReader): OptionalFields.Nested; serializeBinary(): Uint8Array; - static serializeBinaryToWriter(message: proto.jspb.test.Empty, writer: jspb.BinaryWriter): void; - } - - export class EnumContainer extends jspb.Message { - constructor(data?: any[] | null); - toObject(includeInstance?: boolean): GlobalObject; - static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.EnumContainer): GlobalObject; - static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.EnumContainer; - static deserializeBinaryFromReader(msg: proto.jspb.test.EnumContainer, reader: jspb.BinaryReader): proto.jspb.test.EnumContainer; - serializeBinary(): Uint8Array; - static serializeBinaryToWriter(message: proto.jspb.test.EnumContainer, writer: jspb.BinaryWriter): void; - getOuterEnum(): proto.jspb.test.OuterEnum; - setOuterEnum(value: proto.jspb.test.OuterEnum): proto.jspb.test.EnumContainer; - clearOuterEnum(): proto.jspb.test.EnumContainer; - hasOuterEnum(): boolean; - } - - export class Simple1 extends jspb.Message { - constructor(data?: any[] | null); - toObject(includeInstance?: boolean): GlobalObject; - static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.Simple1): GlobalObject; - static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.Simple1; - static deserializeBinaryFromReader(msg: proto.jspb.test.Simple1, reader: jspb.BinaryReader): proto.jspb.test.Simple1; - serializeBinary(): Uint8Array; - static serializeBinaryToWriter(message: proto.jspb.test.Simple1, writer: jspb.BinaryWriter): void; - getAString(): string; - setAString(value: string): proto.jspb.test.Simple1; - clearAString(): proto.jspb.test.Simple1; - hasAString(): boolean; - getARepeatedStringList(): string[]; - setARepeatedStringList(value: string[]): proto.jspb.test.Simple1; - addARepeatedString(value: string, index?: number): proto.jspb.test.Simple1; - clearARepeatedStringList(): proto.jspb.test.Simple1; - getABoolean(): boolean; - setABoolean(value: boolean): proto.jspb.test.Simple1; - clearABoolean(): proto.jspb.test.Simple1; - hasABoolean(): boolean; - } - - export class Simple2 extends jspb.Message { - constructor(data?: any[] | null); - toObject(includeInstance?: boolean): GlobalObject; - static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.Simple2): GlobalObject; - static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.Simple2; - static deserializeBinaryFromReader(msg: proto.jspb.test.Simple2, reader: jspb.BinaryReader): proto.jspb.test.Simple2; - serializeBinary(): Uint8Array; - static serializeBinaryToWriter(message: proto.jspb.test.Simple2, writer: jspb.BinaryWriter): void; - getAString(): string; - setAString(value: string): proto.jspb.test.Simple2; - clearAString(): proto.jspb.test.Simple2; - hasAString(): boolean; - getARepeatedStringList(): string[]; - setARepeatedStringList(value: string[]): proto.jspb.test.Simple2; - addARepeatedString(value: string, index?: number): proto.jspb.test.Simple2; - clearARepeatedStringList(): proto.jspb.test.Simple2; - } - - export class SpecialCases extends jspb.Message { - constructor(data?: any[] | null); - toObject(includeInstance?: boolean): GlobalObject; - static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.SpecialCases): GlobalObject; - static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.SpecialCases; - static deserializeBinaryFromReader(msg: proto.jspb.test.SpecialCases, reader: jspb.BinaryReader): proto.jspb.test.SpecialCases; - serializeBinary(): Uint8Array; - static serializeBinaryToWriter(message: proto.jspb.test.SpecialCases, writer: jspb.BinaryWriter): void; - getNormal(): string; - setNormal(value: string): proto.jspb.test.SpecialCases; - clearNormal(): proto.jspb.test.SpecialCases; - hasNormal(): boolean; - getDefault(): string; - setDefault(value: string): proto.jspb.test.SpecialCases; - clearDefault(): proto.jspb.test.SpecialCases; - hasDefault(): boolean; - getFunction(): string; - setFunction(value: string): proto.jspb.test.SpecialCases; - clearFunction(): proto.jspb.test.SpecialCases; - hasFunction(): boolean; - getVar(): string; - setVar(value: string): proto.jspb.test.SpecialCases; - clearVar(): proto.jspb.test.SpecialCases; - hasVar(): boolean; - } - - export class OptionalFields extends jspb.Message { + static serializeBinaryToWriter(message: OptionalFields.Nested, writer: jspb.BinaryWriter): void; + getAnInt(): number; + setAnInt(value: number): OptionalFields.Nested; + clearAnInt(): OptionalFields.Nested; + hasAnInt(): boolean; + } + +} + +export class HasExtensions extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): { [key: string]: unknown }; + static toObject(includeInstance: boolean | undefined, msg: HasExtensions): { [key: string]: unknown }; + static deserializeBinary(bytes: jspb.ByteSource): HasExtensions; + static deserializeBinaryFromReader(msg: HasExtensions, reader: jspb.BinaryReader): HasExtensions; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: HasExtensions, writer: jspb.BinaryWriter): void; + getStr1(): string; + setStr1(value: string): HasExtensions; + clearStr1(): HasExtensions; + hasStr1(): boolean; + getStr2(): string; + setStr2(value: string): HasExtensions; + clearStr2(): HasExtensions; + hasStr2(): boolean; + getStr3(): string; + setStr3(value: string): HasExtensions; + clearStr3(): HasExtensions; + hasStr3(): boolean; +} + +export class Complex extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): { [key: string]: unknown }; + static toObject(includeInstance: boolean | undefined, msg: Complex): { [key: string]: unknown }; + static deserializeBinary(bytes: jspb.ByteSource): Complex; + static deserializeBinaryFromReader(msg: Complex, reader: jspb.BinaryReader): Complex; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: Complex, writer: jspb.BinaryWriter): void; + getAString(): string; + setAString(value: string): Complex; + clearAString(): Complex; + hasAString(): boolean; + getAnOutOfOrderBool(): boolean; + setAnOutOfOrderBool(value: boolean): Complex; + clearAnOutOfOrderBool(): Complex; + hasAnOutOfOrderBool(): boolean; + getANestedMessage(): Complex.Nested | null; + setANestedMessage(value: Complex.Nested | null | undefined): Complex; + clearANestedMessage(): Complex; + hasANestedMessage(): boolean; + getARepeatedMessageList(): Complex.Nested[]; + setARepeatedMessageList(value: Complex.Nested[]): Complex; + addARepeatedMessage(value?: Complex.Nested, index?: number): Complex.Nested; + clearARepeatedMessageList(): Complex; + getARepeatedStringList(): string[]; + setARepeatedStringList(value: string[]): Complex; + addARepeatedString(value: string, index?: number): Complex; + clearARepeatedStringList(): Complex; + getAFloatingPointField(): number; + setAFloatingPointField(value: number): Complex; + clearAFloatingPointField(): Complex; + hasAFloatingPointField(): boolean; +} + +export namespace Complex { + class Nested extends jspb.Message { constructor(data?: any[] | null); - toObject(includeInstance?: boolean): GlobalObject; - static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.OptionalFields): GlobalObject; - static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.OptionalFields; - static deserializeBinaryFromReader(msg: proto.jspb.test.OptionalFields, reader: jspb.BinaryReader): proto.jspb.test.OptionalFields; + toObject(includeInstance?: boolean): { [key: string]: unknown }; + static toObject(includeInstance: boolean | undefined, msg: Complex.Nested): { [key: string]: unknown }; + static deserializeBinary(bytes: jspb.ByteSource): Complex.Nested; + static deserializeBinaryFromReader(msg: Complex.Nested, reader: jspb.BinaryReader): Complex.Nested; serializeBinary(): Uint8Array; - static serializeBinaryToWriter(message: proto.jspb.test.OptionalFields, writer: jspb.BinaryWriter): void; - export class Nested extends jspb.Message { - constructor(data?: any[] | null); - toObject(includeInstance?: boolean): GlobalObject; - static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.OptionalFields.Nested): GlobalObject; - static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.OptionalFields.Nested; - static deserializeBinaryFromReader(msg: proto.jspb.test.OptionalFields.Nested, reader: jspb.BinaryReader): proto.jspb.test.OptionalFields.Nested; - serializeBinary(): Uint8Array; - static serializeBinaryToWriter(message: proto.jspb.test.OptionalFields.Nested, writer: jspb.BinaryWriter): void; - getAnInt(): number; - setAnInt(value: number): proto.jspb.test.OptionalFields.Nested; - clearAnInt(): proto.jspb.test.OptionalFields.Nested; - hasAnInt(): boolean; - } - - getAString(): string; - setAString(value: string): proto.jspb.test.OptionalFields; - clearAString(): proto.jspb.test.OptionalFields; - hasAString(): boolean; - getABool(): boolean; - setABool(value: boolean): proto.jspb.test.OptionalFields; - clearABool(): proto.jspb.test.OptionalFields; - hasABool(): boolean; - getANestedMessage(): proto.jspb.test.OptionalFields.Nested | null; - setANestedMessage(value: proto.jspb.test.OptionalFields.Nested | null | undefined): proto.jspb.test.OptionalFields; - clearANestedMessage(): proto.jspb.test.OptionalFields; - hasANestedMessage(): boolean; - getARepeatedMessageList(): proto.jspb.test.OptionalFields.Nested[]; - setARepeatedMessageList(value: proto.jspb.test.OptionalFields.Nested[]): proto.jspb.test.OptionalFields; - addARepeatedMessage(value?: proto.jspb.test.OptionalFields.Nested, index?: number): proto.jspb.test.OptionalFields.Nested; - clearARepeatedMessageList(): proto.jspb.test.OptionalFields; - getARepeatedStringList(): string[]; - setARepeatedStringList(value: string[]): proto.jspb.test.OptionalFields; - addARepeatedString(value: string, index?: number): proto.jspb.test.OptionalFields; - clearARepeatedStringList(): proto.jspb.test.OptionalFields; + static serializeBinaryToWriter(message: Complex.Nested, writer: jspb.BinaryWriter): void; + getAnInt(): number; + setAnInt(value: number): Complex.Nested; + clearAnInt(): Complex.Nested; + hasAnInt(): boolean; } - export class HasExtensions extends jspb.Message { - constructor(data?: any[] | null); - toObject(includeInstance?: boolean): GlobalObject; - static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.HasExtensions): GlobalObject; - static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.HasExtensions; - static deserializeBinaryFromReader(msg: proto.jspb.test.HasExtensions, reader: jspb.BinaryReader): proto.jspb.test.HasExtensions; - serializeBinary(): Uint8Array; - static serializeBinaryToWriter(message: proto.jspb.test.HasExtensions, writer: jspb.BinaryWriter): void; - getStr1(): string; - setStr1(value: string): proto.jspb.test.HasExtensions; - clearStr1(): proto.jspb.test.HasExtensions; - hasStr1(): boolean; - getStr2(): string; - setStr2(value: string): proto.jspb.test.HasExtensions; - clearStr2(): proto.jspb.test.HasExtensions; - hasStr2(): boolean; - getStr3(): string; - setStr3(value: string): proto.jspb.test.HasExtensions; - clearStr3(): proto.jspb.test.HasExtensions; - hasStr3(): boolean; - } - - export class Complex extends jspb.Message { - constructor(data?: any[] | null); - toObject(includeInstance?: boolean): GlobalObject; - static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.Complex): GlobalObject; - static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.Complex; - static deserializeBinaryFromReader(msg: proto.jspb.test.Complex, reader: jspb.BinaryReader): proto.jspb.test.Complex; - serializeBinary(): Uint8Array; - static serializeBinaryToWriter(message: proto.jspb.test.Complex, writer: jspb.BinaryWriter): void; - export class Nested extends jspb.Message { - constructor(data?: any[] | null); - toObject(includeInstance?: boolean): GlobalObject; - static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.Complex.Nested): GlobalObject; - static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.Complex.Nested; - static deserializeBinaryFromReader(msg: proto.jspb.test.Complex.Nested, reader: jspb.BinaryReader): proto.jspb.test.Complex.Nested; - serializeBinary(): Uint8Array; - static serializeBinaryToWriter(message: proto.jspb.test.Complex.Nested, writer: jspb.BinaryWriter): void; - getAnInt(): number; - setAnInt(value: number): proto.jspb.test.Complex.Nested; - clearAnInt(): proto.jspb.test.Complex.Nested; - hasAnInt(): boolean; - } - - getAString(): string; - setAString(value: string): proto.jspb.test.Complex; - clearAString(): proto.jspb.test.Complex; - hasAString(): boolean; - getAnOutOfOrderBool(): boolean; - setAnOutOfOrderBool(value: boolean): proto.jspb.test.Complex; - clearAnOutOfOrderBool(): proto.jspb.test.Complex; - hasAnOutOfOrderBool(): boolean; - getANestedMessage(): proto.jspb.test.Complex.Nested | null; - setANestedMessage(value: proto.jspb.test.Complex.Nested | null | undefined): proto.jspb.test.Complex; - clearANestedMessage(): proto.jspb.test.Complex; - hasANestedMessage(): boolean; - getARepeatedMessageList(): proto.jspb.test.Complex.Nested[]; - setARepeatedMessageList(value: proto.jspb.test.Complex.Nested[]): proto.jspb.test.Complex; - addARepeatedMessage(value?: proto.jspb.test.Complex.Nested, index?: number): proto.jspb.test.Complex.Nested; - clearARepeatedMessageList(): proto.jspb.test.Complex; - getARepeatedStringList(): string[]; - setARepeatedStringList(value: string[]): proto.jspb.test.Complex; - addARepeatedString(value: string, index?: number): proto.jspb.test.Complex; - clearARepeatedStringList(): proto.jspb.test.Complex; - getAFloatingPointField(): number; - setAFloatingPointField(value: number): proto.jspb.test.Complex; - clearAFloatingPointField(): proto.jspb.test.Complex; - hasAFloatingPointField(): boolean; - } - - export class OuterMessage extends jspb.Message { - constructor(data?: any[] | null); - toObject(includeInstance?: boolean): GlobalObject; - static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.OuterMessage): GlobalObject; - static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.OuterMessage; - static deserializeBinaryFromReader(msg: proto.jspb.test.OuterMessage, reader: jspb.BinaryReader): proto.jspb.test.OuterMessage; - serializeBinary(): Uint8Array; - static serializeBinaryToWriter(message: proto.jspb.test.OuterMessage, writer: jspb.BinaryWriter): void; - export class Complex extends jspb.Message { - constructor(data?: any[] | null); - toObject(includeInstance?: boolean): GlobalObject; - static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.OuterMessage.Complex): GlobalObject; - static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.OuterMessage.Complex; - static deserializeBinaryFromReader(msg: proto.jspb.test.OuterMessage.Complex, reader: jspb.BinaryReader): proto.jspb.test.OuterMessage.Complex; - serializeBinary(): Uint8Array; - static serializeBinaryToWriter(message: proto.jspb.test.OuterMessage.Complex, writer: jspb.BinaryWriter): void; - getInnerComplexField(): number; - setInnerComplexField(value: number): proto.jspb.test.OuterMessage.Complex; - clearInnerComplexField(): proto.jspb.test.OuterMessage.Complex; - hasInnerComplexField(): boolean; - } - - } - - export class MineField extends jspb.Message { - constructor(data?: any[] | null); - toObject(includeInstance?: boolean): GlobalObject; - static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.MineField): GlobalObject; - static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.MineField; - static deserializeBinaryFromReader(msg: proto.jspb.test.MineField, reader: jspb.BinaryReader): proto.jspb.test.MineField; - serializeBinary(): Uint8Array; - static serializeBinaryToWriter(message: proto.jspb.test.MineField, writer: jspb.BinaryWriter): void; - getCookie(): string; - setCookie(value: string): proto.jspb.test.MineField; - clearCookie(): proto.jspb.test.MineField; - hasCookie(): boolean; - } - - export class IsExtension extends jspb.Message { - constructor(data?: any[] | null); - toObject(includeInstance?: boolean): GlobalObject; - static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.IsExtension): GlobalObject; - static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.IsExtension; - static deserializeBinaryFromReader(msg: proto.jspb.test.IsExtension, reader: jspb.BinaryReader): proto.jspb.test.IsExtension; - serializeBinary(): Uint8Array; - static serializeBinaryToWriter(message: proto.jspb.test.IsExtension, writer: jspb.BinaryWriter): void; - getExt1(): string; - setExt1(value: string): proto.jspb.test.IsExtension; - clearExt1(): proto.jspb.test.IsExtension; - hasExt1(): boolean; - } - - export class IndirectExtension extends jspb.Message { - constructor(data?: any[] | null); - toObject(includeInstance?: boolean): GlobalObject; - static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.IndirectExtension): GlobalObject; - static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.IndirectExtension; - static deserializeBinaryFromReader(msg: proto.jspb.test.IndirectExtension, reader: jspb.BinaryReader): proto.jspb.test.IndirectExtension; - serializeBinary(): Uint8Array; - static serializeBinaryToWriter(message: proto.jspb.test.IndirectExtension, writer: jspb.BinaryWriter): void; - } - - export class DefaultValues extends jspb.Message { - constructor(data?: any[] | null); - toObject(includeInstance?: boolean): GlobalObject; - static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.DefaultValues): GlobalObject; - static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.DefaultValues; - static deserializeBinaryFromReader(msg: proto.jspb.test.DefaultValues, reader: jspb.BinaryReader): proto.jspb.test.DefaultValues; - serializeBinary(): Uint8Array; - static serializeBinaryToWriter(message: proto.jspb.test.DefaultValues, writer: jspb.BinaryWriter): void; - enum Enum { - E1 = 13, - E2 = 77, - } - - getStringField(): string; - setStringField(value: string): proto.jspb.test.DefaultValues; - clearStringField(): proto.jspb.test.DefaultValues; - hasStringField(): boolean; - getBoolField(): boolean; - setBoolField(value: boolean): proto.jspb.test.DefaultValues; - clearBoolField(): proto.jspb.test.DefaultValues; - hasBoolField(): boolean; - getIntField(): number; - setIntField(value: number): proto.jspb.test.DefaultValues; - clearIntField(): proto.jspb.test.DefaultValues; - hasIntField(): boolean; - getEnumField(): proto.jspb.test.DefaultValues.Enum; - setEnumField(value: proto.jspb.test.DefaultValues.Enum): proto.jspb.test.DefaultValues; - clearEnumField(): proto.jspb.test.DefaultValues; - hasEnumField(): boolean; - getEmptyField(): string; - setEmptyField(value: string): proto.jspb.test.DefaultValues; - clearEmptyField(): proto.jspb.test.DefaultValues; - hasEmptyField(): boolean; - getBytesField(): (string|Uint8Array); - getBytesField_asB64(): string; - getBytesField_asU8(): Uint8Array; - setBytesField(value: (string|Uint8Array)): proto.jspb.test.DefaultValues; - clearBytesField(): proto.jspb.test.DefaultValues; - hasBytesField(): boolean; - } - - export class FloatingPointFields extends jspb.Message { - constructor(data?: any[] | null); - toObject(includeInstance?: boolean): GlobalObject; - static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.FloatingPointFields): GlobalObject; - static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.FloatingPointFields; - static deserializeBinaryFromReader(msg: proto.jspb.test.FloatingPointFields, reader: jspb.BinaryReader): proto.jspb.test.FloatingPointFields; - serializeBinary(): Uint8Array; - static serializeBinaryToWriter(message: proto.jspb.test.FloatingPointFields, writer: jspb.BinaryWriter): void; - getOptionalFloatField(): number; - setOptionalFloatField(value: number): proto.jspb.test.FloatingPointFields; - clearOptionalFloatField(): proto.jspb.test.FloatingPointFields; - hasOptionalFloatField(): boolean; - getRequiredFloatField(): number; - setRequiredFloatField(value: number): proto.jspb.test.FloatingPointFields; - clearRequiredFloatField(): proto.jspb.test.FloatingPointFields; - hasRequiredFloatField(): boolean; - getRepeatedFloatFieldList(): number[]; - setRepeatedFloatFieldList(value: number[]): proto.jspb.test.FloatingPointFields; - addRepeatedFloatField(value: number, index?: number): proto.jspb.test.FloatingPointFields; - clearRepeatedFloatFieldList(): proto.jspb.test.FloatingPointFields; - getDefaultFloatField(): number; - setDefaultFloatField(value: number): proto.jspb.test.FloatingPointFields; - clearDefaultFloatField(): proto.jspb.test.FloatingPointFields; - hasDefaultFloatField(): boolean; - getOptionalDoubleField(): number; - setOptionalDoubleField(value: number): proto.jspb.test.FloatingPointFields; - clearOptionalDoubleField(): proto.jspb.test.FloatingPointFields; - hasOptionalDoubleField(): boolean; - getRequiredDoubleField(): number; - setRequiredDoubleField(value: number): proto.jspb.test.FloatingPointFields; - clearRequiredDoubleField(): proto.jspb.test.FloatingPointFields; - hasRequiredDoubleField(): boolean; - getRepeatedDoubleFieldList(): number[]; - setRepeatedDoubleFieldList(value: number[]): proto.jspb.test.FloatingPointFields; - addRepeatedDoubleField(value: number, index?: number): proto.jspb.test.FloatingPointFields; - clearRepeatedDoubleFieldList(): proto.jspb.test.FloatingPointFields; - getDefaultDoubleField(): number; - setDefaultDoubleField(value: number): proto.jspb.test.FloatingPointFields; - clearDefaultDoubleField(): proto.jspb.test.FloatingPointFields; - hasDefaultDoubleField(): boolean; - } - - export class BooleanFields extends jspb.Message { - constructor(data?: any[] | null); - toObject(includeInstance?: boolean): GlobalObject; - static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.BooleanFields): GlobalObject; - static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.BooleanFields; - static deserializeBinaryFromReader(msg: proto.jspb.test.BooleanFields, reader: jspb.BinaryReader): proto.jspb.test.BooleanFields; - serializeBinary(): Uint8Array; - static serializeBinaryToWriter(message: proto.jspb.test.BooleanFields, writer: jspb.BinaryWriter): void; - getOptionalBooleanField(): boolean; - setOptionalBooleanField(value: boolean): proto.jspb.test.BooleanFields; - clearOptionalBooleanField(): proto.jspb.test.BooleanFields; - hasOptionalBooleanField(): boolean; - getRequiredBooleanField(): boolean; - setRequiredBooleanField(value: boolean): proto.jspb.test.BooleanFields; - clearRequiredBooleanField(): proto.jspb.test.BooleanFields; - hasRequiredBooleanField(): boolean; - getRepeatedBooleanFieldList(): boolean[]; - setRepeatedBooleanFieldList(value: boolean[]): proto.jspb.test.BooleanFields; - addRepeatedBooleanField(value: boolean, index?: number): proto.jspb.test.BooleanFields; - clearRepeatedBooleanFieldList(): proto.jspb.test.BooleanFields; - getDefaultBooleanField(): boolean; - setDefaultBooleanField(value: boolean): proto.jspb.test.BooleanFields; - clearDefaultBooleanField(): proto.jspb.test.BooleanFields; - hasDefaultBooleanField(): boolean; - } - - export class TestClone extends jspb.Message { - constructor(data?: any[] | null); - toObject(includeInstance?: boolean): GlobalObject; - static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.TestClone): GlobalObject; - static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.TestClone; - static deserializeBinaryFromReader(msg: proto.jspb.test.TestClone, reader: jspb.BinaryReader): proto.jspb.test.TestClone; - serializeBinary(): Uint8Array; - static serializeBinaryToWriter(message: proto.jspb.test.TestClone, writer: jspb.BinaryWriter): void; - getStr(): string; - setStr(value: string): proto.jspb.test.TestClone; - clearStr(): proto.jspb.test.TestClone; - hasStr(): boolean; - getSimple1(): proto.jspb.test.Simple1 | null; - setSimple1(value: proto.jspb.test.Simple1 | null | undefined): proto.jspb.test.TestClone; - clearSimple1(): proto.jspb.test.TestClone; - hasSimple1(): boolean; - getSimple2List(): proto.jspb.test.Simple1[]; - setSimple2List(value: proto.jspb.test.Simple1[]): proto.jspb.test.TestClone; - addSimple2(value?: proto.jspb.test.Simple1, index?: number): proto.jspb.test.Simple1; - clearSimple2List(): proto.jspb.test.TestClone; - getBytesField(): (string|Uint8Array); - getBytesField_asB64(): string; - getBytesField_asU8(): Uint8Array; - setBytesField(value: (string|Uint8Array)): proto.jspb.test.TestClone; - clearBytesField(): proto.jspb.test.TestClone; - hasBytesField(): boolean; - getUnused(): string; - setUnused(value: string): proto.jspb.test.TestClone; - clearUnused(): proto.jspb.test.TestClone; - hasUnused(): boolean; - } +} - export class TestCloneExtension extends jspb.Message { - constructor(data?: any[] | null); - toObject(includeInstance?: boolean): GlobalObject; - static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.TestCloneExtension): GlobalObject; - static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.TestCloneExtension; - static deserializeBinaryFromReader(msg: proto.jspb.test.TestCloneExtension, reader: jspb.BinaryReader): proto.jspb.test.TestCloneExtension; - serializeBinary(): Uint8Array; - static serializeBinaryToWriter(message: proto.jspb.test.TestCloneExtension, writer: jspb.BinaryWriter): void; - getF(): number; - setF(value: number): proto.jspb.test.TestCloneExtension; - clearF(): proto.jspb.test.TestCloneExtension; - hasF(): boolean; - } +export class OuterMessage extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): { [key: string]: unknown }; + static toObject(includeInstance: boolean | undefined, msg: OuterMessage): { [key: string]: unknown }; + static deserializeBinary(bytes: jspb.ByteSource): OuterMessage; + static deserializeBinaryFromReader(msg: OuterMessage, reader: jspb.BinaryReader): OuterMessage; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: OuterMessage, writer: jspb.BinaryWriter): void; +} - export class CloneExtension extends jspb.Message { +export namespace OuterMessage { + class Complex extends jspb.Message { constructor(data?: any[] | null); - toObject(includeInstance?: boolean): GlobalObject; - static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.CloneExtension): GlobalObject; - static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.CloneExtension; - static deserializeBinaryFromReader(msg: proto.jspb.test.CloneExtension, reader: jspb.BinaryReader): proto.jspb.test.CloneExtension; + toObject(includeInstance?: boolean): { [key: string]: unknown }; + static toObject(includeInstance: boolean | undefined, msg: OuterMessage.Complex): { [key: string]: unknown }; + static deserializeBinary(bytes: jspb.ByteSource): OuterMessage.Complex; + static deserializeBinaryFromReader(msg: OuterMessage.Complex, reader: jspb.BinaryReader): OuterMessage.Complex; serializeBinary(): Uint8Array; - static serializeBinaryToWriter(message: proto.jspb.test.CloneExtension, writer: jspb.BinaryWriter): void; - getExt(): string; - setExt(value: string): proto.jspb.test.CloneExtension; - clearExt(): proto.jspb.test.CloneExtension; - hasExt(): boolean; - } - - export class TestGroup extends jspb.Message { + static serializeBinaryToWriter(message: OuterMessage.Complex, writer: jspb.BinaryWriter): void; + getInnerComplexField(): number; + setInnerComplexField(value: number): OuterMessage.Complex; + clearInnerComplexField(): OuterMessage.Complex; + hasInnerComplexField(): boolean; + } + +} + +export class MineField extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): { [key: string]: unknown }; + static toObject(includeInstance: boolean | undefined, msg: MineField): { [key: string]: unknown }; + static deserializeBinary(bytes: jspb.ByteSource): MineField; + static deserializeBinaryFromReader(msg: MineField, reader: jspb.BinaryReader): MineField; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: MineField, writer: jspb.BinaryWriter): void; + getCookie(): string; + setCookie(value: string): MineField; + clearCookie(): MineField; + hasCookie(): boolean; +} + +export class IsExtension extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): { [key: string]: unknown }; + static toObject(includeInstance: boolean | undefined, msg: IsExtension): { [key: string]: unknown }; + static deserializeBinary(bytes: jspb.ByteSource): IsExtension; + static deserializeBinaryFromReader(msg: IsExtension, reader: jspb.BinaryReader): IsExtension; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: IsExtension, writer: jspb.BinaryWriter): void; + getExt1(): string; + setExt1(value: string): IsExtension; + clearExt1(): IsExtension; + hasExt1(): boolean; +} + +export class IndirectExtension extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): { [key: string]: unknown }; + static toObject(includeInstance: boolean | undefined, msg: IndirectExtension): { [key: string]: unknown }; + static deserializeBinary(bytes: jspb.ByteSource): IndirectExtension; + static deserializeBinaryFromReader(msg: IndirectExtension, reader: jspb.BinaryReader): IndirectExtension; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: IndirectExtension, writer: jspb.BinaryWriter): void; +} + +export class DefaultValues extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): { [key: string]: unknown }; + static toObject(includeInstance: boolean | undefined, msg: DefaultValues): { [key: string]: unknown }; + static deserializeBinary(bytes: jspb.ByteSource): DefaultValues; + static deserializeBinaryFromReader(msg: DefaultValues, reader: jspb.BinaryReader): DefaultValues; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: DefaultValues, writer: jspb.BinaryWriter): void; + getStringField(): string; + setStringField(value: string): DefaultValues; + clearStringField(): DefaultValues; + hasStringField(): boolean; + getBoolField(): boolean; + setBoolField(value: boolean): DefaultValues; + clearBoolField(): DefaultValues; + hasBoolField(): boolean; + getIntField(): number; + setIntField(value: number): DefaultValues; + clearIntField(): DefaultValues; + hasIntField(): boolean; + getEnumField(): DefaultValues.Enum; + setEnumField(value: DefaultValues.Enum): DefaultValues; + clearEnumField(): DefaultValues; + hasEnumField(): boolean; + getEmptyField(): string; + setEmptyField(value: string): DefaultValues; + clearEmptyField(): DefaultValues; + hasEmptyField(): boolean; + getBytesField(): (string|Uint8Array); + getBytesField_asB64(): string; + getBytesField_asU8(): Uint8Array; + setBytesField(value: (string|Uint8Array)): DefaultValues; + clearBytesField(): DefaultValues; + hasBytesField(): boolean; +} + +export namespace DefaultValues { + enum Enum { + E1 = 13, + E2 = 77, + } + +} + +export class FloatingPointFields extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): { [key: string]: unknown }; + static toObject(includeInstance: boolean | undefined, msg: FloatingPointFields): { [key: string]: unknown }; + static deserializeBinary(bytes: jspb.ByteSource): FloatingPointFields; + static deserializeBinaryFromReader(msg: FloatingPointFields, reader: jspb.BinaryReader): FloatingPointFields; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: FloatingPointFields, writer: jspb.BinaryWriter): void; + getOptionalFloatField(): number; + setOptionalFloatField(value: number): FloatingPointFields; + clearOptionalFloatField(): FloatingPointFields; + hasOptionalFloatField(): boolean; + getRequiredFloatField(): number; + setRequiredFloatField(value: number): FloatingPointFields; + clearRequiredFloatField(): FloatingPointFields; + hasRequiredFloatField(): boolean; + getRepeatedFloatFieldList(): number[]; + setRepeatedFloatFieldList(value: number[]): FloatingPointFields; + addRepeatedFloatField(value: number, index?: number): FloatingPointFields; + clearRepeatedFloatFieldList(): FloatingPointFields; + getDefaultFloatField(): number; + setDefaultFloatField(value: number): FloatingPointFields; + clearDefaultFloatField(): FloatingPointFields; + hasDefaultFloatField(): boolean; + getOptionalDoubleField(): number; + setOptionalDoubleField(value: number): FloatingPointFields; + clearOptionalDoubleField(): FloatingPointFields; + hasOptionalDoubleField(): boolean; + getRequiredDoubleField(): number; + setRequiredDoubleField(value: number): FloatingPointFields; + clearRequiredDoubleField(): FloatingPointFields; + hasRequiredDoubleField(): boolean; + getRepeatedDoubleFieldList(): number[]; + setRepeatedDoubleFieldList(value: number[]): FloatingPointFields; + addRepeatedDoubleField(value: number, index?: number): FloatingPointFields; + clearRepeatedDoubleFieldList(): FloatingPointFields; + getDefaultDoubleField(): number; + setDefaultDoubleField(value: number): FloatingPointFields; + clearDefaultDoubleField(): FloatingPointFields; + hasDefaultDoubleField(): boolean; +} + +export class BooleanFields extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): { [key: string]: unknown }; + static toObject(includeInstance: boolean | undefined, msg: BooleanFields): { [key: string]: unknown }; + static deserializeBinary(bytes: jspb.ByteSource): BooleanFields; + static deserializeBinaryFromReader(msg: BooleanFields, reader: jspb.BinaryReader): BooleanFields; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: BooleanFields, writer: jspb.BinaryWriter): void; + getOptionalBooleanField(): boolean; + setOptionalBooleanField(value: boolean): BooleanFields; + clearOptionalBooleanField(): BooleanFields; + hasOptionalBooleanField(): boolean; + getRequiredBooleanField(): boolean; + setRequiredBooleanField(value: boolean): BooleanFields; + clearRequiredBooleanField(): BooleanFields; + hasRequiredBooleanField(): boolean; + getRepeatedBooleanFieldList(): boolean[]; + setRepeatedBooleanFieldList(value: boolean[]): BooleanFields; + addRepeatedBooleanField(value: boolean, index?: number): BooleanFields; + clearRepeatedBooleanFieldList(): BooleanFields; + getDefaultBooleanField(): boolean; + setDefaultBooleanField(value: boolean): BooleanFields; + clearDefaultBooleanField(): BooleanFields; + hasDefaultBooleanField(): boolean; +} + +export class TestClone extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): { [key: string]: unknown }; + static toObject(includeInstance: boolean | undefined, msg: TestClone): { [key: string]: unknown }; + static deserializeBinary(bytes: jspb.ByteSource): TestClone; + static deserializeBinaryFromReader(msg: TestClone, reader: jspb.BinaryReader): TestClone; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: TestClone, writer: jspb.BinaryWriter): void; + getStr(): string; + setStr(value: string): TestClone; + clearStr(): TestClone; + hasStr(): boolean; + getSimple1(): Simple1 | null; + setSimple1(value: Simple1 | null | undefined): TestClone; + clearSimple1(): TestClone; + hasSimple1(): boolean; + getSimple2List(): Simple1[]; + setSimple2List(value: Simple1[]): TestClone; + addSimple2(value?: Simple1, index?: number): Simple1; + clearSimple2List(): TestClone; + getBytesField(): (string|Uint8Array); + getBytesField_asB64(): string; + getBytesField_asU8(): Uint8Array; + setBytesField(value: (string|Uint8Array)): TestClone; + clearBytesField(): TestClone; + hasBytesField(): boolean; + getUnused(): string; + setUnused(value: string): TestClone; + clearUnused(): TestClone; + hasUnused(): boolean; +} + +export class TestCloneExtension extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): { [key: string]: unknown }; + static toObject(includeInstance: boolean | undefined, msg: TestCloneExtension): { [key: string]: unknown }; + static deserializeBinary(bytes: jspb.ByteSource): TestCloneExtension; + static deserializeBinaryFromReader(msg: TestCloneExtension, reader: jspb.BinaryReader): TestCloneExtension; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: TestCloneExtension, writer: jspb.BinaryWriter): void; + getF(): number; + setF(value: number): TestCloneExtension; + clearF(): TestCloneExtension; + hasF(): boolean; +} + +export class CloneExtension extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): { [key: string]: unknown }; + static toObject(includeInstance: boolean | undefined, msg: CloneExtension): { [key: string]: unknown }; + static deserializeBinary(bytes: jspb.ByteSource): CloneExtension; + static deserializeBinaryFromReader(msg: CloneExtension, reader: jspb.BinaryReader): CloneExtension; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: CloneExtension, writer: jspb.BinaryWriter): void; + getExt(): string; + setExt(value: string): CloneExtension; + clearExt(): CloneExtension; + hasExt(): boolean; +} + +export class TestGroup extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): { [key: string]: unknown }; + static toObject(includeInstance: boolean | undefined, msg: TestGroup): { [key: string]: unknown }; + static deserializeBinary(bytes: jspb.ByteSource): TestGroup; + static deserializeBinaryFromReader(msg: TestGroup, reader: jspb.BinaryReader): TestGroup; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: TestGroup, writer: jspb.BinaryWriter): void; + getRepeatedGroupList(): TestGroup.RepeatedGroup[]; + setRepeatedGroupList(value: TestGroup.RepeatedGroup[]): TestGroup; + addRepeatedGroup(value?: TestGroup.RepeatedGroup, index?: number): TestGroup.RepeatedGroup; + clearRepeatedGroupList(): TestGroup; + getRequiredGroup(): TestGroup.RequiredGroup; + setRequiredGroup(value: TestGroup.RequiredGroup): TestGroup; + clearRequiredGroup(): TestGroup; + hasRequiredGroup(): boolean; + getOptionalGroup(): TestGroup.OptionalGroup | null; + setOptionalGroup(value: TestGroup.OptionalGroup | null | undefined): TestGroup; + clearOptionalGroup(): TestGroup; + hasOptionalGroup(): boolean; + getId(): string; + setId(value: string): TestGroup; + clearId(): TestGroup; + hasId(): boolean; + getRequiredSimple(): Simple2; + setRequiredSimple(value: Simple2): TestGroup; + clearRequiredSimple(): TestGroup; + hasRequiredSimple(): boolean; + getOptionalSimple(): Simple2 | null; + setOptionalSimple(value: Simple2 | null | undefined): TestGroup; + clearOptionalSimple(): TestGroup; + hasOptionalSimple(): boolean; +} + +export namespace TestGroup { + class RepeatedGroup extends jspb.Message { constructor(data?: any[] | null); - toObject(includeInstance?: boolean): GlobalObject; - static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.TestGroup): GlobalObject; - static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.TestGroup; - static deserializeBinaryFromReader(msg: proto.jspb.test.TestGroup, reader: jspb.BinaryReader): proto.jspb.test.TestGroup; + toObject(includeInstance?: boolean): { [key: string]: unknown }; + static toObject(includeInstance: boolean | undefined, msg: TestGroup.RepeatedGroup): { [key: string]: unknown }; + static deserializeBinary(bytes: jspb.ByteSource): TestGroup.RepeatedGroup; + static deserializeBinaryFromReader(msg: TestGroup.RepeatedGroup, reader: jspb.BinaryReader): TestGroup.RepeatedGroup; serializeBinary(): Uint8Array; - static serializeBinaryToWriter(message: proto.jspb.test.TestGroup, writer: jspb.BinaryWriter): void; - export class RepeatedGroup extends jspb.Message { - constructor(data?: any[] | null); - toObject(includeInstance?: boolean): GlobalObject; - static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.TestGroup.RepeatedGroup): GlobalObject; - static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.TestGroup.RepeatedGroup; - static deserializeBinaryFromReader(msg: proto.jspb.test.TestGroup.RepeatedGroup, reader: jspb.BinaryReader): proto.jspb.test.TestGroup.RepeatedGroup; - serializeBinary(): Uint8Array; - static serializeBinaryToWriter(message: proto.jspb.test.TestGroup.RepeatedGroup, writer: jspb.BinaryWriter): void; - getId(): string; - setId(value: string): proto.jspb.test.TestGroup.RepeatedGroup; - clearId(): proto.jspb.test.TestGroup.RepeatedGroup; - hasId(): boolean; - getSomeBoolList(): boolean[]; - setSomeBoolList(value: boolean[]): proto.jspb.test.TestGroup.RepeatedGroup; - addSomeBool(value: boolean, index?: number): proto.jspb.test.TestGroup.RepeatedGroup; - clearSomeBoolList(): proto.jspb.test.TestGroup.RepeatedGroup; - } - - export class RequiredGroup extends jspb.Message { - constructor(data?: any[] | null); - toObject(includeInstance?: boolean): GlobalObject; - static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.TestGroup.RequiredGroup): GlobalObject; - static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.TestGroup.RequiredGroup; - static deserializeBinaryFromReader(msg: proto.jspb.test.TestGroup.RequiredGroup, reader: jspb.BinaryReader): proto.jspb.test.TestGroup.RequiredGroup; - serializeBinary(): Uint8Array; - static serializeBinaryToWriter(message: proto.jspb.test.TestGroup.RequiredGroup, writer: jspb.BinaryWriter): void; - getId(): string; - setId(value: string): proto.jspb.test.TestGroup.RequiredGroup; - clearId(): proto.jspb.test.TestGroup.RequiredGroup; - hasId(): boolean; - } - - export class OptionalGroup extends jspb.Message { - constructor(data?: any[] | null); - toObject(includeInstance?: boolean): GlobalObject; - static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.TestGroup.OptionalGroup): GlobalObject; - static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.TestGroup.OptionalGroup; - static deserializeBinaryFromReader(msg: proto.jspb.test.TestGroup.OptionalGroup, reader: jspb.BinaryReader): proto.jspb.test.TestGroup.OptionalGroup; - serializeBinary(): Uint8Array; - static serializeBinaryToWriter(message: proto.jspb.test.TestGroup.OptionalGroup, writer: jspb.BinaryWriter): void; - getId(): string; - setId(value: string): proto.jspb.test.TestGroup.OptionalGroup; - clearId(): proto.jspb.test.TestGroup.OptionalGroup; - hasId(): boolean; - } - - getRepeatedGroupList(): proto.jspb.test.TestGroup.RepeatedGroup[]; - setRepeatedGroupList(value: proto.jspb.test.TestGroup.RepeatedGroup[]): proto.jspb.test.TestGroup; - addRepeatedGroup(value?: proto.jspb.test.TestGroup.RepeatedGroup, index?: number): proto.jspb.test.TestGroup.RepeatedGroup; - clearRepeatedGroupList(): proto.jspb.test.TestGroup; - getRequiredGroup(): proto.jspb.test.TestGroup.RequiredGroup; - setRequiredGroup(value: proto.jspb.test.TestGroup.RequiredGroup): proto.jspb.test.TestGroup; - clearRequiredGroup(): proto.jspb.test.TestGroup; - hasRequiredGroup(): boolean; - getOptionalGroup(): proto.jspb.test.TestGroup.OptionalGroup | null; - setOptionalGroup(value: proto.jspb.test.TestGroup.OptionalGroup | null | undefined): proto.jspb.test.TestGroup; - clearOptionalGroup(): proto.jspb.test.TestGroup; - hasOptionalGroup(): boolean; + static serializeBinaryToWriter(message: TestGroup.RepeatedGroup, writer: jspb.BinaryWriter): void; getId(): string; - setId(value: string): proto.jspb.test.TestGroup; - clearId(): proto.jspb.test.TestGroup; + setId(value: string): TestGroup.RepeatedGroup; + clearId(): TestGroup.RepeatedGroup; hasId(): boolean; - getRequiredSimple(): proto.jspb.test.Simple2; - setRequiredSimple(value: proto.jspb.test.Simple2): proto.jspb.test.TestGroup; - clearRequiredSimple(): proto.jspb.test.TestGroup; - hasRequiredSimple(): boolean; - getOptionalSimple(): proto.jspb.test.Simple2 | null; - setOptionalSimple(value: proto.jspb.test.Simple2 | null | undefined): proto.jspb.test.TestGroup; - clearOptionalSimple(): proto.jspb.test.TestGroup; - hasOptionalSimple(): boolean; + getSomeBoolList(): boolean[]; + setSomeBoolList(value: boolean[]): TestGroup.RepeatedGroup; + addSomeBool(value: boolean, index?: number): TestGroup.RepeatedGroup; + clearSomeBoolList(): TestGroup.RepeatedGroup; } - export class TestGroup1 extends jspb.Message { + class RequiredGroup extends jspb.Message { constructor(data?: any[] | null); - toObject(includeInstance?: boolean): GlobalObject; - static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.TestGroup1): GlobalObject; - static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.TestGroup1; - static deserializeBinaryFromReader(msg: proto.jspb.test.TestGroup1, reader: jspb.BinaryReader): proto.jspb.test.TestGroup1; + toObject(includeInstance?: boolean): { [key: string]: unknown }; + static toObject(includeInstance: boolean | undefined, msg: TestGroup.RequiredGroup): { [key: string]: unknown }; + static deserializeBinary(bytes: jspb.ByteSource): TestGroup.RequiredGroup; + static deserializeBinaryFromReader(msg: TestGroup.RequiredGroup, reader: jspb.BinaryReader): TestGroup.RequiredGroup; serializeBinary(): Uint8Array; - static serializeBinaryToWriter(message: proto.jspb.test.TestGroup1, writer: jspb.BinaryWriter): void; - getGroup(): proto.jspb.test.TestGroup.RepeatedGroup | null; - setGroup(value: proto.jspb.test.TestGroup.RepeatedGroup | null | undefined): proto.jspb.test.TestGroup1; - clearGroup(): proto.jspb.test.TestGroup1; - hasGroup(): boolean; - } - - export class TestReservedNames extends jspb.Message { - constructor(data?: any[] | null); - toObject(includeInstance?: boolean): GlobalObject; - static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.TestReservedNames): GlobalObject; - static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.TestReservedNames; - static deserializeBinaryFromReader(msg: proto.jspb.test.TestReservedNames, reader: jspb.BinaryReader): proto.jspb.test.TestReservedNames; - serializeBinary(): Uint8Array; - static serializeBinaryToWriter(message: proto.jspb.test.TestReservedNames, writer: jspb.BinaryWriter): void; - getExtension$(): number; - setExtension$(value: number): proto.jspb.test.TestReservedNames; - clearExtension$(): proto.jspb.test.TestReservedNames; - hasExtension$(): boolean; - } - - export class TestReservedNamesExtension extends jspb.Message { - constructor(data?: any[] | null); - toObject(includeInstance?: boolean): GlobalObject; - static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.TestReservedNamesExtension): GlobalObject; - static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.TestReservedNamesExtension; - static deserializeBinaryFromReader(msg: proto.jspb.test.TestReservedNamesExtension, reader: jspb.BinaryReader): proto.jspb.test.TestReservedNamesExtension; - serializeBinary(): Uint8Array; - static serializeBinaryToWriter(message: proto.jspb.test.TestReservedNamesExtension, writer: jspb.BinaryWriter): void; - } - - export class TestMessageWithOneof extends jspb.Message { - constructor(data?: any[] | null); - enum PartialOneofCase = { - PARTIAL_ONEOF_NOT_SET: 0, - PONE: 3, - PTHREE: 5, - }; - getPartialOneofCase(): proto.jspb.test.TestMessageWithOneof.PartialOneofCase; - enum RecursiveOneofCase = { - RECURSIVE_ONEOF_NOT_SET: 0, - RONE: 6, - RTWO: 7, - }; - getRecursiveOneofCase(): proto.jspb.test.TestMessageWithOneof.RecursiveOneofCase; - enum DefaultOneofACase = { - DEFAULT_ONEOF_A_NOT_SET: 0, - AONE: 10, - ATWO: 11, - }; - getDefaultOneofACase(): proto.jspb.test.TestMessageWithOneof.DefaultOneofACase; - enum DefaultOneofBCase = { - DEFAULT_ONEOF_B_NOT_SET: 0, - BONE: 12, - BTWO: 13, - }; - getDefaultOneofBCase(): proto.jspb.test.TestMessageWithOneof.DefaultOneofBCase; - toObject(includeInstance?: boolean): GlobalObject; - static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.TestMessageWithOneof): GlobalObject; - static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.TestMessageWithOneof; - static deserializeBinaryFromReader(msg: proto.jspb.test.TestMessageWithOneof, reader: jspb.BinaryReader): proto.jspb.test.TestMessageWithOneof; - serializeBinary(): Uint8Array; - static serializeBinaryToWriter(message: proto.jspb.test.TestMessageWithOneof, writer: jspb.BinaryWriter): void; - getPone(): string; - setPone(value: string): proto.jspb.test.TestMessageWithOneof; - clearPone(): proto.jspb.test.TestMessageWithOneof; - hasPone(): boolean; - getPthree(): string; - setPthree(value: string): proto.jspb.test.TestMessageWithOneof; - clearPthree(): proto.jspb.test.TestMessageWithOneof; - hasPthree(): boolean; - getRone(): proto.jspb.test.TestMessageWithOneof | null; - setRone(value: proto.jspb.test.TestMessageWithOneof | null | undefined): proto.jspb.test.TestMessageWithOneof; - clearRone(): proto.jspb.test.TestMessageWithOneof; - hasRone(): boolean; - getRtwo(): string; - setRtwo(value: string): proto.jspb.test.TestMessageWithOneof; - clearRtwo(): proto.jspb.test.TestMessageWithOneof; - hasRtwo(): boolean; - getNormalField(): boolean; - setNormalField(value: boolean): proto.jspb.test.TestMessageWithOneof; - clearNormalField(): proto.jspb.test.TestMessageWithOneof; - hasNormalField(): boolean; - getRepeatedFieldList(): string[]; - setRepeatedFieldList(value: string[]): proto.jspb.test.TestMessageWithOneof; - addRepeatedField(value: string, index?: number): proto.jspb.test.TestMessageWithOneof; - clearRepeatedFieldList(): proto.jspb.test.TestMessageWithOneof; - getAone(): number; - setAone(value: number): proto.jspb.test.TestMessageWithOneof; - clearAone(): proto.jspb.test.TestMessageWithOneof; - hasAone(): boolean; - getAtwo(): number; - setAtwo(value: number): proto.jspb.test.TestMessageWithOneof; - clearAtwo(): proto.jspb.test.TestMessageWithOneof; - hasAtwo(): boolean; - getBone(): number; - setBone(value: number): proto.jspb.test.TestMessageWithOneof; - clearBone(): proto.jspb.test.TestMessageWithOneof; - hasBone(): boolean; - getBtwo(): number; - setBtwo(value: number): proto.jspb.test.TestMessageWithOneof; - clearBtwo(): proto.jspb.test.TestMessageWithOneof; - hasBtwo(): boolean; - } - - export class TestEndsWithBytes extends jspb.Message { - constructor(data?: any[] | null); - toObject(includeInstance?: boolean): GlobalObject; - static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.TestEndsWithBytes): GlobalObject; - static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.TestEndsWithBytes; - static deserializeBinaryFromReader(msg: proto.jspb.test.TestEndsWithBytes, reader: jspb.BinaryReader): proto.jspb.test.TestEndsWithBytes; - serializeBinary(): Uint8Array; - static serializeBinaryToWriter(message: proto.jspb.test.TestEndsWithBytes, writer: jspb.BinaryWriter): void; - getValue(): number; - setValue(value: number): proto.jspb.test.TestEndsWithBytes; - clearValue(): proto.jspb.test.TestEndsWithBytes; - hasValue(): boolean; - getData(): (string|Uint8Array); - getData_asB64(): string; - getData_asU8(): Uint8Array; - setData(value: (string|Uint8Array)): proto.jspb.test.TestEndsWithBytes; - clearData(): proto.jspb.test.TestEndsWithBytes; - hasData(): boolean; - } - - export class TestLastFieldBeforePivot extends jspb.Message { - constructor(data?: any[] | null); - toObject(includeInstance?: boolean): GlobalObject; - static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.TestLastFieldBeforePivot): GlobalObject; - static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.TestLastFieldBeforePivot; - static deserializeBinaryFromReader(msg: proto.jspb.test.TestLastFieldBeforePivot, reader: jspb.BinaryReader): proto.jspb.test.TestLastFieldBeforePivot; - serializeBinary(): Uint8Array; - static serializeBinaryToWriter(message: proto.jspb.test.TestLastFieldBeforePivot, writer: jspb.BinaryWriter): void; - getLastFieldBeforePivot(): number; - setLastFieldBeforePivot(value: number): proto.jspb.test.TestLastFieldBeforePivot; - clearLastFieldBeforePivot(): proto.jspb.test.TestLastFieldBeforePivot; - hasLastFieldBeforePivot(): boolean; + static serializeBinaryToWriter(message: TestGroup.RequiredGroup, writer: jspb.BinaryWriter): void; + getId(): string; + setId(value: string): TestGroup.RequiredGroup; + clearId(): TestGroup.RequiredGroup; + hasId(): boolean; } - export class Int64Types extends jspb.Message { + class OptionalGroup extends jspb.Message { constructor(data?: any[] | null); - toObject(includeInstance?: boolean): GlobalObject; - static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.Int64Types): GlobalObject; - static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.Int64Types; - static deserializeBinaryFromReader(msg: proto.jspb.test.Int64Types, reader: jspb.BinaryReader): proto.jspb.test.Int64Types; + toObject(includeInstance?: boolean): { [key: string]: unknown }; + static toObject(includeInstance: boolean | undefined, msg: TestGroup.OptionalGroup): { [key: string]: unknown }; + static deserializeBinary(bytes: jspb.ByteSource): TestGroup.OptionalGroup; + static deserializeBinaryFromReader(msg: TestGroup.OptionalGroup, reader: jspb.BinaryReader): TestGroup.OptionalGroup; serializeBinary(): Uint8Array; - static serializeBinaryToWriter(message: proto.jspb.test.Int64Types, writer: jspb.BinaryWriter): void; - getInt64Normal(): number; - setInt64Normal(value: number): proto.jspb.test.Int64Types; - clearInt64Normal(): proto.jspb.test.Int64Types; - hasInt64Normal(): boolean; - getInt64String(): string; - setInt64String(value: string): proto.jspb.test.Int64Types; - clearInt64String(): proto.jspb.test.Int64Types; - hasInt64String(): boolean; - getInt64Number(): number; - setInt64Number(value: number): proto.jspb.test.Int64Types; - clearInt64Number(): proto.jspb.test.Int64Types; - hasInt64Number(): boolean; + static serializeBinaryToWriter(message: TestGroup.OptionalGroup, writer: jspb.BinaryWriter): void; + getId(): string; + setId(value: string): TestGroup.OptionalGroup; + clearId(): TestGroup.OptionalGroup; + hasId(): boolean; } - export class TestMapFieldsNoBinary extends jspb.Message { - constructor(data?: any[] | null); - toObject(includeInstance?: boolean): GlobalObject; - static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.TestMapFieldsNoBinary): GlobalObject; - static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.TestMapFieldsNoBinary; - static deserializeBinaryFromReader(msg: proto.jspb.test.TestMapFieldsNoBinary, reader: jspb.BinaryReader): proto.jspb.test.TestMapFieldsNoBinary; - serializeBinary(): Uint8Array; - static serializeBinaryToWriter(message: proto.jspb.test.TestMapFieldsNoBinary, writer: jspb.BinaryWriter): void; - getMapStringStringMap(noLazyCreate?: boolean): jspb.Map | undefined; - clearMapStringStringMap(): proto.jspb.test.TestMapFieldsNoBinary; - getMapStringInt32Map(noLazyCreate?: boolean): jspb.Map | undefined; - clearMapStringInt32Map(): proto.jspb.test.TestMapFieldsNoBinary; - getMapStringInt64Map(noLazyCreate?: boolean): jspb.Map | undefined; - clearMapStringInt64Map(): proto.jspb.test.TestMapFieldsNoBinary; - getMapStringBoolMap(noLazyCreate?: boolean): jspb.Map | undefined; - clearMapStringBoolMap(): proto.jspb.test.TestMapFieldsNoBinary; - getMapStringDoubleMap(noLazyCreate?: boolean): jspb.Map | undefined; - clearMapStringDoubleMap(): proto.jspb.test.TestMapFieldsNoBinary; - getMapStringEnumMap(noLazyCreate?: boolean): jspb.Map | undefined; - clearMapStringEnumMap(): proto.jspb.test.TestMapFieldsNoBinary; - getMapStringMsgMap(noLazyCreate?: boolean): jspb.Map | undefined; - clearMapStringMsgMap(): proto.jspb.test.TestMapFieldsNoBinary; - getMapInt32StringMap(noLazyCreate?: boolean): jspb.Map | undefined; - clearMapInt32StringMap(): proto.jspb.test.TestMapFieldsNoBinary; - getMapInt64StringMap(noLazyCreate?: boolean): jspb.Map | undefined; - clearMapInt64StringMap(): proto.jspb.test.TestMapFieldsNoBinary; - getMapBoolStringMap(noLazyCreate?: boolean): jspb.Map | undefined; - clearMapBoolStringMap(): proto.jspb.test.TestMapFieldsNoBinary; - getTestMapFields(): proto.jspb.test.TestMapFieldsNoBinary | null; - setTestMapFields(value: proto.jspb.test.TestMapFieldsNoBinary | null | undefined): proto.jspb.test.TestMapFieldsNoBinary; - clearTestMapFields(): proto.jspb.test.TestMapFieldsNoBinary; - hasTestMapFields(): boolean; - getMapStringTestmapfieldsMap(noLazyCreate?: boolean): jspb.Map | undefined; - clearMapStringTestmapfieldsMap(): proto.jspb.test.TestMapFieldsNoBinary; - } +} - export class MapValueMessageNoBinary extends jspb.Message { +export class TestGroup1 extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): { [key: string]: unknown }; + static toObject(includeInstance: boolean | undefined, msg: TestGroup1): { [key: string]: unknown }; + static deserializeBinary(bytes: jspb.ByteSource): TestGroup1; + static deserializeBinaryFromReader(msg: TestGroup1, reader: jspb.BinaryReader): TestGroup1; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: TestGroup1, writer: jspb.BinaryWriter): void; + getGroup(): TestGroup.RepeatedGroup | null; + setGroup(value: TestGroup.RepeatedGroup | null | undefined): TestGroup1; + clearGroup(): TestGroup1; + hasGroup(): boolean; +} + +export class TestReservedNames extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): { [key: string]: unknown }; + static toObject(includeInstance: boolean | undefined, msg: TestReservedNames): { [key: string]: unknown }; + static deserializeBinary(bytes: jspb.ByteSource): TestReservedNames; + static deserializeBinaryFromReader(msg: TestReservedNames, reader: jspb.BinaryReader): TestReservedNames; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: TestReservedNames, writer: jspb.BinaryWriter): void; + getExtension$(): number; + setExtension$(value: number): TestReservedNames; + clearExtension$(): TestReservedNames; + hasExtension$(): boolean; +} + +export class TestReservedNamesExtension extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): { [key: string]: unknown }; + static toObject(includeInstance: boolean | undefined, msg: TestReservedNamesExtension): { [key: string]: unknown }; + static deserializeBinary(bytes: jspb.ByteSource): TestReservedNamesExtension; + static deserializeBinaryFromReader(msg: TestReservedNamesExtension, reader: jspb.BinaryReader): TestReservedNamesExtension; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: TestReservedNamesExtension, writer: jspb.BinaryWriter): void; +} + +export class TestMessageWithOneof extends jspb.Message { + constructor(data?: any[] | null); + getPartialOneofCase(): TestMessageWithOneof.PartialOneofCase; + getRecursiveOneofCase(): TestMessageWithOneof.RecursiveOneofCase; + getDefaultOneofACase(): TestMessageWithOneof.DefaultOneofACase; + getDefaultOneofBCase(): TestMessageWithOneof.DefaultOneofBCase; + toObject(includeInstance?: boolean): { [key: string]: unknown }; + static toObject(includeInstance: boolean | undefined, msg: TestMessageWithOneof): { [key: string]: unknown }; + static deserializeBinary(bytes: jspb.ByteSource): TestMessageWithOneof; + static deserializeBinaryFromReader(msg: TestMessageWithOneof, reader: jspb.BinaryReader): TestMessageWithOneof; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: TestMessageWithOneof, writer: jspb.BinaryWriter): void; + getPone(): string; + setPone(value: string): TestMessageWithOneof; + clearPone(): TestMessageWithOneof; + hasPone(): boolean; + getPthree(): string; + setPthree(value: string): TestMessageWithOneof; + clearPthree(): TestMessageWithOneof; + hasPthree(): boolean; + getRone(): TestMessageWithOneof | null; + setRone(value: TestMessageWithOneof | null | undefined): TestMessageWithOneof; + clearRone(): TestMessageWithOneof; + hasRone(): boolean; + getRtwo(): string; + setRtwo(value: string): TestMessageWithOneof; + clearRtwo(): TestMessageWithOneof; + hasRtwo(): boolean; + getNormalField(): boolean; + setNormalField(value: boolean): TestMessageWithOneof; + clearNormalField(): TestMessageWithOneof; + hasNormalField(): boolean; + getRepeatedFieldList(): string[]; + setRepeatedFieldList(value: string[]): TestMessageWithOneof; + addRepeatedField(value: string, index?: number): TestMessageWithOneof; + clearRepeatedFieldList(): TestMessageWithOneof; + getAone(): number; + setAone(value: number): TestMessageWithOneof; + clearAone(): TestMessageWithOneof; + hasAone(): boolean; + getAtwo(): number; + setAtwo(value: number): TestMessageWithOneof; + clearAtwo(): TestMessageWithOneof; + hasAtwo(): boolean; + getBone(): number; + setBone(value: number): TestMessageWithOneof; + clearBone(): TestMessageWithOneof; + hasBone(): boolean; + getBtwo(): number; + setBtwo(value: number): TestMessageWithOneof; + clearBtwo(): TestMessageWithOneof; + hasBtwo(): boolean; +} + +export namespace TestMessageWithOneof { + enum PartialOneofCase { + PARTIAL_ONEOF_NOT_SET = 0, + PONE = 3, + PTHREE = 5, + } + enum RecursiveOneofCase { + RECURSIVE_ONEOF_NOT_SET = 0, + RONE = 6, + RTWO = 7, + } + enum DefaultOneofACase { + DEFAULT_ONEOF_A_NOT_SET = 0, + AONE = 10, + ATWO = 11, + } + enum DefaultOneofBCase { + DEFAULT_ONEOF_B_NOT_SET = 0, + BONE = 12, + BTWO = 13, + } +} + +export class TestEndsWithBytes extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): { [key: string]: unknown }; + static toObject(includeInstance: boolean | undefined, msg: TestEndsWithBytes): { [key: string]: unknown }; + static deserializeBinary(bytes: jspb.ByteSource): TestEndsWithBytes; + static deserializeBinaryFromReader(msg: TestEndsWithBytes, reader: jspb.BinaryReader): TestEndsWithBytes; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: TestEndsWithBytes, writer: jspb.BinaryWriter): void; + getValue(): number; + setValue(value: number): TestEndsWithBytes; + clearValue(): TestEndsWithBytes; + hasValue(): boolean; + getData(): (string|Uint8Array); + getData_asB64(): string; + getData_asU8(): Uint8Array; + setData(value: (string|Uint8Array)): TestEndsWithBytes; + clearData(): TestEndsWithBytes; + hasData(): boolean; +} + +export class TestLastFieldBeforePivot extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): { [key: string]: unknown }; + static toObject(includeInstance: boolean | undefined, msg: TestLastFieldBeforePivot): { [key: string]: unknown }; + static deserializeBinary(bytes: jspb.ByteSource): TestLastFieldBeforePivot; + static deserializeBinaryFromReader(msg: TestLastFieldBeforePivot, reader: jspb.BinaryReader): TestLastFieldBeforePivot; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: TestLastFieldBeforePivot, writer: jspb.BinaryWriter): void; + getLastFieldBeforePivot(): number; + setLastFieldBeforePivot(value: number): TestLastFieldBeforePivot; + clearLastFieldBeforePivot(): TestLastFieldBeforePivot; + hasLastFieldBeforePivot(): boolean; +} + +export class Int64Types extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): { [key: string]: unknown }; + static toObject(includeInstance: boolean | undefined, msg: Int64Types): { [key: string]: unknown }; + static deserializeBinary(bytes: jspb.ByteSource): Int64Types; + static deserializeBinaryFromReader(msg: Int64Types, reader: jspb.BinaryReader): Int64Types; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: Int64Types, writer: jspb.BinaryWriter): void; + getInt64Normal(): number; + setInt64Normal(value: number): Int64Types; + clearInt64Normal(): Int64Types; + hasInt64Normal(): boolean; + getInt64String(): string; + setInt64String(value: string): Int64Types; + clearInt64String(): Int64Types; + hasInt64String(): boolean; + getInt64Number(): number; + setInt64Number(value: number): Int64Types; + clearInt64Number(): Int64Types; + hasInt64Number(): boolean; +} + +export class TestMapFieldsNoBinary extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): { [key: string]: unknown }; + static toObject(includeInstance: boolean | undefined, msg: TestMapFieldsNoBinary): { [key: string]: unknown }; + static deserializeBinary(bytes: jspb.ByteSource): TestMapFieldsNoBinary; + static deserializeBinaryFromReader(msg: TestMapFieldsNoBinary, reader: jspb.BinaryReader): TestMapFieldsNoBinary; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: TestMapFieldsNoBinary, writer: jspb.BinaryWriter): void; + getMapStringStringMap(noLazyCreate?: boolean): jspb.Map | undefined; + clearMapStringStringMap(): TestMapFieldsNoBinary; + getMapStringInt32Map(noLazyCreate?: boolean): jspb.Map | undefined; + clearMapStringInt32Map(): TestMapFieldsNoBinary; + getMapStringInt64Map(noLazyCreate?: boolean): jspb.Map | undefined; + clearMapStringInt64Map(): TestMapFieldsNoBinary; + getMapStringBoolMap(noLazyCreate?: boolean): jspb.Map | undefined; + clearMapStringBoolMap(): TestMapFieldsNoBinary; + getMapStringDoubleMap(noLazyCreate?: boolean): jspb.Map | undefined; + clearMapStringDoubleMap(): TestMapFieldsNoBinary; + getMapStringEnumMap(noLazyCreate?: boolean): jspb.Map | undefined; + clearMapStringEnumMap(): TestMapFieldsNoBinary; + getMapStringMsgMap(noLazyCreate?: boolean): jspb.Map | undefined; + clearMapStringMsgMap(): TestMapFieldsNoBinary; + getMapInt32StringMap(noLazyCreate?: boolean): jspb.Map | undefined; + clearMapInt32StringMap(): TestMapFieldsNoBinary; + getMapInt64StringMap(noLazyCreate?: boolean): jspb.Map | undefined; + clearMapInt64StringMap(): TestMapFieldsNoBinary; + getMapBoolStringMap(noLazyCreate?: boolean): jspb.Map | undefined; + clearMapBoolStringMap(): TestMapFieldsNoBinary; + getTestMapFields(): TestMapFieldsNoBinary | null; + setTestMapFields(value: TestMapFieldsNoBinary | null | undefined): TestMapFieldsNoBinary; + clearTestMapFields(): TestMapFieldsNoBinary; + hasTestMapFields(): boolean; + getMapStringTestmapfieldsMap(noLazyCreate?: boolean): jspb.Map | undefined; + clearMapStringTestmapfieldsMap(): TestMapFieldsNoBinary; +} + +export class MapValueMessageNoBinary extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): { [key: string]: unknown }; + static toObject(includeInstance: boolean | undefined, msg: MapValueMessageNoBinary): { [key: string]: unknown }; + static deserializeBinary(bytes: jspb.ByteSource): MapValueMessageNoBinary; + static deserializeBinaryFromReader(msg: MapValueMessageNoBinary, reader: jspb.BinaryReader): MapValueMessageNoBinary; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: MapValueMessageNoBinary, writer: jspb.BinaryWriter): void; + getFoo(): number; + setFoo(value: number): MapValueMessageNoBinary; + clearFoo(): MapValueMessageNoBinary; + hasFoo(): boolean; +} + +export class Deeply extends jspb.Message { + constructor(data?: any[] | null); + toObject(includeInstance?: boolean): { [key: string]: unknown }; + static toObject(includeInstance: boolean | undefined, msg: Deeply): { [key: string]: unknown }; + static deserializeBinary(bytes: jspb.ByteSource): Deeply; + static deserializeBinaryFromReader(msg: Deeply, reader: jspb.BinaryReader): Deeply; + serializeBinary(): Uint8Array; + static serializeBinaryToWriter(message: Deeply, writer: jspb.BinaryWriter): void; +} + +export namespace Deeply { + class Nested extends jspb.Message { constructor(data?: any[] | null); - toObject(includeInstance?: boolean): GlobalObject; - static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.MapValueMessageNoBinary): GlobalObject; - static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.MapValueMessageNoBinary; - static deserializeBinaryFromReader(msg: proto.jspb.test.MapValueMessageNoBinary, reader: jspb.BinaryReader): proto.jspb.test.MapValueMessageNoBinary; + toObject(includeInstance?: boolean): { [key: string]: unknown }; + static toObject(includeInstance: boolean | undefined, msg: Deeply.Nested): { [key: string]: unknown }; + static deserializeBinary(bytes: jspb.ByteSource): Deeply.Nested; + static deserializeBinaryFromReader(msg: Deeply.Nested, reader: jspb.BinaryReader): Deeply.Nested; serializeBinary(): Uint8Array; - static serializeBinaryToWriter(message: proto.jspb.test.MapValueMessageNoBinary, writer: jspb.BinaryWriter): void; - getFoo(): number; - setFoo(value: number): proto.jspb.test.MapValueMessageNoBinary; - clearFoo(): proto.jspb.test.MapValueMessageNoBinary; - hasFoo(): boolean; + static serializeBinaryToWriter(message: Deeply.Nested, writer: jspb.BinaryWriter): void; } - export class Deeply extends jspb.Message { - constructor(data?: any[] | null); - toObject(includeInstance?: boolean): GlobalObject; - static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.Deeply): GlobalObject; - static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.Deeply; - static deserializeBinaryFromReader(msg: proto.jspb.test.Deeply, reader: jspb.BinaryReader): proto.jspb.test.Deeply; - serializeBinary(): Uint8Array; - static serializeBinaryToWriter(message: proto.jspb.test.Deeply, writer: jspb.BinaryWriter): void; - export class Nested extends jspb.Message { + namespace Nested { + class Message extends jspb.Message { constructor(data?: any[] | null); - toObject(includeInstance?: boolean): GlobalObject; - static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.Deeply.Nested): GlobalObject; - static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.Deeply.Nested; - static deserializeBinaryFromReader(msg: proto.jspb.test.Deeply.Nested, reader: jspb.BinaryReader): proto.jspb.test.Deeply.Nested; + toObject(includeInstance?: boolean): { [key: string]: unknown }; + static toObject(includeInstance: boolean | undefined, msg: Deeply.Nested.Message): { [key: string]: unknown }; + static deserializeBinary(bytes: jspb.ByteSource): Deeply.Nested.Message; + static deserializeBinaryFromReader(msg: Deeply.Nested.Message, reader: jspb.BinaryReader): Deeply.Nested.Message; serializeBinary(): Uint8Array; - static serializeBinaryToWriter(message: proto.jspb.test.Deeply.Nested, writer: jspb.BinaryWriter): void; - export class Message extends jspb.Message { - constructor(data?: any[] | null); - toObject(includeInstance?: boolean): GlobalObject; - static toObject(includeInstance: boolean | undefined, msg: proto.jspb.test.Deeply.Nested.Message): GlobalObject; - static deserializeBinary(bytes: jspb.ByteSource): proto.jspb.test.Deeply.Nested.Message; - static deserializeBinaryFromReader(msg: proto.jspb.test.Deeply.Nested.Message, reader: jspb.BinaryReader): proto.jspb.test.Deeply.Nested.Message; - serializeBinary(): Uint8Array; - static serializeBinaryToWriter(message: proto.jspb.test.Deeply.Nested.Message, writer: jspb.BinaryWriter): void; - getCount(): number; - setCount(value: number): proto.jspb.test.Deeply.Nested.Message; - clearCount(): proto.jspb.test.Deeply.Nested.Message; - hasCount(): boolean; - } - + static serializeBinaryToWriter(message: Deeply.Nested.Message, writer: jspb.BinaryWriter): void; + getCount(): number; + setCount(value: number): Deeply.Nested.Message; + clearCount(): Deeply.Nested.Message; + hasCount(): boolean; } } - enum OuterEnum { - FOO = 1, - BAR = 2, - } - - enum MapValueEnumNoBinary { - MAP_VALUE_FOO_NOBINARY = 0, - MAP_VALUE_BAR_NOBINARY = 1, - MAP_VALUE_BAZ_NOBINARY = 2, - } - - enum TestAllowAliasEnum { - TEST_ALLOW_ALIAS_DEFAULT = 0, - VALUE1 = 1, - } - -} - -declare module "goog:proto.jspb.test.BooleanFields " { - import BooleanFields = proto.jspb.test.BooleanFields; - export default BooleanFields; -} - -declare module "goog:proto.jspb.test.CloneExtension " { - import CloneExtension = proto.jspb.test.CloneExtension; - export default CloneExtension; -} - -declare module "goog:proto.jspb.test.Complex " { - import Complex = proto.jspb.test.Complex; - export default Complex; -} - -declare module "goog:proto.jspb.test.Deeply " { - import Deeply = proto.jspb.test.Deeply; - export default Deeply; -} - -declare module "goog:proto.jspb.test.DefaultValues " { - import DefaultValues = proto.jspb.test.DefaultValues; - export default DefaultValues; -} - -declare module "goog:proto.jspb.test.Empty " { - import Empty = proto.jspb.test.Empty; - export default Empty; -} - -declare module "goog:proto.jspb.test.EnumContainer " { - import EnumContainer = proto.jspb.test.EnumContainer; - export default EnumContainer; -} - -declare module "goog:proto.jspb.test.FloatingPointFields " { - import FloatingPointFields = proto.jspb.test.FloatingPointFields; - export default FloatingPointFields; -} - -declare module "goog:proto.jspb.test.HasExtensions " { - import HasExtensions = proto.jspb.test.HasExtensions; - export default HasExtensions; -} - -declare module "goog:proto.jspb.test.IndirectExtension " { - import IndirectExtension = proto.jspb.test.IndirectExtension; - export default IndirectExtension; -} - -declare module "goog:proto.jspb.test.Int64Types " { - import Int64Types = proto.jspb.test.Int64Types; - export default Int64Types; -} - -declare module "goog:proto.jspb.test.IsExtension " { - import IsExtension = proto.jspb.test.IsExtension; - export default IsExtension; -} - -declare module "goog:proto.jspb.test.MapValueEnumNoBinary " { - import MapValueEnumNoBinary = proto.jspb.test.MapValueEnumNoBinary; - export default MapValueEnumNoBinary; -} - -declare module "goog:proto.jspb.test.MapValueMessageNoBinary " { - import MapValueMessageNoBinary = proto.jspb.test.MapValueMessageNoBinary; - export default MapValueMessageNoBinary; -} - -declare module "goog:proto.jspb.test.MineField " { - import MineField = proto.jspb.test.MineField; - export default MineField; -} - -declare module "goog:proto.jspb.test.OptionalFields " { - import OptionalFields = proto.jspb.test.OptionalFields; - export default OptionalFields; -} - -declare module "goog:proto.jspb.test.OuterEnum " { - import OuterEnum = proto.jspb.test.OuterEnum; - export default OuterEnum; -} - -declare module "goog:proto.jspb.test.OuterMessage " { - import OuterMessage = proto.jspb.test.OuterMessage; - export default OuterMessage; -} - -declare module "goog:proto.jspb.test.Simple1 " { - import Simple1 = proto.jspb.test.Simple1; - export default Simple1; -} - -declare module "goog:proto.jspb.test.Simple2 " { - import Simple2 = proto.jspb.test.Simple2; - export default Simple2; -} - -declare module "goog:proto.jspb.test.SpecialCases " { - import SpecialCases = proto.jspb.test.SpecialCases; - export default SpecialCases; -} - -declare module "goog:proto.jspb.test.TestAllowAliasEnum " { - import TestAllowAliasEnum = proto.jspb.test.TestAllowAliasEnum; - export default TestAllowAliasEnum; -} - -declare module "goog:proto.jspb.test.TestClone " { - import TestClone = proto.jspb.test.TestClone; - export default TestClone; -} - -declare module "goog:proto.jspb.test.TestCloneExtension " { - import TestCloneExtension = proto.jspb.test.TestCloneExtension; - export default TestCloneExtension; -} - -declare module "goog:proto.jspb.test.TestEndsWithBytes " { - import TestEndsWithBytes = proto.jspb.test.TestEndsWithBytes; - export default TestEndsWithBytes; -} - -declare module "goog:proto.jspb.test.TestGroup " { - import TestGroup = proto.jspb.test.TestGroup; - export default TestGroup; -} - -declare module "goog:proto.jspb.test.TestGroup1 " { - import TestGroup1 = proto.jspb.test.TestGroup1; - export default TestGroup1; -} - -declare module "goog:proto.jspb.test.TestLastFieldBeforePivot " { - import TestLastFieldBeforePivot = proto.jspb.test.TestLastFieldBeforePivot; - export default TestLastFieldBeforePivot; -} - -declare module "goog:proto.jspb.test.TestMapFieldsNoBinary " { - import TestMapFieldsNoBinary = proto.jspb.test.TestMapFieldsNoBinary; - export default TestMapFieldsNoBinary; } -declare module "goog:proto.jspb.test.TestMessageWithOneof " { - import TestMessageWithOneof = proto.jspb.test.TestMessageWithOneof; - export default TestMessageWithOneof; +export enum OuterEnum { + FOO = 1, + BAR = 2, } -declare module "goog:proto.jspb.test.TestReservedNames " { - import TestReservedNames = proto.jspb.test.TestReservedNames; - export default TestReservedNames; +export enum MapValueEnumNoBinary { + MAP_VALUE_FOO_NOBINARY = 0, + MAP_VALUE_BAR_NOBINARY = 1, + MAP_VALUE_BAZ_NOBINARY = 2, } -declare module "goog:proto.jspb.test.TestReservedNamesExtension " { - import TestReservedNamesExtension = proto.jspb.test.TestReservedNamesExtension; - export default TestReservedNamesExtension; +export enum TestAllowAliasEnum { + TEST_ALLOW_ALIAS_DEFAULT = 0, + VALUE1 = 1, } -import BooleanFields = proto.jspb.test.BooleanFields; -import CloneExtension = proto.jspb.test.CloneExtension; -import Complex = proto.jspb.test.Complex; -import Deeply = proto.jspb.test.Deeply; -import DefaultValues = proto.jspb.test.DefaultValues; -import Empty = proto.jspb.test.Empty; -import EnumContainer = proto.jspb.test.EnumContainer; -import FloatingPointFields = proto.jspb.test.FloatingPointFields; -import HasExtensions = proto.jspb.test.HasExtensions; -import IndirectExtension = proto.jspb.test.IndirectExtension; -import Int64Types = proto.jspb.test.Int64Types; -import IsExtension = proto.jspb.test.IsExtension; -import MapValueEnumNoBinary = proto.jspb.test.MapValueEnumNoBinary; -import MapValueMessageNoBinary = proto.jspb.test.MapValueMessageNoBinary; -import MineField = proto.jspb.test.MineField; -import OptionalFields = proto.jspb.test.OptionalFields; -import OuterEnum = proto.jspb.test.OuterEnum; -import OuterMessage = proto.jspb.test.OuterMessage; -import Simple1 = proto.jspb.test.Simple1; -import Simple2 = proto.jspb.test.Simple2; -import SpecialCases = proto.jspb.test.SpecialCases; -import TestAllowAliasEnum = proto.jspb.test.TestAllowAliasEnum; -import TestClone = proto.jspb.test.TestClone; -import TestCloneExtension = proto.jspb.test.TestCloneExtension; -import TestEndsWithBytes = proto.jspb.test.TestEndsWithBytes; -import TestGroup = proto.jspb.test.TestGroup; -import TestGroup1 = proto.jspb.test.TestGroup1; -import TestLastFieldBeforePivot = proto.jspb.test.TestLastFieldBeforePivot; -import TestMapFieldsNoBinary = proto.jspb.test.TestMapFieldsNoBinary; -import TestMessageWithOneof = proto.jspb.test.TestMessageWithOneof; -import TestReservedNames = proto.jspb.test.TestReservedNames; -import TestReservedNamesExtension = proto.jspb.test.TestReservedNamesExtension; - -export { - BooleanFields, - CloneExtension, - Complex, - Deeply, - DefaultValues, - Empty, - EnumContainer, - FloatingPointFields, - HasExtensions, - IndirectExtension, - Int64Types, - IsExtension, - MapValueEnumNoBinary, - MapValueMessageNoBinary, - MineField, - OptionalFields, - OuterEnum, - OuterMessage, - Simple1, - Simple2, - SpecialCases, - TestAllowAliasEnum, - TestClone, - TestCloneExtension, - TestEndsWithBytes, - TestGroup, - TestGroup1, - TestLastFieldBeforePivot, - TestMapFieldsNoBinary, - TestMessageWithOneof, - TestReservedNames, - TestReservedNamesExtension, -}; diff --git a/example/test.js b/example/test.js index 6c46f57..bec1e96 100644 --- a/example/test.js +++ b/example/test.js @@ -16,53 +16,6 @@ var goog = jspb; var proto = {}; import * as google_protobuf_descriptor_pb from 'google-protobuf/google/protobuf/descriptor.js'; -goog.exportSymbol('proto.jspb.test.BooleanFields', null, global); -goog.exportSymbol('proto.jspb.test.CloneExtension', null, global); -goog.exportSymbol('proto.jspb.test.Complex', null, global); -goog.exportSymbol('proto.jspb.test.Complex.Nested', null, global); -goog.exportSymbol('proto.jspb.test.Deeply', null, global); -goog.exportSymbol('proto.jspb.test.Deeply.Nested', null, global); -goog.exportSymbol('proto.jspb.test.Deeply.Nested.Message', null, global); -goog.exportSymbol('proto.jspb.test.DefaultValues', null, global); -goog.exportSymbol('proto.jspb.test.DefaultValues.Enum', null, global); -goog.exportSymbol('proto.jspb.test.Empty', null, global); -goog.exportSymbol('proto.jspb.test.EnumContainer', null, global); -goog.exportSymbol('proto.jspb.test.FloatingPointFields', null, global); -goog.exportSymbol('proto.jspb.test.HasExtensions', null, global); -goog.exportSymbol('proto.jspb.test.IndirectExtension', null, global); -goog.exportSymbol('proto.jspb.test.Int64Types', null, global); -goog.exportSymbol('proto.jspb.test.IsExtension', null, global); -goog.exportSymbol('proto.jspb.test.MapValueEnumNoBinary', null, global); -goog.exportSymbol('proto.jspb.test.MapValueMessageNoBinary', null, global); -goog.exportSymbol('proto.jspb.test.MineField', null, global); -goog.exportSymbol('proto.jspb.test.OptionalFields', null, global); -goog.exportSymbol('proto.jspb.test.OptionalFields.Nested', null, global); -goog.exportSymbol('proto.jspb.test.OuterEnum', null, global); -goog.exportSymbol('proto.jspb.test.OuterMessage', null, global); -goog.exportSymbol('proto.jspb.test.OuterMessage.Complex', null, global); -goog.exportSymbol('proto.jspb.test.Simple1', null, global); -goog.exportSymbol('proto.jspb.test.Simple2', null, global); -goog.exportSymbol('proto.jspb.test.SpecialCases', null, global); -goog.exportSymbol('proto.jspb.test.TestAllowAliasEnum', null, global); -goog.exportSymbol('proto.jspb.test.TestClone', null, global); -goog.exportSymbol('proto.jspb.test.TestCloneExtension', null, global); -goog.exportSymbol('proto.jspb.test.TestEndsWithBytes', null, global); -goog.exportSymbol('proto.jspb.test.TestGroup', null, global); -goog.exportSymbol('proto.jspb.test.TestGroup.OptionalGroup', null, global); -goog.exportSymbol('proto.jspb.test.TestGroup.RepeatedGroup', null, global); -goog.exportSymbol('proto.jspb.test.TestGroup.RequiredGroup', null, global); -goog.exportSymbol('proto.jspb.test.TestGroup1', null, global); -goog.exportSymbol('proto.jspb.test.TestLastFieldBeforePivot', null, global); -goog.exportSymbol('proto.jspb.test.TestMapFieldsNoBinary', null, global); -goog.exportSymbol('proto.jspb.test.TestMessageWithOneof', null, global); -goog.exportSymbol('proto.jspb.test.TestMessageWithOneof.DefaultOneofACase', null, global); -goog.exportSymbol('proto.jspb.test.TestMessageWithOneof.DefaultOneofBCase', null, global); -goog.exportSymbol('proto.jspb.test.TestMessageWithOneof.PartialOneofCase', null, global); -goog.exportSymbol('proto.jspb.test.TestMessageWithOneof.RecursiveOneofCase', null, global); -goog.exportSymbol('proto.jspb.test.TestReservedNames', null, global); -goog.exportSymbol('proto.jspb.test.TestReservedNamesExtension', null, global); -goog.exportSymbol('proto.jspb.test.extendTestLastFieldBeforePivotField', null, global); -goog.exportSymbol('proto.jspb.test.simple1', null, global); /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -73,16 +26,16 @@ goog.exportSymbol('proto.jspb.test.simple1', null, global); * @extends {jspb.Message} * @constructor */ -proto.jspb.test.Empty = function(opt_data) { +export function Empty(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.jspb.test.Empty, jspb.Message); +goog.inherits(Empty, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.jspb.test.Empty.displayName = 'proto.jspb.test.Empty'; + Empty.displayName = 'proto.jspb.test.Empty'; } /** * Generated by JsPbCodeGenerator. @@ -94,16 +47,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.jspb.test.EnumContainer = function(opt_data) { +export function EnumContainer(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.jspb.test.EnumContainer, jspb.Message); +goog.inherits(EnumContainer, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.jspb.test.EnumContainer.displayName = 'proto.jspb.test.EnumContainer'; + EnumContainer.displayName = 'proto.jspb.test.EnumContainer'; } /** * Generated by JsPbCodeGenerator. @@ -115,16 +68,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.jspb.test.Simple1 = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.jspb.test.Simple1.repeatedFields_, null); +export function Simple1(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, Simple1.repeatedFields_, null); }; -goog.inherits(proto.jspb.test.Simple1, jspb.Message); +goog.inherits(Simple1, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.jspb.test.Simple1.displayName = 'proto.jspb.test.Simple1'; + Simple1.displayName = 'proto.jspb.test.Simple1'; } /** * Generated by JsPbCodeGenerator. @@ -136,16 +89,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.jspb.test.Simple2 = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.jspb.test.Simple2.repeatedFields_, null); +export function Simple2(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, Simple2.repeatedFields_, null); }; -goog.inherits(proto.jspb.test.Simple2, jspb.Message); +goog.inherits(Simple2, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.jspb.test.Simple2.displayName = 'proto.jspb.test.Simple2'; + Simple2.displayName = 'proto.jspb.test.Simple2'; } /** * Generated by JsPbCodeGenerator. @@ -157,16 +110,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.jspb.test.SpecialCases = function(opt_data) { +export function SpecialCases(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.jspb.test.SpecialCases, jspb.Message); +goog.inherits(SpecialCases, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.jspb.test.SpecialCases.displayName = 'proto.jspb.test.SpecialCases'; + SpecialCases.displayName = 'proto.jspb.test.SpecialCases'; } /** * Generated by JsPbCodeGenerator. @@ -178,16 +131,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.jspb.test.OptionalFields = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.jspb.test.OptionalFields.repeatedFields_, null); +export function OptionalFields(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, OptionalFields.repeatedFields_, null); }; -goog.inherits(proto.jspb.test.OptionalFields, jspb.Message); +goog.inherits(OptionalFields, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.jspb.test.OptionalFields.displayName = 'proto.jspb.test.OptionalFields'; + OptionalFields.displayName = 'proto.jspb.test.OptionalFields'; } /** * Generated by JsPbCodeGenerator. @@ -199,16 +152,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.jspb.test.OptionalFields.Nested = function(opt_data) { +OptionalFields.Nested = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.jspb.test.OptionalFields.Nested, jspb.Message); +goog.inherits(OptionalFields.Nested, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.jspb.test.OptionalFields.Nested.displayName = 'proto.jspb.test.OptionalFields.Nested'; + OptionalFields.Nested.displayName = 'proto.jspb.test.OptionalFields.Nested'; } /** * Generated by JsPbCodeGenerator. @@ -220,16 +173,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.jspb.test.HasExtensions = function(opt_data) { +export function HasExtensions(opt_data) { jspb.Message.initialize(this, opt_data, 0, 4, null, null); }; -goog.inherits(proto.jspb.test.HasExtensions, jspb.Message); +goog.inherits(HasExtensions, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.jspb.test.HasExtensions.displayName = 'proto.jspb.test.HasExtensions'; + HasExtensions.displayName = 'proto.jspb.test.HasExtensions'; } /** @@ -244,7 +197,7 @@ if (goog.DEBUG && !COMPILED) { * * @type {!Object} */ -proto.jspb.test.HasExtensions.extensions = {}; +HasExtensions.extensions = {}; /** @@ -259,7 +212,7 @@ proto.jspb.test.HasExtensions.extensions = {}; * * @type {!Object} */ -proto.jspb.test.HasExtensions.extensionsBinary = {}; +HasExtensions.extensionsBinary = {}; /** * Generated by JsPbCodeGenerator. @@ -271,16 +224,16 @@ proto.jspb.test.HasExtensions.extensionsBinary = {}; * @extends {jspb.Message} * @constructor */ -proto.jspb.test.Complex = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.jspb.test.Complex.repeatedFields_, null); +export function Complex(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, Complex.repeatedFields_, null); }; -goog.inherits(proto.jspb.test.Complex, jspb.Message); +goog.inherits(Complex, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.jspb.test.Complex.displayName = 'proto.jspb.test.Complex'; + Complex.displayName = 'proto.jspb.test.Complex'; } /** * Generated by JsPbCodeGenerator. @@ -292,16 +245,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.jspb.test.Complex.Nested = function(opt_data) { +Complex.Nested = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.jspb.test.Complex.Nested, jspb.Message); +goog.inherits(Complex.Nested, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.jspb.test.Complex.Nested.displayName = 'proto.jspb.test.Complex.Nested'; + Complex.Nested.displayName = 'proto.jspb.test.Complex.Nested'; } /** * Generated by JsPbCodeGenerator. @@ -313,16 +266,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.jspb.test.OuterMessage = function(opt_data) { +export function OuterMessage(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.jspb.test.OuterMessage, jspb.Message); +goog.inherits(OuterMessage, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.jspb.test.OuterMessage.displayName = 'proto.jspb.test.OuterMessage'; + OuterMessage.displayName = 'proto.jspb.test.OuterMessage'; } /** * Generated by JsPbCodeGenerator. @@ -334,16 +287,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.jspb.test.OuterMessage.Complex = function(opt_data) { +OuterMessage.Complex = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.jspb.test.OuterMessage.Complex, jspb.Message); +goog.inherits(OuterMessage.Complex, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.jspb.test.OuterMessage.Complex.displayName = 'proto.jspb.test.OuterMessage.Complex'; + OuterMessage.Complex.displayName = 'proto.jspb.test.OuterMessage.Complex'; } /** * Generated by JsPbCodeGenerator. @@ -355,16 +308,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.jspb.test.MineField = function(opt_data) { +export function MineField(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.jspb.test.MineField, jspb.Message); +goog.inherits(MineField, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.jspb.test.MineField.displayName = 'proto.jspb.test.MineField'; + MineField.displayName = 'proto.jspb.test.MineField'; } /** * Generated by JsPbCodeGenerator. @@ -376,16 +329,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.jspb.test.IsExtension = function(opt_data) { +export function IsExtension(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.jspb.test.IsExtension, jspb.Message); +goog.inherits(IsExtension, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.jspb.test.IsExtension.displayName = 'proto.jspb.test.IsExtension'; + IsExtension.displayName = 'proto.jspb.test.IsExtension'; } /** * Generated by JsPbCodeGenerator. @@ -397,16 +350,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.jspb.test.IndirectExtension = function(opt_data) { +export function IndirectExtension(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.jspb.test.IndirectExtension, jspb.Message); +goog.inherits(IndirectExtension, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.jspb.test.IndirectExtension.displayName = 'proto.jspb.test.IndirectExtension'; + IndirectExtension.displayName = 'proto.jspb.test.IndirectExtension'; } /** * Generated by JsPbCodeGenerator. @@ -418,16 +371,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.jspb.test.DefaultValues = function(opt_data) { +export function DefaultValues(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.jspb.test.DefaultValues, jspb.Message); +goog.inherits(DefaultValues, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.jspb.test.DefaultValues.displayName = 'proto.jspb.test.DefaultValues'; + DefaultValues.displayName = 'proto.jspb.test.DefaultValues'; } /** * Generated by JsPbCodeGenerator. @@ -439,16 +392,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.jspb.test.FloatingPointFields = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.jspb.test.FloatingPointFields.repeatedFields_, null); +export function FloatingPointFields(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, FloatingPointFields.repeatedFields_, null); }; -goog.inherits(proto.jspb.test.FloatingPointFields, jspb.Message); +goog.inherits(FloatingPointFields, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.jspb.test.FloatingPointFields.displayName = 'proto.jspb.test.FloatingPointFields'; + FloatingPointFields.displayName = 'proto.jspb.test.FloatingPointFields'; } /** * Generated by JsPbCodeGenerator. @@ -460,16 +413,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.jspb.test.BooleanFields = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.jspb.test.BooleanFields.repeatedFields_, null); +export function BooleanFields(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, BooleanFields.repeatedFields_, null); }; -goog.inherits(proto.jspb.test.BooleanFields, jspb.Message); +goog.inherits(BooleanFields, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.jspb.test.BooleanFields.displayName = 'proto.jspb.test.BooleanFields'; + BooleanFields.displayName = 'proto.jspb.test.BooleanFields'; } /** * Generated by JsPbCodeGenerator. @@ -481,16 +434,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.jspb.test.TestClone = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, 8, proto.jspb.test.TestClone.repeatedFields_, null); +export function TestClone(opt_data) { + jspb.Message.initialize(this, opt_data, 0, 8, TestClone.repeatedFields_, null); }; -goog.inherits(proto.jspb.test.TestClone, jspb.Message); +goog.inherits(TestClone, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.jspb.test.TestClone.displayName = 'proto.jspb.test.TestClone'; + TestClone.displayName = 'proto.jspb.test.TestClone'; } /** @@ -505,7 +458,7 @@ if (goog.DEBUG && !COMPILED) { * * @type {!Object} */ -proto.jspb.test.TestClone.extensions = {}; +TestClone.extensions = {}; /** @@ -520,7 +473,7 @@ proto.jspb.test.TestClone.extensions = {}; * * @type {!Object} */ -proto.jspb.test.TestClone.extensionsBinary = {}; +TestClone.extensionsBinary = {}; /** * Generated by JsPbCodeGenerator. @@ -532,16 +485,16 @@ proto.jspb.test.TestClone.extensionsBinary = {}; * @extends {jspb.Message} * @constructor */ -proto.jspb.test.TestCloneExtension = function(opt_data) { +export function TestCloneExtension(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.jspb.test.TestCloneExtension, jspb.Message); +goog.inherits(TestCloneExtension, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.jspb.test.TestCloneExtension.displayName = 'proto.jspb.test.TestCloneExtension'; + TestCloneExtension.displayName = 'proto.jspb.test.TestCloneExtension'; } /** * Generated by JsPbCodeGenerator. @@ -553,16 +506,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.jspb.test.CloneExtension = function(opt_data) { +export function CloneExtension(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.jspb.test.CloneExtension, jspb.Message); +goog.inherits(CloneExtension, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.jspb.test.CloneExtension.displayName = 'proto.jspb.test.CloneExtension'; + CloneExtension.displayName = 'proto.jspb.test.CloneExtension'; } /** * Generated by JsPbCodeGenerator. @@ -574,16 +527,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.jspb.test.TestGroup = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.jspb.test.TestGroup.repeatedFields_, null); +export function TestGroup(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, TestGroup.repeatedFields_, null); }; -goog.inherits(proto.jspb.test.TestGroup, jspb.Message); +goog.inherits(TestGroup, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.jspb.test.TestGroup.displayName = 'proto.jspb.test.TestGroup'; + TestGroup.displayName = 'proto.jspb.test.TestGroup'; } /** * Generated by JsPbCodeGenerator. @@ -595,16 +548,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.jspb.test.TestGroup.RepeatedGroup = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.jspb.test.TestGroup.RepeatedGroup.repeatedFields_, null); +TestGroup.RepeatedGroup = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, TestGroup.RepeatedGroup.repeatedFields_, null); }; -goog.inherits(proto.jspb.test.TestGroup.RepeatedGroup, jspb.Message); +goog.inherits(TestGroup.RepeatedGroup, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.jspb.test.TestGroup.RepeatedGroup.displayName = 'proto.jspb.test.TestGroup.RepeatedGroup'; + TestGroup.RepeatedGroup.displayName = 'proto.jspb.test.TestGroup.RepeatedGroup'; } /** * Generated by JsPbCodeGenerator. @@ -616,16 +569,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.jspb.test.TestGroup.RequiredGroup = function(opt_data) { +TestGroup.RequiredGroup = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.jspb.test.TestGroup.RequiredGroup, jspb.Message); +goog.inherits(TestGroup.RequiredGroup, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.jspb.test.TestGroup.RequiredGroup.displayName = 'proto.jspb.test.TestGroup.RequiredGroup'; + TestGroup.RequiredGroup.displayName = 'proto.jspb.test.TestGroup.RequiredGroup'; } /** * Generated by JsPbCodeGenerator. @@ -637,16 +590,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.jspb.test.TestGroup.OptionalGroup = function(opt_data) { +TestGroup.OptionalGroup = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.jspb.test.TestGroup.OptionalGroup, jspb.Message); +goog.inherits(TestGroup.OptionalGroup, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.jspb.test.TestGroup.OptionalGroup.displayName = 'proto.jspb.test.TestGroup.OptionalGroup'; + TestGroup.OptionalGroup.displayName = 'proto.jspb.test.TestGroup.OptionalGroup'; } /** * Generated by JsPbCodeGenerator. @@ -658,16 +611,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.jspb.test.TestGroup1 = function(opt_data) { +export function TestGroup1(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.jspb.test.TestGroup1, jspb.Message); +goog.inherits(TestGroup1, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.jspb.test.TestGroup1.displayName = 'proto.jspb.test.TestGroup1'; + TestGroup1.displayName = 'proto.jspb.test.TestGroup1'; } /** * Generated by JsPbCodeGenerator. @@ -679,16 +632,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.jspb.test.TestReservedNames = function(opt_data) { +export function TestReservedNames(opt_data) { jspb.Message.initialize(this, opt_data, 0, 2, null, null); }; -goog.inherits(proto.jspb.test.TestReservedNames, jspb.Message); +goog.inherits(TestReservedNames, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.jspb.test.TestReservedNames.displayName = 'proto.jspb.test.TestReservedNames'; + TestReservedNames.displayName = 'proto.jspb.test.TestReservedNames'; } /** @@ -703,7 +656,7 @@ if (goog.DEBUG && !COMPILED) { * * @type {!Object} */ -proto.jspb.test.TestReservedNames.extensions = {}; +TestReservedNames.extensions = {}; /** @@ -718,7 +671,7 @@ proto.jspb.test.TestReservedNames.extensions = {}; * * @type {!Object} */ -proto.jspb.test.TestReservedNames.extensionsBinary = {}; +TestReservedNames.extensionsBinary = {}; /** * Generated by JsPbCodeGenerator. @@ -730,16 +683,16 @@ proto.jspb.test.TestReservedNames.extensionsBinary = {}; * @extends {jspb.Message} * @constructor */ -proto.jspb.test.TestReservedNamesExtension = function(opt_data) { +export function TestReservedNamesExtension(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.jspb.test.TestReservedNamesExtension, jspb.Message); +goog.inherits(TestReservedNamesExtension, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.jspb.test.TestReservedNamesExtension.displayName = 'proto.jspb.test.TestReservedNamesExtension'; + TestReservedNamesExtension.displayName = 'proto.jspb.test.TestReservedNamesExtension'; } /** * Generated by JsPbCodeGenerator. @@ -751,16 +704,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.jspb.test.TestMessageWithOneof = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.jspb.test.TestMessageWithOneof.repeatedFields_, proto.jspb.test.TestMessageWithOneof.oneofGroups_); +export function TestMessageWithOneof(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, TestMessageWithOneof.repeatedFields_, TestMessageWithOneof.oneofGroups_); }; -goog.inherits(proto.jspb.test.TestMessageWithOneof, jspb.Message); +goog.inherits(TestMessageWithOneof, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.jspb.test.TestMessageWithOneof.displayName = 'proto.jspb.test.TestMessageWithOneof'; + TestMessageWithOneof.displayName = 'proto.jspb.test.TestMessageWithOneof'; } /** * Generated by JsPbCodeGenerator. @@ -772,16 +725,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.jspb.test.TestEndsWithBytes = function(opt_data) { +export function TestEndsWithBytes(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.jspb.test.TestEndsWithBytes, jspb.Message); +goog.inherits(TestEndsWithBytes, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.jspb.test.TestEndsWithBytes.displayName = 'proto.jspb.test.TestEndsWithBytes'; + TestEndsWithBytes.displayName = 'proto.jspb.test.TestEndsWithBytes'; } /** * Generated by JsPbCodeGenerator. @@ -793,16 +746,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.jspb.test.TestLastFieldBeforePivot = function(opt_data) { +export function TestLastFieldBeforePivot(opt_data) { jspb.Message.initialize(this, opt_data, 0, 2, null, null); }; -goog.inherits(proto.jspb.test.TestLastFieldBeforePivot, jspb.Message); +goog.inherits(TestLastFieldBeforePivot, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.jspb.test.TestLastFieldBeforePivot.displayName = 'proto.jspb.test.TestLastFieldBeforePivot'; + TestLastFieldBeforePivot.displayName = 'proto.jspb.test.TestLastFieldBeforePivot'; } /** @@ -817,7 +770,7 @@ if (goog.DEBUG && !COMPILED) { * * @type {!Object} */ -proto.jspb.test.TestLastFieldBeforePivot.extensions = {}; +TestLastFieldBeforePivot.extensions = {}; /** @@ -832,7 +785,7 @@ proto.jspb.test.TestLastFieldBeforePivot.extensions = {}; * * @type {!Object} */ -proto.jspb.test.TestLastFieldBeforePivot.extensionsBinary = {}; +TestLastFieldBeforePivot.extensionsBinary = {}; /** * Generated by JsPbCodeGenerator. @@ -844,16 +797,16 @@ proto.jspb.test.TestLastFieldBeforePivot.extensionsBinary = {}; * @extends {jspb.Message} * @constructor */ -proto.jspb.test.Int64Types = function(opt_data) { +export function Int64Types(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.jspb.test.Int64Types, jspb.Message); +goog.inherits(Int64Types, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.jspb.test.Int64Types.displayName = 'proto.jspb.test.Int64Types'; + Int64Types.displayName = 'proto.jspb.test.Int64Types'; } /** * Generated by JsPbCodeGenerator. @@ -865,16 +818,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.jspb.test.TestMapFieldsNoBinary = function(opt_data) { +export function TestMapFieldsNoBinary(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.jspb.test.TestMapFieldsNoBinary, jspb.Message); +goog.inherits(TestMapFieldsNoBinary, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.jspb.test.TestMapFieldsNoBinary.displayName = 'proto.jspb.test.TestMapFieldsNoBinary'; + TestMapFieldsNoBinary.displayName = 'proto.jspb.test.TestMapFieldsNoBinary'; } /** * Generated by JsPbCodeGenerator. @@ -886,16 +839,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.jspb.test.MapValueMessageNoBinary = function(opt_data) { +export function MapValueMessageNoBinary(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.jspb.test.MapValueMessageNoBinary, jspb.Message); +goog.inherits(MapValueMessageNoBinary, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.jspb.test.MapValueMessageNoBinary.displayName = 'proto.jspb.test.MapValueMessageNoBinary'; + MapValueMessageNoBinary.displayName = 'proto.jspb.test.MapValueMessageNoBinary'; } /** * Generated by JsPbCodeGenerator. @@ -907,16 +860,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.jspb.test.Deeply = function(opt_data) { +export function Deeply(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.jspb.test.Deeply, jspb.Message); +goog.inherits(Deeply, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.jspb.test.Deeply.displayName = 'proto.jspb.test.Deeply'; + Deeply.displayName = 'proto.jspb.test.Deeply'; } /** * Generated by JsPbCodeGenerator. @@ -928,16 +881,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.jspb.test.Deeply.Nested = function(opt_data) { +Deeply.Nested = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.jspb.test.Deeply.Nested, jspb.Message); +goog.inherits(Deeply.Nested, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.jspb.test.Deeply.Nested.displayName = 'proto.jspb.test.Deeply.Nested'; + Deeply.Nested.displayName = 'proto.jspb.test.Deeply.Nested'; } /** * Generated by JsPbCodeGenerator. @@ -949,16 +902,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.jspb.test.Deeply.Nested.Message = function(opt_data) { +Deeply.Nested.Message = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.jspb.test.Deeply.Nested.Message, jspb.Message); +goog.inherits(Deeply.Nested.Message, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.jspb.test.Deeply.Nested.Message.displayName = 'proto.jspb.test.Deeply.Nested.Message'; + Deeply.Nested.Message.displayName = 'proto.jspb.test.Deeply.Nested.Message'; } @@ -976,8 +929,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.jspb.test.Empty.prototype.toObject = function(opt_includeInstance) { - return proto.jspb.test.Empty.toObject(opt_includeInstance, this); +Empty.prototype.toObject = function(opt_includeInstance) { + return Empty.toObject(opt_includeInstance, this); }; @@ -990,7 +943,7 @@ proto.jspb.test.Empty.prototype.toObject = function(opt_includeInstance) { * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.Empty.toObject = function(includeInstance, msg) { +Empty.toObject = function(includeInstance, msg) { var f, obj = { }; @@ -1008,10 +961,10 @@ proto.jspb.test.Empty.toObject = function(includeInstance, msg) { * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.jspb.test.Empty} */ -proto.jspb.test.Empty.deserializeBinary = function(bytes) { +Empty.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.jspb.test.Empty; - return proto.jspb.test.Empty.deserializeBinaryFromReader(msg, reader); + var msg = new Empty; + return Empty.deserializeBinaryFromReader(msg, reader); }; @@ -1022,7 +975,7 @@ proto.jspb.test.Empty.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.jspb.test.Empty} */ -proto.jspb.test.Empty.deserializeBinaryFromReader = function(msg, reader) { +Empty.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -1042,9 +995,9 @@ proto.jspb.test.Empty.deserializeBinaryFromReader = function(msg, reader) { * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.jspb.test.Empty.prototype.serializeBinary = function() { +Empty.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.jspb.test.Empty.serializeBinaryToWriter(this, writer); + Empty.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -1056,7 +1009,7 @@ proto.jspb.test.Empty.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.Empty.serializeBinaryToWriter = function(message, writer) { +Empty.serializeBinaryToWriter = function(message, writer) { var f = undefined; }; @@ -1077,8 +1030,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.jspb.test.EnumContainer.prototype.toObject = function(opt_includeInstance) { - return proto.jspb.test.EnumContainer.toObject(opt_includeInstance, this); +EnumContainer.prototype.toObject = function(opt_includeInstance) { + return EnumContainer.toObject(opt_includeInstance, this); }; @@ -1091,7 +1044,7 @@ proto.jspb.test.EnumContainer.prototype.toObject = function(opt_includeInstance) * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.EnumContainer.toObject = function(includeInstance, msg) { +EnumContainer.toObject = function(includeInstance, msg) { var f, obj = { outerEnum: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f }; @@ -1109,10 +1062,10 @@ outerEnum: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.jspb.test.EnumContainer} */ -proto.jspb.test.EnumContainer.deserializeBinary = function(bytes) { +EnumContainer.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.jspb.test.EnumContainer; - return proto.jspb.test.EnumContainer.deserializeBinaryFromReader(msg, reader); + var msg = new EnumContainer; + return EnumContainer.deserializeBinaryFromReader(msg, reader); }; @@ -1123,7 +1076,7 @@ proto.jspb.test.EnumContainer.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.jspb.test.EnumContainer} */ -proto.jspb.test.EnumContainer.deserializeBinaryFromReader = function(msg, reader) { +EnumContainer.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -1147,9 +1100,9 @@ proto.jspb.test.EnumContainer.deserializeBinaryFromReader = function(msg, reader * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.jspb.test.EnumContainer.prototype.serializeBinary = function() { +EnumContainer.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.jspb.test.EnumContainer.serializeBinaryToWriter(this, writer); + EnumContainer.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -1161,7 +1114,7 @@ proto.jspb.test.EnumContainer.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.EnumContainer.serializeBinaryToWriter = function(message, writer) { +EnumContainer.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = /** @type {!proto.jspb.test.OuterEnum} */ (jspb.Message.getField(message, 1)); if (f != null) { @@ -1177,7 +1130,7 @@ proto.jspb.test.EnumContainer.serializeBinaryToWriter = function(message, writer * optional OuterEnum outer_enum = 1; * @return {!proto.jspb.test.OuterEnum} */ -proto.jspb.test.EnumContainer.prototype.getOuterEnum = function() { +EnumContainer.prototype.getOuterEnum = function() { return /** @type {!proto.jspb.test.OuterEnum} */ (jspb.Message.getFieldWithDefault(this, 1, 1)); }; @@ -1186,7 +1139,7 @@ proto.jspb.test.EnumContainer.prototype.getOuterEnum = function() { * @param {!proto.jspb.test.OuterEnum} value * @return {!proto.jspb.test.EnumContainer} returns this */ -proto.jspb.test.EnumContainer.prototype.setOuterEnum = function(value) { +EnumContainer.prototype.setOuterEnum = function(value) { return jspb.Message.setField(this, 1, value); }; @@ -1195,7 +1148,7 @@ proto.jspb.test.EnumContainer.prototype.setOuterEnum = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.EnumContainer} returns this */ -proto.jspb.test.EnumContainer.prototype.clearOuterEnum = function() { +EnumContainer.prototype.clearOuterEnum = function() { return jspb.Message.setField(this, 1, undefined); }; @@ -1204,7 +1157,7 @@ proto.jspb.test.EnumContainer.prototype.clearOuterEnum = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.EnumContainer.prototype.hasOuterEnum = function() { +EnumContainer.prototype.hasOuterEnum = function() { return jspb.Message.getField(this, 1) != null; }; @@ -1215,7 +1168,7 @@ proto.jspb.test.EnumContainer.prototype.hasOuterEnum = function() { * @private {!Array} * @const */ -proto.jspb.test.Simple1.repeatedFields_ = [2]; +Simple1.repeatedFields_ = [2]; @@ -1232,8 +1185,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.jspb.test.Simple1.prototype.toObject = function(opt_includeInstance) { - return proto.jspb.test.Simple1.toObject(opt_includeInstance, this); +Simple1.prototype.toObject = function(opt_includeInstance) { + return Simple1.toObject(opt_includeInstance, this); }; @@ -1246,7 +1199,7 @@ proto.jspb.test.Simple1.prototype.toObject = function(opt_includeInstance) { * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.Simple1.toObject = function(includeInstance, msg) { +Simple1.toObject = function(includeInstance, msg) { var f, obj = { aString: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, aRepeatedStringList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? undefined : f, @@ -1266,10 +1219,10 @@ aBoolean: (f = jspb.Message.getBooleanField(msg, 3)) == null ? undefined : f * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.jspb.test.Simple1} */ -proto.jspb.test.Simple1.deserializeBinary = function(bytes) { +Simple1.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.jspb.test.Simple1; - return proto.jspb.test.Simple1.deserializeBinaryFromReader(msg, reader); + var msg = new Simple1; + return Simple1.deserializeBinaryFromReader(msg, reader); }; @@ -1280,7 +1233,7 @@ proto.jspb.test.Simple1.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.jspb.test.Simple1} */ -proto.jspb.test.Simple1.deserializeBinaryFromReader = function(msg, reader) { +Simple1.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -1312,9 +1265,9 @@ proto.jspb.test.Simple1.deserializeBinaryFromReader = function(msg, reader) { * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.jspb.test.Simple1.prototype.serializeBinary = function() { +Simple1.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.jspb.test.Simple1.serializeBinaryToWriter(this, writer); + Simple1.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -1326,7 +1279,7 @@ proto.jspb.test.Simple1.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.Simple1.serializeBinaryToWriter = function(message, writer) { +Simple1.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = /** @type {string} */ (jspb.Message.getField(message, 1)); if (f != null) { @@ -1356,7 +1309,7 @@ proto.jspb.test.Simple1.serializeBinaryToWriter = function(message, writer) { * required string a_string = 1; * @return {string} */ -proto.jspb.test.Simple1.prototype.getAString = function() { +Simple1.prototype.getAString = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; @@ -1365,7 +1318,7 @@ proto.jspb.test.Simple1.prototype.getAString = function() { * @param {string} value * @return {!proto.jspb.test.Simple1} returns this */ -proto.jspb.test.Simple1.prototype.setAString = function(value) { +Simple1.prototype.setAString = function(value) { return jspb.Message.setField(this, 1, value); }; @@ -1374,7 +1327,7 @@ proto.jspb.test.Simple1.prototype.setAString = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.Simple1} returns this */ -proto.jspb.test.Simple1.prototype.clearAString = function() { +Simple1.prototype.clearAString = function() { return jspb.Message.setField(this, 1, undefined); }; @@ -1383,7 +1336,7 @@ proto.jspb.test.Simple1.prototype.clearAString = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.Simple1.prototype.hasAString = function() { +Simple1.prototype.hasAString = function() { return jspb.Message.getField(this, 1) != null; }; @@ -1392,7 +1345,7 @@ proto.jspb.test.Simple1.prototype.hasAString = function() { * repeated string a_repeated_string = 2; * @return {!Array} */ -proto.jspb.test.Simple1.prototype.getARepeatedStringList = function() { +Simple1.prototype.getARepeatedStringList = function() { return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 2)); }; @@ -1401,7 +1354,7 @@ proto.jspb.test.Simple1.prototype.getARepeatedStringList = function() { * @param {!Array} value * @return {!proto.jspb.test.Simple1} returns this */ -proto.jspb.test.Simple1.prototype.setARepeatedStringList = function(value) { +Simple1.prototype.setARepeatedStringList = function(value) { return jspb.Message.setField(this, 2, value || []); }; @@ -1411,7 +1364,7 @@ proto.jspb.test.Simple1.prototype.setARepeatedStringList = function(value) { * @param {number=} opt_index * @return {!proto.jspb.test.Simple1} returns this */ -proto.jspb.test.Simple1.prototype.addARepeatedString = function(value, opt_index) { +Simple1.prototype.addARepeatedString = function(value, opt_index) { return jspb.Message.addToRepeatedField(this, 2, value, opt_index); }; @@ -1420,7 +1373,7 @@ proto.jspb.test.Simple1.prototype.addARepeatedString = function(value, opt_index * Clears the list making it empty but non-null. * @return {!proto.jspb.test.Simple1} returns this */ -proto.jspb.test.Simple1.prototype.clearARepeatedStringList = function() { +Simple1.prototype.clearARepeatedStringList = function() { return this.setARepeatedStringList([]); }; @@ -1429,7 +1382,7 @@ proto.jspb.test.Simple1.prototype.clearARepeatedStringList = function() { * optional bool a_boolean = 3; * @return {boolean} */ -proto.jspb.test.Simple1.prototype.getABoolean = function() { +Simple1.prototype.getABoolean = function() { return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); }; @@ -1438,7 +1391,7 @@ proto.jspb.test.Simple1.prototype.getABoolean = function() { * @param {boolean} value * @return {!proto.jspb.test.Simple1} returns this */ -proto.jspb.test.Simple1.prototype.setABoolean = function(value) { +Simple1.prototype.setABoolean = function(value) { return jspb.Message.setField(this, 3, value); }; @@ -1447,7 +1400,7 @@ proto.jspb.test.Simple1.prototype.setABoolean = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.Simple1} returns this */ -proto.jspb.test.Simple1.prototype.clearABoolean = function() { +Simple1.prototype.clearABoolean = function() { return jspb.Message.setField(this, 3, undefined); }; @@ -1456,7 +1409,7 @@ proto.jspb.test.Simple1.prototype.clearABoolean = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.Simple1.prototype.hasABoolean = function() { +Simple1.prototype.hasABoolean = function() { return jspb.Message.getField(this, 3) != null; }; @@ -1467,7 +1420,7 @@ proto.jspb.test.Simple1.prototype.hasABoolean = function() { * @private {!Array} * @const */ -proto.jspb.test.Simple2.repeatedFields_ = [2]; +Simple2.repeatedFields_ = [2]; @@ -1484,8 +1437,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.jspb.test.Simple2.prototype.toObject = function(opt_includeInstance) { - return proto.jspb.test.Simple2.toObject(opt_includeInstance, this); +Simple2.prototype.toObject = function(opt_includeInstance) { + return Simple2.toObject(opt_includeInstance, this); }; @@ -1498,7 +1451,7 @@ proto.jspb.test.Simple2.prototype.toObject = function(opt_includeInstance) { * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.Simple2.toObject = function(includeInstance, msg) { +Simple2.toObject = function(includeInstance, msg) { var f, obj = { aString: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, aRepeatedStringList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? undefined : f @@ -1517,10 +1470,10 @@ aRepeatedStringList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? undef * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.jspb.test.Simple2} */ -proto.jspb.test.Simple2.deserializeBinary = function(bytes) { +Simple2.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.jspb.test.Simple2; - return proto.jspb.test.Simple2.deserializeBinaryFromReader(msg, reader); + var msg = new Simple2; + return Simple2.deserializeBinaryFromReader(msg, reader); }; @@ -1531,7 +1484,7 @@ proto.jspb.test.Simple2.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.jspb.test.Simple2} */ -proto.jspb.test.Simple2.deserializeBinaryFromReader = function(msg, reader) { +Simple2.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -1559,9 +1512,9 @@ proto.jspb.test.Simple2.deserializeBinaryFromReader = function(msg, reader) { * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.jspb.test.Simple2.prototype.serializeBinary = function() { +Simple2.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.jspb.test.Simple2.serializeBinaryToWriter(this, writer); + Simple2.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -1573,7 +1526,7 @@ proto.jspb.test.Simple2.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.Simple2.serializeBinaryToWriter = function(message, writer) { +Simple2.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = /** @type {string} */ (jspb.Message.getField(message, 1)); if (f != null) { @@ -1596,7 +1549,7 @@ proto.jspb.test.Simple2.serializeBinaryToWriter = function(message, writer) { * required string a_string = 1; * @return {string} */ -proto.jspb.test.Simple2.prototype.getAString = function() { +Simple2.prototype.getAString = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; @@ -1605,7 +1558,7 @@ proto.jspb.test.Simple2.prototype.getAString = function() { * @param {string} value * @return {!proto.jspb.test.Simple2} returns this */ -proto.jspb.test.Simple2.prototype.setAString = function(value) { +Simple2.prototype.setAString = function(value) { return jspb.Message.setField(this, 1, value); }; @@ -1614,7 +1567,7 @@ proto.jspb.test.Simple2.prototype.setAString = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.Simple2} returns this */ -proto.jspb.test.Simple2.prototype.clearAString = function() { +Simple2.prototype.clearAString = function() { return jspb.Message.setField(this, 1, undefined); }; @@ -1623,7 +1576,7 @@ proto.jspb.test.Simple2.prototype.clearAString = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.Simple2.prototype.hasAString = function() { +Simple2.prototype.hasAString = function() { return jspb.Message.getField(this, 1) != null; }; @@ -1632,7 +1585,7 @@ proto.jspb.test.Simple2.prototype.hasAString = function() { * repeated string a_repeated_string = 2; * @return {!Array} */ -proto.jspb.test.Simple2.prototype.getARepeatedStringList = function() { +Simple2.prototype.getARepeatedStringList = function() { return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 2)); }; @@ -1641,7 +1594,7 @@ proto.jspb.test.Simple2.prototype.getARepeatedStringList = function() { * @param {!Array} value * @return {!proto.jspb.test.Simple2} returns this */ -proto.jspb.test.Simple2.prototype.setARepeatedStringList = function(value) { +Simple2.prototype.setARepeatedStringList = function(value) { return jspb.Message.setField(this, 2, value || []); }; @@ -1651,7 +1604,7 @@ proto.jspb.test.Simple2.prototype.setARepeatedStringList = function(value) { * @param {number=} opt_index * @return {!proto.jspb.test.Simple2} returns this */ -proto.jspb.test.Simple2.prototype.addARepeatedString = function(value, opt_index) { +Simple2.prototype.addARepeatedString = function(value, opt_index) { return jspb.Message.addToRepeatedField(this, 2, value, opt_index); }; @@ -1660,7 +1613,7 @@ proto.jspb.test.Simple2.prototype.addARepeatedString = function(value, opt_index * Clears the list making it empty but non-null. * @return {!proto.jspb.test.Simple2} returns this */ -proto.jspb.test.Simple2.prototype.clearARepeatedStringList = function() { +Simple2.prototype.clearARepeatedStringList = function() { return this.setARepeatedStringList([]); }; @@ -1681,8 +1634,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.jspb.test.SpecialCases.prototype.toObject = function(opt_includeInstance) { - return proto.jspb.test.SpecialCases.toObject(opt_includeInstance, this); +SpecialCases.prototype.toObject = function(opt_includeInstance) { + return SpecialCases.toObject(opt_includeInstance, this); }; @@ -1695,7 +1648,7 @@ proto.jspb.test.SpecialCases.prototype.toObject = function(opt_includeInstance) * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.SpecialCases.toObject = function(includeInstance, msg) { +SpecialCases.toObject = function(includeInstance, msg) { var f, obj = { normal: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, pb_default: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f, @@ -1716,10 +1669,10 @@ pb_var: (f = jspb.Message.getField(msg, 4)) == null ? undefined : f * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.jspb.test.SpecialCases} */ -proto.jspb.test.SpecialCases.deserializeBinary = function(bytes) { +SpecialCases.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.jspb.test.SpecialCases; - return proto.jspb.test.SpecialCases.deserializeBinaryFromReader(msg, reader); + var msg = new SpecialCases; + return SpecialCases.deserializeBinaryFromReader(msg, reader); }; @@ -1730,7 +1683,7 @@ proto.jspb.test.SpecialCases.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.jspb.test.SpecialCases} */ -proto.jspb.test.SpecialCases.deserializeBinaryFromReader = function(msg, reader) { +SpecialCases.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -1766,9 +1719,9 @@ proto.jspb.test.SpecialCases.deserializeBinaryFromReader = function(msg, reader) * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.jspb.test.SpecialCases.prototype.serializeBinary = function() { +SpecialCases.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.jspb.test.SpecialCases.serializeBinaryToWriter(this, writer); + SpecialCases.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -1780,7 +1733,7 @@ proto.jspb.test.SpecialCases.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.SpecialCases.serializeBinaryToWriter = function(message, writer) { +SpecialCases.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = /** @type {string} */ (jspb.Message.getField(message, 1)); if (f != null) { @@ -1817,7 +1770,7 @@ proto.jspb.test.SpecialCases.serializeBinaryToWriter = function(message, writer) * required string normal = 1; * @return {string} */ -proto.jspb.test.SpecialCases.prototype.getNormal = function() { +SpecialCases.prototype.getNormal = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; @@ -1826,7 +1779,7 @@ proto.jspb.test.SpecialCases.prototype.getNormal = function() { * @param {string} value * @return {!proto.jspb.test.SpecialCases} returns this */ -proto.jspb.test.SpecialCases.prototype.setNormal = function(value) { +SpecialCases.prototype.setNormal = function(value) { return jspb.Message.setField(this, 1, value); }; @@ -1835,7 +1788,7 @@ proto.jspb.test.SpecialCases.prototype.setNormal = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.SpecialCases} returns this */ -proto.jspb.test.SpecialCases.prototype.clearNormal = function() { +SpecialCases.prototype.clearNormal = function() { return jspb.Message.setField(this, 1, undefined); }; @@ -1844,7 +1797,7 @@ proto.jspb.test.SpecialCases.prototype.clearNormal = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.SpecialCases.prototype.hasNormal = function() { +SpecialCases.prototype.hasNormal = function() { return jspb.Message.getField(this, 1) != null; }; @@ -1853,7 +1806,7 @@ proto.jspb.test.SpecialCases.prototype.hasNormal = function() { * required string default = 2; * @return {string} */ -proto.jspb.test.SpecialCases.prototype.getDefault = function() { +SpecialCases.prototype.getDefault = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; @@ -1862,7 +1815,7 @@ proto.jspb.test.SpecialCases.prototype.getDefault = function() { * @param {string} value * @return {!proto.jspb.test.SpecialCases} returns this */ -proto.jspb.test.SpecialCases.prototype.setDefault = function(value) { +SpecialCases.prototype.setDefault = function(value) { return jspb.Message.setField(this, 2, value); }; @@ -1871,7 +1824,7 @@ proto.jspb.test.SpecialCases.prototype.setDefault = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.SpecialCases} returns this */ -proto.jspb.test.SpecialCases.prototype.clearDefault = function() { +SpecialCases.prototype.clearDefault = function() { return jspb.Message.setField(this, 2, undefined); }; @@ -1880,7 +1833,7 @@ proto.jspb.test.SpecialCases.prototype.clearDefault = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.SpecialCases.prototype.hasDefault = function() { +SpecialCases.prototype.hasDefault = function() { return jspb.Message.getField(this, 2) != null; }; @@ -1889,7 +1842,7 @@ proto.jspb.test.SpecialCases.prototype.hasDefault = function() { * required string function = 3; * @return {string} */ -proto.jspb.test.SpecialCases.prototype.getFunction = function() { +SpecialCases.prototype.getFunction = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); }; @@ -1898,7 +1851,7 @@ proto.jspb.test.SpecialCases.prototype.getFunction = function() { * @param {string} value * @return {!proto.jspb.test.SpecialCases} returns this */ -proto.jspb.test.SpecialCases.prototype.setFunction = function(value) { +SpecialCases.prototype.setFunction = function(value) { return jspb.Message.setField(this, 3, value); }; @@ -1907,7 +1860,7 @@ proto.jspb.test.SpecialCases.prototype.setFunction = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.SpecialCases} returns this */ -proto.jspb.test.SpecialCases.prototype.clearFunction = function() { +SpecialCases.prototype.clearFunction = function() { return jspb.Message.setField(this, 3, undefined); }; @@ -1916,7 +1869,7 @@ proto.jspb.test.SpecialCases.prototype.clearFunction = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.SpecialCases.prototype.hasFunction = function() { +SpecialCases.prototype.hasFunction = function() { return jspb.Message.getField(this, 3) != null; }; @@ -1925,7 +1878,7 @@ proto.jspb.test.SpecialCases.prototype.hasFunction = function() { * required string var = 4; * @return {string} */ -proto.jspb.test.SpecialCases.prototype.getVar = function() { +SpecialCases.prototype.getVar = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); }; @@ -1934,7 +1887,7 @@ proto.jspb.test.SpecialCases.prototype.getVar = function() { * @param {string} value * @return {!proto.jspb.test.SpecialCases} returns this */ -proto.jspb.test.SpecialCases.prototype.setVar = function(value) { +SpecialCases.prototype.setVar = function(value) { return jspb.Message.setField(this, 4, value); }; @@ -1943,7 +1896,7 @@ proto.jspb.test.SpecialCases.prototype.setVar = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.SpecialCases} returns this */ -proto.jspb.test.SpecialCases.prototype.clearVar = function() { +SpecialCases.prototype.clearVar = function() { return jspb.Message.setField(this, 4, undefined); }; @@ -1952,7 +1905,7 @@ proto.jspb.test.SpecialCases.prototype.clearVar = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.SpecialCases.prototype.hasVar = function() { +SpecialCases.prototype.hasVar = function() { return jspb.Message.getField(this, 4) != null; }; @@ -1963,7 +1916,7 @@ proto.jspb.test.SpecialCases.prototype.hasVar = function() { * @private {!Array} * @const */ -proto.jspb.test.OptionalFields.repeatedFields_ = [4,5]; +OptionalFields.repeatedFields_ = [4,5]; @@ -1980,8 +1933,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.jspb.test.OptionalFields.prototype.toObject = function(opt_includeInstance) { - return proto.jspb.test.OptionalFields.toObject(opt_includeInstance, this); +OptionalFields.prototype.toObject = function(opt_includeInstance) { + return OptionalFields.toObject(opt_includeInstance, this); }; @@ -1994,13 +1947,13 @@ proto.jspb.test.OptionalFields.prototype.toObject = function(opt_includeInstance * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.OptionalFields.toObject = function(includeInstance, msg) { +OptionalFields.toObject = function(includeInstance, msg) { var f, obj = { aString: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, aBool: (f = jspb.Message.getBooleanField(msg, 2)) == null ? undefined : f, -aNestedMessage: (f = msg.getANestedMessage()) && proto.jspb.test.OptionalFields.Nested.toObject(includeInstance, f), +aNestedMessage: (f = msg.getANestedMessage()) && OptionalFields.Nested.toObject(includeInstance, f), aRepeatedMessageList: jspb.Message.toObjectList(msg.getARepeatedMessageList(), - proto.jspb.test.OptionalFields.Nested.toObject, includeInstance), + OptionalFields.Nested.toObject, includeInstance), aRepeatedStringList: (f = jspb.Message.getRepeatedField(msg, 5)) == null ? undefined : f }; @@ -2017,10 +1970,10 @@ aRepeatedStringList: (f = jspb.Message.getRepeatedField(msg, 5)) == null ? undef * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.jspb.test.OptionalFields} */ -proto.jspb.test.OptionalFields.deserializeBinary = function(bytes) { +OptionalFields.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.jspb.test.OptionalFields; - return proto.jspb.test.OptionalFields.deserializeBinaryFromReader(msg, reader); + var msg = new OptionalFields; + return OptionalFields.deserializeBinaryFromReader(msg, reader); }; @@ -2031,7 +1984,7 @@ proto.jspb.test.OptionalFields.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.jspb.test.OptionalFields} */ -proto.jspb.test.OptionalFields.deserializeBinaryFromReader = function(msg, reader) { +OptionalFields.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -2047,13 +2000,13 @@ proto.jspb.test.OptionalFields.deserializeBinaryFromReader = function(msg, reade msg.setABool(value); break; case 3: - var value = new proto.jspb.test.OptionalFields.Nested; - reader.readMessage(value,proto.jspb.test.OptionalFields.Nested.deserializeBinaryFromReader); + var value = new OptionalFields.Nested; + reader.readMessage(value,OptionalFields.Nested.deserializeBinaryFromReader); msg.setANestedMessage(value); break; case 4: - var value = new proto.jspb.test.OptionalFields.Nested; - reader.readMessage(value,proto.jspb.test.OptionalFields.Nested.deserializeBinaryFromReader); + var value = new OptionalFields.Nested; + reader.readMessage(value,OptionalFields.Nested.deserializeBinaryFromReader); msg.addARepeatedMessage(value); break; case 5: @@ -2073,9 +2026,9 @@ proto.jspb.test.OptionalFields.deserializeBinaryFromReader = function(msg, reade * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.jspb.test.OptionalFields.prototype.serializeBinary = function() { +OptionalFields.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.jspb.test.OptionalFields.serializeBinaryToWriter(this, writer); + OptionalFields.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -2087,7 +2040,7 @@ proto.jspb.test.OptionalFields.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.OptionalFields.serializeBinaryToWriter = function(message, writer) { +OptionalFields.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = /** @type {string} */ (jspb.Message.getField(message, 1)); if (f != null) { @@ -2108,7 +2061,7 @@ proto.jspb.test.OptionalFields.serializeBinaryToWriter = function(message, write writer.writeMessage( 3, f, - proto.jspb.test.OptionalFields.Nested.serializeBinaryToWriter + OptionalFields.Nested.serializeBinaryToWriter ); } f = message.getARepeatedMessageList(); @@ -2116,7 +2069,7 @@ proto.jspb.test.OptionalFields.serializeBinaryToWriter = function(message, write writer.writeRepeatedMessage( 4, f, - proto.jspb.test.OptionalFields.Nested.serializeBinaryToWriter + OptionalFields.Nested.serializeBinaryToWriter ); } f = message.getARepeatedStringList(); @@ -2145,8 +2098,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.jspb.test.OptionalFields.Nested.prototype.toObject = function(opt_includeInstance) { - return proto.jspb.test.OptionalFields.Nested.toObject(opt_includeInstance, this); +OptionalFields.Nested.prototype.toObject = function(opt_includeInstance) { + return OptionalFields.Nested.toObject(opt_includeInstance, this); }; @@ -2159,7 +2112,7 @@ proto.jspb.test.OptionalFields.Nested.prototype.toObject = function(opt_includeI * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.OptionalFields.Nested.toObject = function(includeInstance, msg) { +OptionalFields.Nested.toObject = function(includeInstance, msg) { var f, obj = { anInt: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f }; @@ -2177,10 +2130,10 @@ anInt: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.jspb.test.OptionalFields.Nested} */ -proto.jspb.test.OptionalFields.Nested.deserializeBinary = function(bytes) { +OptionalFields.Nested.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.jspb.test.OptionalFields.Nested; - return proto.jspb.test.OptionalFields.Nested.deserializeBinaryFromReader(msg, reader); + var msg = new OptionalFields.Nested; + return OptionalFields.Nested.deserializeBinaryFromReader(msg, reader); }; @@ -2191,7 +2144,7 @@ proto.jspb.test.OptionalFields.Nested.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.jspb.test.OptionalFields.Nested} */ -proto.jspb.test.OptionalFields.Nested.deserializeBinaryFromReader = function(msg, reader) { +OptionalFields.Nested.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -2215,9 +2168,9 @@ proto.jspb.test.OptionalFields.Nested.deserializeBinaryFromReader = function(msg * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.jspb.test.OptionalFields.Nested.prototype.serializeBinary = function() { +OptionalFields.Nested.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.jspb.test.OptionalFields.Nested.serializeBinaryToWriter(this, writer); + OptionalFields.Nested.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -2229,7 +2182,7 @@ proto.jspb.test.OptionalFields.Nested.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.OptionalFields.Nested.serializeBinaryToWriter = function(message, writer) { +OptionalFields.Nested.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = /** @type {number} */ (jspb.Message.getField(message, 1)); if (f != null) { @@ -2245,7 +2198,7 @@ proto.jspb.test.OptionalFields.Nested.serializeBinaryToWriter = function(message * optional int32 an_int = 1; * @return {number} */ -proto.jspb.test.OptionalFields.Nested.prototype.getAnInt = function() { +OptionalFields.Nested.prototype.getAnInt = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; @@ -2254,7 +2207,7 @@ proto.jspb.test.OptionalFields.Nested.prototype.getAnInt = function() { * @param {number} value * @return {!proto.jspb.test.OptionalFields.Nested} returns this */ -proto.jspb.test.OptionalFields.Nested.prototype.setAnInt = function(value) { +OptionalFields.Nested.prototype.setAnInt = function(value) { return jspb.Message.setField(this, 1, value); }; @@ -2263,7 +2216,7 @@ proto.jspb.test.OptionalFields.Nested.prototype.setAnInt = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.OptionalFields.Nested} returns this */ -proto.jspb.test.OptionalFields.Nested.prototype.clearAnInt = function() { +OptionalFields.Nested.prototype.clearAnInt = function() { return jspb.Message.setField(this, 1, undefined); }; @@ -2272,7 +2225,7 @@ proto.jspb.test.OptionalFields.Nested.prototype.clearAnInt = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.OptionalFields.Nested.prototype.hasAnInt = function() { +OptionalFields.Nested.prototype.hasAnInt = function() { return jspb.Message.getField(this, 1) != null; }; @@ -2281,7 +2234,7 @@ proto.jspb.test.OptionalFields.Nested.prototype.hasAnInt = function() { * optional string a_string = 1; * @return {string} */ -proto.jspb.test.OptionalFields.prototype.getAString = function() { +OptionalFields.prototype.getAString = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; @@ -2290,7 +2243,7 @@ proto.jspb.test.OptionalFields.prototype.getAString = function() { * @param {string} value * @return {!proto.jspb.test.OptionalFields} returns this */ -proto.jspb.test.OptionalFields.prototype.setAString = function(value) { +OptionalFields.prototype.setAString = function(value) { return jspb.Message.setField(this, 1, value); }; @@ -2299,7 +2252,7 @@ proto.jspb.test.OptionalFields.prototype.setAString = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.OptionalFields} returns this */ -proto.jspb.test.OptionalFields.prototype.clearAString = function() { +OptionalFields.prototype.clearAString = function() { return jspb.Message.setField(this, 1, undefined); }; @@ -2308,7 +2261,7 @@ proto.jspb.test.OptionalFields.prototype.clearAString = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.OptionalFields.prototype.hasAString = function() { +OptionalFields.prototype.hasAString = function() { return jspb.Message.getField(this, 1) != null; }; @@ -2317,7 +2270,7 @@ proto.jspb.test.OptionalFields.prototype.hasAString = function() { * required bool a_bool = 2; * @return {boolean} */ -proto.jspb.test.OptionalFields.prototype.getABool = function() { +OptionalFields.prototype.getABool = function() { return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); }; @@ -2326,7 +2279,7 @@ proto.jspb.test.OptionalFields.prototype.getABool = function() { * @param {boolean} value * @return {!proto.jspb.test.OptionalFields} returns this */ -proto.jspb.test.OptionalFields.prototype.setABool = function(value) { +OptionalFields.prototype.setABool = function(value) { return jspb.Message.setField(this, 2, value); }; @@ -2335,7 +2288,7 @@ proto.jspb.test.OptionalFields.prototype.setABool = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.OptionalFields} returns this */ -proto.jspb.test.OptionalFields.prototype.clearABool = function() { +OptionalFields.prototype.clearABool = function() { return jspb.Message.setField(this, 2, undefined); }; @@ -2344,7 +2297,7 @@ proto.jspb.test.OptionalFields.prototype.clearABool = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.OptionalFields.prototype.hasABool = function() { +OptionalFields.prototype.hasABool = function() { return jspb.Message.getField(this, 2) != null; }; @@ -2353,9 +2306,9 @@ proto.jspb.test.OptionalFields.prototype.hasABool = function() { * optional Nested a_nested_message = 3; * @return {?proto.jspb.test.OptionalFields.Nested} */ -proto.jspb.test.OptionalFields.prototype.getANestedMessage = function() { +OptionalFields.prototype.getANestedMessage = function() { return /** @type{?proto.jspb.test.OptionalFields.Nested} */ ( - jspb.Message.getWrapperField(this, proto.jspb.test.OptionalFields.Nested, 3)); + jspb.Message.getWrapperField(this, OptionalFields.Nested, 3)); }; @@ -2363,7 +2316,7 @@ proto.jspb.test.OptionalFields.prototype.getANestedMessage = function() { * @param {?proto.jspb.test.OptionalFields.Nested|undefined} value * @return {!proto.jspb.test.OptionalFields} returns this */ -proto.jspb.test.OptionalFields.prototype.setANestedMessage = function(value) { +OptionalFields.prototype.setANestedMessage = function(value) { return jspb.Message.setWrapperField(this, 3, value); }; @@ -2372,7 +2325,7 @@ proto.jspb.test.OptionalFields.prototype.setANestedMessage = function(value) { * Clears the message field making it undefined. * @return {!proto.jspb.test.OptionalFields} returns this */ -proto.jspb.test.OptionalFields.prototype.clearANestedMessage = function() { +OptionalFields.prototype.clearANestedMessage = function() { return this.setANestedMessage(undefined); }; @@ -2381,7 +2334,7 @@ proto.jspb.test.OptionalFields.prototype.clearANestedMessage = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.OptionalFields.prototype.hasANestedMessage = function() { +OptionalFields.prototype.hasANestedMessage = function() { return jspb.Message.getField(this, 3) != null; }; @@ -2390,9 +2343,9 @@ proto.jspb.test.OptionalFields.prototype.hasANestedMessage = function() { * repeated Nested a_repeated_message = 4; * @return {!Array} */ -proto.jspb.test.OptionalFields.prototype.getARepeatedMessageList = function() { +OptionalFields.prototype.getARepeatedMessageList = function() { return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.jspb.test.OptionalFields.Nested, 4)); + jspb.Message.getRepeatedWrapperField(this, OptionalFields.Nested, 4)); }; @@ -2400,7 +2353,7 @@ proto.jspb.test.OptionalFields.prototype.getARepeatedMessageList = function() { * @param {!Array} value * @return {!proto.jspb.test.OptionalFields} returns this */ -proto.jspb.test.OptionalFields.prototype.setARepeatedMessageList = function(value) { +OptionalFields.prototype.setARepeatedMessageList = function(value) { return jspb.Message.setRepeatedWrapperField(this, 4, value); }; @@ -2410,8 +2363,8 @@ proto.jspb.test.OptionalFields.prototype.setARepeatedMessageList = function(valu * @param {number=} opt_index * @return {!proto.jspb.test.OptionalFields.Nested} */ -proto.jspb.test.OptionalFields.prototype.addARepeatedMessage = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.jspb.test.OptionalFields.Nested, opt_index); +OptionalFields.prototype.addARepeatedMessage = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, OptionalFields.Nested, opt_index); }; @@ -2419,7 +2372,7 @@ proto.jspb.test.OptionalFields.prototype.addARepeatedMessage = function(opt_valu * Clears the list making it empty but non-null. * @return {!proto.jspb.test.OptionalFields} returns this */ -proto.jspb.test.OptionalFields.prototype.clearARepeatedMessageList = function() { +OptionalFields.prototype.clearARepeatedMessageList = function() { return this.setARepeatedMessageList([]); }; @@ -2428,7 +2381,7 @@ proto.jspb.test.OptionalFields.prototype.clearARepeatedMessageList = function() * repeated string a_repeated_string = 5; * @return {!Array} */ -proto.jspb.test.OptionalFields.prototype.getARepeatedStringList = function() { +OptionalFields.prototype.getARepeatedStringList = function() { return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 5)); }; @@ -2437,7 +2390,7 @@ proto.jspb.test.OptionalFields.prototype.getARepeatedStringList = function() { * @param {!Array} value * @return {!proto.jspb.test.OptionalFields} returns this */ -proto.jspb.test.OptionalFields.prototype.setARepeatedStringList = function(value) { +OptionalFields.prototype.setARepeatedStringList = function(value) { return jspb.Message.setField(this, 5, value || []); }; @@ -2447,7 +2400,7 @@ proto.jspb.test.OptionalFields.prototype.setARepeatedStringList = function(value * @param {number=} opt_index * @return {!proto.jspb.test.OptionalFields} returns this */ -proto.jspb.test.OptionalFields.prototype.addARepeatedString = function(value, opt_index) { +OptionalFields.prototype.addARepeatedString = function(value, opt_index) { return jspb.Message.addToRepeatedField(this, 5, value, opt_index); }; @@ -2456,7 +2409,7 @@ proto.jspb.test.OptionalFields.prototype.addARepeatedString = function(value, op * Clears the list making it empty but non-null. * @return {!proto.jspb.test.OptionalFields} returns this */ -proto.jspb.test.OptionalFields.prototype.clearARepeatedStringList = function() { +OptionalFields.prototype.clearARepeatedStringList = function() { return this.setARepeatedStringList([]); }; @@ -2477,8 +2430,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.jspb.test.HasExtensions.prototype.toObject = function(opt_includeInstance) { - return proto.jspb.test.HasExtensions.toObject(opt_includeInstance, this); +HasExtensions.prototype.toObject = function(opt_includeInstance) { + return HasExtensions.toObject(opt_includeInstance, this); }; @@ -2491,7 +2444,7 @@ proto.jspb.test.HasExtensions.prototype.toObject = function(opt_includeInstance) * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.HasExtensions.toObject = function(includeInstance, msg) { +HasExtensions.toObject = function(includeInstance, msg) { var f, obj = { str1: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, str2: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f, @@ -2499,7 +2452,7 @@ str3: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f }; jspb.Message.toObjectExtension(/** @type {!jspb.Message} */ (msg), obj, - proto.jspb.test.HasExtensions.extensions, proto.jspb.test.HasExtensions.prototype.getExtension, + HasExtensions.extensions, HasExtensions.prototype.getExtension, includeInstance); if (includeInstance) { obj.$jspbMessageInstance = msg; @@ -2514,10 +2467,10 @@ str3: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.jspb.test.HasExtensions} */ -proto.jspb.test.HasExtensions.deserializeBinary = function(bytes) { +HasExtensions.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.jspb.test.HasExtensions; - return proto.jspb.test.HasExtensions.deserializeBinaryFromReader(msg, reader); + var msg = new HasExtensions; + return HasExtensions.deserializeBinaryFromReader(msg, reader); }; @@ -2528,7 +2481,7 @@ proto.jspb.test.HasExtensions.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.jspb.test.HasExtensions} */ -proto.jspb.test.HasExtensions.deserializeBinaryFromReader = function(msg, reader) { +HasExtensions.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -2549,9 +2502,9 @@ proto.jspb.test.HasExtensions.deserializeBinaryFromReader = function(msg, reader break; default: jspb.Message.readBinaryExtension(msg, reader, - proto.jspb.test.HasExtensions.extensionsBinary, - proto.jspb.test.HasExtensions.prototype.getExtension, - proto.jspb.test.HasExtensions.prototype.setExtension); + HasExtensions.extensionsBinary, + HasExtensions.prototype.getExtension, + HasExtensions.prototype.setExtension); break; } } @@ -2563,9 +2516,9 @@ proto.jspb.test.HasExtensions.deserializeBinaryFromReader = function(msg, reader * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.jspb.test.HasExtensions.prototype.serializeBinary = function() { +HasExtensions.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.jspb.test.HasExtensions.serializeBinaryToWriter(this, writer); + HasExtensions.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -2577,7 +2530,7 @@ proto.jspb.test.HasExtensions.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.HasExtensions.serializeBinaryToWriter = function(message, writer) { +HasExtensions.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = /** @type {string} */ (jspb.Message.getField(message, 1)); if (f != null) { @@ -2601,7 +2554,7 @@ proto.jspb.test.HasExtensions.serializeBinaryToWriter = function(message, writer ); } jspb.Message.serializeBinaryExtensions(message, writer, - proto.jspb.test.HasExtensions.extensionsBinary, proto.jspb.test.HasExtensions.prototype.getExtension); + HasExtensions.extensionsBinary, HasExtensions.prototype.getExtension); }; @@ -2609,7 +2562,7 @@ proto.jspb.test.HasExtensions.serializeBinaryToWriter = function(message, writer * optional string str1 = 1; * @return {string} */ -proto.jspb.test.HasExtensions.prototype.getStr1 = function() { +HasExtensions.prototype.getStr1 = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; @@ -2618,7 +2571,7 @@ proto.jspb.test.HasExtensions.prototype.getStr1 = function() { * @param {string} value * @return {!proto.jspb.test.HasExtensions} returns this */ -proto.jspb.test.HasExtensions.prototype.setStr1 = function(value) { +HasExtensions.prototype.setStr1 = function(value) { return jspb.Message.setField(this, 1, value); }; @@ -2627,7 +2580,7 @@ proto.jspb.test.HasExtensions.prototype.setStr1 = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.HasExtensions} returns this */ -proto.jspb.test.HasExtensions.prototype.clearStr1 = function() { +HasExtensions.prototype.clearStr1 = function() { return jspb.Message.setField(this, 1, undefined); }; @@ -2636,7 +2589,7 @@ proto.jspb.test.HasExtensions.prototype.clearStr1 = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.HasExtensions.prototype.hasStr1 = function() { +HasExtensions.prototype.hasStr1 = function() { return jspb.Message.getField(this, 1) != null; }; @@ -2645,7 +2598,7 @@ proto.jspb.test.HasExtensions.prototype.hasStr1 = function() { * optional string str2 = 2; * @return {string} */ -proto.jspb.test.HasExtensions.prototype.getStr2 = function() { +HasExtensions.prototype.getStr2 = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; @@ -2654,7 +2607,7 @@ proto.jspb.test.HasExtensions.prototype.getStr2 = function() { * @param {string} value * @return {!proto.jspb.test.HasExtensions} returns this */ -proto.jspb.test.HasExtensions.prototype.setStr2 = function(value) { +HasExtensions.prototype.setStr2 = function(value) { return jspb.Message.setField(this, 2, value); }; @@ -2663,7 +2616,7 @@ proto.jspb.test.HasExtensions.prototype.setStr2 = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.HasExtensions} returns this */ -proto.jspb.test.HasExtensions.prototype.clearStr2 = function() { +HasExtensions.prototype.clearStr2 = function() { return jspb.Message.setField(this, 2, undefined); }; @@ -2672,7 +2625,7 @@ proto.jspb.test.HasExtensions.prototype.clearStr2 = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.HasExtensions.prototype.hasStr2 = function() { +HasExtensions.prototype.hasStr2 = function() { return jspb.Message.getField(this, 2) != null; }; @@ -2681,7 +2634,7 @@ proto.jspb.test.HasExtensions.prototype.hasStr2 = function() { * optional string str3 = 3; * @return {string} */ -proto.jspb.test.HasExtensions.prototype.getStr3 = function() { +HasExtensions.prototype.getStr3 = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); }; @@ -2690,7 +2643,7 @@ proto.jspb.test.HasExtensions.prototype.getStr3 = function() { * @param {string} value * @return {!proto.jspb.test.HasExtensions} returns this */ -proto.jspb.test.HasExtensions.prototype.setStr3 = function(value) { +HasExtensions.prototype.setStr3 = function(value) { return jspb.Message.setField(this, 3, value); }; @@ -2699,7 +2652,7 @@ proto.jspb.test.HasExtensions.prototype.setStr3 = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.HasExtensions} returns this */ -proto.jspb.test.HasExtensions.prototype.clearStr3 = function() { +HasExtensions.prototype.clearStr3 = function() { return jspb.Message.setField(this, 3, undefined); }; @@ -2708,7 +2661,7 @@ proto.jspb.test.HasExtensions.prototype.clearStr3 = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.HasExtensions.prototype.hasStr3 = function() { +HasExtensions.prototype.hasStr3 = function() { return jspb.Message.getField(this, 3) != null; }; @@ -2719,7 +2672,7 @@ proto.jspb.test.HasExtensions.prototype.hasStr3 = function() { * @private {!Array} * @const */ -proto.jspb.test.Complex.repeatedFields_ = [5,7]; +Complex.repeatedFields_ = [5,7]; @@ -2736,8 +2689,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.jspb.test.Complex.prototype.toObject = function(opt_includeInstance) { - return proto.jspb.test.Complex.toObject(opt_includeInstance, this); +Complex.prototype.toObject = function(opt_includeInstance) { + return Complex.toObject(opt_includeInstance, this); }; @@ -2750,13 +2703,13 @@ proto.jspb.test.Complex.prototype.toObject = function(opt_includeInstance) { * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.Complex.toObject = function(includeInstance, msg) { +Complex.toObject = function(includeInstance, msg) { var f, obj = { aString: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, anOutOfOrderBool: (f = jspb.Message.getBooleanField(msg, 9)) == null ? undefined : f, -aNestedMessage: (f = msg.getANestedMessage()) && proto.jspb.test.Complex.Nested.toObject(includeInstance, f), +aNestedMessage: (f = msg.getANestedMessage()) && Complex.Nested.toObject(includeInstance, f), aRepeatedMessageList: jspb.Message.toObjectList(msg.getARepeatedMessageList(), - proto.jspb.test.Complex.Nested.toObject, includeInstance), + Complex.Nested.toObject, includeInstance), aRepeatedStringList: (f = jspb.Message.getRepeatedField(msg, 7)) == null ? undefined : f, aFloatingPointField: (f = jspb.Message.getOptionalFloatingPointField(msg, 10)) == null ? undefined : f }; @@ -2774,10 +2727,10 @@ aFloatingPointField: (f = jspb.Message.getOptionalFloatingPointField(msg, 10)) = * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.jspb.test.Complex} */ -proto.jspb.test.Complex.deserializeBinary = function(bytes) { +Complex.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.jspb.test.Complex; - return proto.jspb.test.Complex.deserializeBinaryFromReader(msg, reader); + var msg = new Complex; + return Complex.deserializeBinaryFromReader(msg, reader); }; @@ -2788,7 +2741,7 @@ proto.jspb.test.Complex.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.jspb.test.Complex} */ -proto.jspb.test.Complex.deserializeBinaryFromReader = function(msg, reader) { +Complex.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -2804,13 +2757,13 @@ proto.jspb.test.Complex.deserializeBinaryFromReader = function(msg, reader) { msg.setAnOutOfOrderBool(value); break; case 4: - var value = new proto.jspb.test.Complex.Nested; - reader.readMessage(value,proto.jspb.test.Complex.Nested.deserializeBinaryFromReader); + var value = new Complex.Nested; + reader.readMessage(value,Complex.Nested.deserializeBinaryFromReader); msg.setANestedMessage(value); break; case 5: - var value = new proto.jspb.test.Complex.Nested; - reader.readMessage(value,proto.jspb.test.Complex.Nested.deserializeBinaryFromReader); + var value = new Complex.Nested; + reader.readMessage(value,Complex.Nested.deserializeBinaryFromReader); msg.addARepeatedMessage(value); break; case 7: @@ -2834,9 +2787,9 @@ proto.jspb.test.Complex.deserializeBinaryFromReader = function(msg, reader) { * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.jspb.test.Complex.prototype.serializeBinary = function() { +Complex.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.jspb.test.Complex.serializeBinaryToWriter(this, writer); + Complex.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -2848,7 +2801,7 @@ proto.jspb.test.Complex.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.Complex.serializeBinaryToWriter = function(message, writer) { +Complex.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = /** @type {string} */ (jspb.Message.getField(message, 1)); if (f != null) { @@ -2869,7 +2822,7 @@ proto.jspb.test.Complex.serializeBinaryToWriter = function(message, writer) { writer.writeMessage( 4, f, - proto.jspb.test.Complex.Nested.serializeBinaryToWriter + Complex.Nested.serializeBinaryToWriter ); } f = message.getARepeatedMessageList(); @@ -2877,7 +2830,7 @@ proto.jspb.test.Complex.serializeBinaryToWriter = function(message, writer) { writer.writeRepeatedMessage( 5, f, - proto.jspb.test.Complex.Nested.serializeBinaryToWriter + Complex.Nested.serializeBinaryToWriter ); } f = message.getARepeatedStringList(); @@ -2913,8 +2866,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.jspb.test.Complex.Nested.prototype.toObject = function(opt_includeInstance) { - return proto.jspb.test.Complex.Nested.toObject(opt_includeInstance, this); +Complex.Nested.prototype.toObject = function(opt_includeInstance) { + return Complex.Nested.toObject(opt_includeInstance, this); }; @@ -2927,7 +2880,7 @@ proto.jspb.test.Complex.Nested.prototype.toObject = function(opt_includeInstance * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.Complex.Nested.toObject = function(includeInstance, msg) { +Complex.Nested.toObject = function(includeInstance, msg) { var f, obj = { anInt: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f }; @@ -2945,10 +2898,10 @@ anInt: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.jspb.test.Complex.Nested} */ -proto.jspb.test.Complex.Nested.deserializeBinary = function(bytes) { +Complex.Nested.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.jspb.test.Complex.Nested; - return proto.jspb.test.Complex.Nested.deserializeBinaryFromReader(msg, reader); + var msg = new Complex.Nested; + return Complex.Nested.deserializeBinaryFromReader(msg, reader); }; @@ -2959,7 +2912,7 @@ proto.jspb.test.Complex.Nested.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.jspb.test.Complex.Nested} */ -proto.jspb.test.Complex.Nested.deserializeBinaryFromReader = function(msg, reader) { +Complex.Nested.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -2983,9 +2936,9 @@ proto.jspb.test.Complex.Nested.deserializeBinaryFromReader = function(msg, reade * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.jspb.test.Complex.Nested.prototype.serializeBinary = function() { +Complex.Nested.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.jspb.test.Complex.Nested.serializeBinaryToWriter(this, writer); + Complex.Nested.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -2997,7 +2950,7 @@ proto.jspb.test.Complex.Nested.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.Complex.Nested.serializeBinaryToWriter = function(message, writer) { +Complex.Nested.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = /** @type {number} */ (jspb.Message.getField(message, 2)); if (f != null) { @@ -3013,7 +2966,7 @@ proto.jspb.test.Complex.Nested.serializeBinaryToWriter = function(message, write * required int32 an_int = 2; * @return {number} */ -proto.jspb.test.Complex.Nested.prototype.getAnInt = function() { +Complex.Nested.prototype.getAnInt = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; @@ -3022,7 +2975,7 @@ proto.jspb.test.Complex.Nested.prototype.getAnInt = function() { * @param {number} value * @return {!proto.jspb.test.Complex.Nested} returns this */ -proto.jspb.test.Complex.Nested.prototype.setAnInt = function(value) { +Complex.Nested.prototype.setAnInt = function(value) { return jspb.Message.setField(this, 2, value); }; @@ -3031,7 +2984,7 @@ proto.jspb.test.Complex.Nested.prototype.setAnInt = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.Complex.Nested} returns this */ -proto.jspb.test.Complex.Nested.prototype.clearAnInt = function() { +Complex.Nested.prototype.clearAnInt = function() { return jspb.Message.setField(this, 2, undefined); }; @@ -3040,7 +2993,7 @@ proto.jspb.test.Complex.Nested.prototype.clearAnInt = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.Complex.Nested.prototype.hasAnInt = function() { +Complex.Nested.prototype.hasAnInt = function() { return jspb.Message.getField(this, 2) != null; }; @@ -3049,7 +3002,7 @@ proto.jspb.test.Complex.Nested.prototype.hasAnInt = function() { * required string a_string = 1; * @return {string} */ -proto.jspb.test.Complex.prototype.getAString = function() { +Complex.prototype.getAString = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; @@ -3058,7 +3011,7 @@ proto.jspb.test.Complex.prototype.getAString = function() { * @param {string} value * @return {!proto.jspb.test.Complex} returns this */ -proto.jspb.test.Complex.prototype.setAString = function(value) { +Complex.prototype.setAString = function(value) { return jspb.Message.setField(this, 1, value); }; @@ -3067,7 +3020,7 @@ proto.jspb.test.Complex.prototype.setAString = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.Complex} returns this */ -proto.jspb.test.Complex.prototype.clearAString = function() { +Complex.prototype.clearAString = function() { return jspb.Message.setField(this, 1, undefined); }; @@ -3076,7 +3029,7 @@ proto.jspb.test.Complex.prototype.clearAString = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.Complex.prototype.hasAString = function() { +Complex.prototype.hasAString = function() { return jspb.Message.getField(this, 1) != null; }; @@ -3085,7 +3038,7 @@ proto.jspb.test.Complex.prototype.hasAString = function() { * optional bool an_out_of_order_bool = 9; * @return {boolean} */ -proto.jspb.test.Complex.prototype.getAnOutOfOrderBool = function() { +Complex.prototype.getAnOutOfOrderBool = function() { return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 9, false)); }; @@ -3094,7 +3047,7 @@ proto.jspb.test.Complex.prototype.getAnOutOfOrderBool = function() { * @param {boolean} value * @return {!proto.jspb.test.Complex} returns this */ -proto.jspb.test.Complex.prototype.setAnOutOfOrderBool = function(value) { +Complex.prototype.setAnOutOfOrderBool = function(value) { return jspb.Message.setField(this, 9, value); }; @@ -3103,7 +3056,7 @@ proto.jspb.test.Complex.prototype.setAnOutOfOrderBool = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.Complex} returns this */ -proto.jspb.test.Complex.prototype.clearAnOutOfOrderBool = function() { +Complex.prototype.clearAnOutOfOrderBool = function() { return jspb.Message.setField(this, 9, undefined); }; @@ -3112,7 +3065,7 @@ proto.jspb.test.Complex.prototype.clearAnOutOfOrderBool = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.Complex.prototype.hasAnOutOfOrderBool = function() { +Complex.prototype.hasAnOutOfOrderBool = function() { return jspb.Message.getField(this, 9) != null; }; @@ -3121,9 +3074,9 @@ proto.jspb.test.Complex.prototype.hasAnOutOfOrderBool = function() { * optional Nested a_nested_message = 4; * @return {?proto.jspb.test.Complex.Nested} */ -proto.jspb.test.Complex.prototype.getANestedMessage = function() { +Complex.prototype.getANestedMessage = function() { return /** @type{?proto.jspb.test.Complex.Nested} */ ( - jspb.Message.getWrapperField(this, proto.jspb.test.Complex.Nested, 4)); + jspb.Message.getWrapperField(this, Complex.Nested, 4)); }; @@ -3131,7 +3084,7 @@ proto.jspb.test.Complex.prototype.getANestedMessage = function() { * @param {?proto.jspb.test.Complex.Nested|undefined} value * @return {!proto.jspb.test.Complex} returns this */ -proto.jspb.test.Complex.prototype.setANestedMessage = function(value) { +Complex.prototype.setANestedMessage = function(value) { return jspb.Message.setWrapperField(this, 4, value); }; @@ -3140,7 +3093,7 @@ proto.jspb.test.Complex.prototype.setANestedMessage = function(value) { * Clears the message field making it undefined. * @return {!proto.jspb.test.Complex} returns this */ -proto.jspb.test.Complex.prototype.clearANestedMessage = function() { +Complex.prototype.clearANestedMessage = function() { return this.setANestedMessage(undefined); }; @@ -3149,7 +3102,7 @@ proto.jspb.test.Complex.prototype.clearANestedMessage = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.Complex.prototype.hasANestedMessage = function() { +Complex.prototype.hasANestedMessage = function() { return jspb.Message.getField(this, 4) != null; }; @@ -3158,9 +3111,9 @@ proto.jspb.test.Complex.prototype.hasANestedMessage = function() { * repeated Nested a_repeated_message = 5; * @return {!Array} */ -proto.jspb.test.Complex.prototype.getARepeatedMessageList = function() { +Complex.prototype.getARepeatedMessageList = function() { return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.jspb.test.Complex.Nested, 5)); + jspb.Message.getRepeatedWrapperField(this, Complex.Nested, 5)); }; @@ -3168,7 +3121,7 @@ proto.jspb.test.Complex.prototype.getARepeatedMessageList = function() { * @param {!Array} value * @return {!proto.jspb.test.Complex} returns this */ -proto.jspb.test.Complex.prototype.setARepeatedMessageList = function(value) { +Complex.prototype.setARepeatedMessageList = function(value) { return jspb.Message.setRepeatedWrapperField(this, 5, value); }; @@ -3178,8 +3131,8 @@ proto.jspb.test.Complex.prototype.setARepeatedMessageList = function(value) { * @param {number=} opt_index * @return {!proto.jspb.test.Complex.Nested} */ -proto.jspb.test.Complex.prototype.addARepeatedMessage = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, proto.jspb.test.Complex.Nested, opt_index); +Complex.prototype.addARepeatedMessage = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, Complex.Nested, opt_index); }; @@ -3187,7 +3140,7 @@ proto.jspb.test.Complex.prototype.addARepeatedMessage = function(opt_value, opt_ * Clears the list making it empty but non-null. * @return {!proto.jspb.test.Complex} returns this */ -proto.jspb.test.Complex.prototype.clearARepeatedMessageList = function() { +Complex.prototype.clearARepeatedMessageList = function() { return this.setARepeatedMessageList([]); }; @@ -3196,7 +3149,7 @@ proto.jspb.test.Complex.prototype.clearARepeatedMessageList = function() { * repeated string a_repeated_string = 7; * @return {!Array} */ -proto.jspb.test.Complex.prototype.getARepeatedStringList = function() { +Complex.prototype.getARepeatedStringList = function() { return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 7)); }; @@ -3205,7 +3158,7 @@ proto.jspb.test.Complex.prototype.getARepeatedStringList = function() { * @param {!Array} value * @return {!proto.jspb.test.Complex} returns this */ -proto.jspb.test.Complex.prototype.setARepeatedStringList = function(value) { +Complex.prototype.setARepeatedStringList = function(value) { return jspb.Message.setField(this, 7, value || []); }; @@ -3215,7 +3168,7 @@ proto.jspb.test.Complex.prototype.setARepeatedStringList = function(value) { * @param {number=} opt_index * @return {!proto.jspb.test.Complex} returns this */ -proto.jspb.test.Complex.prototype.addARepeatedString = function(value, opt_index) { +Complex.prototype.addARepeatedString = function(value, opt_index) { return jspb.Message.addToRepeatedField(this, 7, value, opt_index); }; @@ -3224,7 +3177,7 @@ proto.jspb.test.Complex.prototype.addARepeatedString = function(value, opt_index * Clears the list making it empty but non-null. * @return {!proto.jspb.test.Complex} returns this */ -proto.jspb.test.Complex.prototype.clearARepeatedStringList = function() { +Complex.prototype.clearARepeatedStringList = function() { return this.setARepeatedStringList([]); }; @@ -3233,7 +3186,7 @@ proto.jspb.test.Complex.prototype.clearARepeatedStringList = function() { * optional double a_floating_point_field = 10; * @return {number} */ -proto.jspb.test.Complex.prototype.getAFloatingPointField = function() { +Complex.prototype.getAFloatingPointField = function() { return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 10, 0.0)); }; @@ -3242,7 +3195,7 @@ proto.jspb.test.Complex.prototype.getAFloatingPointField = function() { * @param {number} value * @return {!proto.jspb.test.Complex} returns this */ -proto.jspb.test.Complex.prototype.setAFloatingPointField = function(value) { +Complex.prototype.setAFloatingPointField = function(value) { return jspb.Message.setField(this, 10, value); }; @@ -3251,7 +3204,7 @@ proto.jspb.test.Complex.prototype.setAFloatingPointField = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.Complex} returns this */ -proto.jspb.test.Complex.prototype.clearAFloatingPointField = function() { +Complex.prototype.clearAFloatingPointField = function() { return jspb.Message.setField(this, 10, undefined); }; @@ -3260,7 +3213,7 @@ proto.jspb.test.Complex.prototype.clearAFloatingPointField = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.Complex.prototype.hasAFloatingPointField = function() { +Complex.prototype.hasAFloatingPointField = function() { return jspb.Message.getField(this, 10) != null; }; @@ -3281,8 +3234,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.jspb.test.OuterMessage.prototype.toObject = function(opt_includeInstance) { - return proto.jspb.test.OuterMessage.toObject(opt_includeInstance, this); +OuterMessage.prototype.toObject = function(opt_includeInstance) { + return OuterMessage.toObject(opt_includeInstance, this); }; @@ -3295,7 +3248,7 @@ proto.jspb.test.OuterMessage.prototype.toObject = function(opt_includeInstance) * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.OuterMessage.toObject = function(includeInstance, msg) { +OuterMessage.toObject = function(includeInstance, msg) { var f, obj = { }; @@ -3313,10 +3266,10 @@ proto.jspb.test.OuterMessage.toObject = function(includeInstance, msg) { * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.jspb.test.OuterMessage} */ -proto.jspb.test.OuterMessage.deserializeBinary = function(bytes) { +OuterMessage.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.jspb.test.OuterMessage; - return proto.jspb.test.OuterMessage.deserializeBinaryFromReader(msg, reader); + var msg = new OuterMessage; + return OuterMessage.deserializeBinaryFromReader(msg, reader); }; @@ -3327,7 +3280,7 @@ proto.jspb.test.OuterMessage.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.jspb.test.OuterMessage} */ -proto.jspb.test.OuterMessage.deserializeBinaryFromReader = function(msg, reader) { +OuterMessage.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -3347,9 +3300,9 @@ proto.jspb.test.OuterMessage.deserializeBinaryFromReader = function(msg, reader) * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.jspb.test.OuterMessage.prototype.serializeBinary = function() { +OuterMessage.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.jspb.test.OuterMessage.serializeBinaryToWriter(this, writer); + OuterMessage.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -3361,7 +3314,7 @@ proto.jspb.test.OuterMessage.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.OuterMessage.serializeBinaryToWriter = function(message, writer) { +OuterMessage.serializeBinaryToWriter = function(message, writer) { var f = undefined; }; @@ -3382,8 +3335,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.jspb.test.OuterMessage.Complex.prototype.toObject = function(opt_includeInstance) { - return proto.jspb.test.OuterMessage.Complex.toObject(opt_includeInstance, this); +OuterMessage.Complex.prototype.toObject = function(opt_includeInstance) { + return OuterMessage.Complex.toObject(opt_includeInstance, this); }; @@ -3396,7 +3349,7 @@ proto.jspb.test.OuterMessage.Complex.prototype.toObject = function(opt_includeIn * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.OuterMessage.Complex.toObject = function(includeInstance, msg) { +OuterMessage.Complex.toObject = function(includeInstance, msg) { var f, obj = { innerComplexField: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f }; @@ -3414,10 +3367,10 @@ innerComplexField: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.jspb.test.OuterMessage.Complex} */ -proto.jspb.test.OuterMessage.Complex.deserializeBinary = function(bytes) { +OuterMessage.Complex.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.jspb.test.OuterMessage.Complex; - return proto.jspb.test.OuterMessage.Complex.deserializeBinaryFromReader(msg, reader); + var msg = new OuterMessage.Complex; + return OuterMessage.Complex.deserializeBinaryFromReader(msg, reader); }; @@ -3428,7 +3381,7 @@ proto.jspb.test.OuterMessage.Complex.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.jspb.test.OuterMessage.Complex} */ -proto.jspb.test.OuterMessage.Complex.deserializeBinaryFromReader = function(msg, reader) { +OuterMessage.Complex.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -3452,9 +3405,9 @@ proto.jspb.test.OuterMessage.Complex.deserializeBinaryFromReader = function(msg, * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.jspb.test.OuterMessage.Complex.prototype.serializeBinary = function() { +OuterMessage.Complex.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.jspb.test.OuterMessage.Complex.serializeBinaryToWriter(this, writer); + OuterMessage.Complex.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -3466,7 +3419,7 @@ proto.jspb.test.OuterMessage.Complex.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.OuterMessage.Complex.serializeBinaryToWriter = function(message, writer) { +OuterMessage.Complex.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = /** @type {number} */ (jspb.Message.getField(message, 1)); if (f != null) { @@ -3482,7 +3435,7 @@ proto.jspb.test.OuterMessage.Complex.serializeBinaryToWriter = function(message, * optional int32 inner_complex_field = 1; * @return {number} */ -proto.jspb.test.OuterMessage.Complex.prototype.getInnerComplexField = function() { +OuterMessage.Complex.prototype.getInnerComplexField = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; @@ -3491,7 +3444,7 @@ proto.jspb.test.OuterMessage.Complex.prototype.getInnerComplexField = function() * @param {number} value * @return {!proto.jspb.test.OuterMessage.Complex} returns this */ -proto.jspb.test.OuterMessage.Complex.prototype.setInnerComplexField = function(value) { +OuterMessage.Complex.prototype.setInnerComplexField = function(value) { return jspb.Message.setField(this, 1, value); }; @@ -3500,7 +3453,7 @@ proto.jspb.test.OuterMessage.Complex.prototype.setInnerComplexField = function(v * Clears the field making it undefined. * @return {!proto.jspb.test.OuterMessage.Complex} returns this */ -proto.jspb.test.OuterMessage.Complex.prototype.clearInnerComplexField = function() { +OuterMessage.Complex.prototype.clearInnerComplexField = function() { return jspb.Message.setField(this, 1, undefined); }; @@ -3509,7 +3462,7 @@ proto.jspb.test.OuterMessage.Complex.prototype.clearInnerComplexField = function * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.OuterMessage.Complex.prototype.hasInnerComplexField = function() { +OuterMessage.Complex.prototype.hasInnerComplexField = function() { return jspb.Message.getField(this, 1) != null; }; @@ -3530,8 +3483,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.jspb.test.MineField.prototype.toObject = function(opt_includeInstance) { - return proto.jspb.test.MineField.toObject(opt_includeInstance, this); +MineField.prototype.toObject = function(opt_includeInstance) { + return MineField.toObject(opt_includeInstance, this); }; @@ -3544,7 +3497,7 @@ proto.jspb.test.MineField.prototype.toObject = function(opt_includeInstance) { * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.MineField.toObject = function(includeInstance, msg) { +MineField.toObject = function(includeInstance, msg) { var f, obj = { cookie: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f }; @@ -3562,10 +3515,10 @@ cookie: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.jspb.test.MineField} */ -proto.jspb.test.MineField.deserializeBinary = function(bytes) { +MineField.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.jspb.test.MineField; - return proto.jspb.test.MineField.deserializeBinaryFromReader(msg, reader); + var msg = new MineField; + return MineField.deserializeBinaryFromReader(msg, reader); }; @@ -3576,7 +3529,7 @@ proto.jspb.test.MineField.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.jspb.test.MineField} */ -proto.jspb.test.MineField.deserializeBinaryFromReader = function(msg, reader) { +MineField.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -3600,9 +3553,9 @@ proto.jspb.test.MineField.deserializeBinaryFromReader = function(msg, reader) { * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.jspb.test.MineField.prototype.serializeBinary = function() { +MineField.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.jspb.test.MineField.serializeBinaryToWriter(this, writer); + MineField.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -3614,7 +3567,7 @@ proto.jspb.test.MineField.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.MineField.serializeBinaryToWriter = function(message, writer) { +MineField.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = /** @type {string} */ (jspb.Message.getField(message, 1)); if (f != null) { @@ -3630,7 +3583,7 @@ proto.jspb.test.MineField.serializeBinaryToWriter = function(message, writer) { * optional string cookie = 1; * @return {string} */ -proto.jspb.test.MineField.prototype.getCookie = function() { +MineField.prototype.getCookie = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; @@ -3639,7 +3592,7 @@ proto.jspb.test.MineField.prototype.getCookie = function() { * @param {string} value * @return {!proto.jspb.test.MineField} returns this */ -proto.jspb.test.MineField.prototype.setCookie = function(value) { +MineField.prototype.setCookie = function(value) { return jspb.Message.setField(this, 1, value); }; @@ -3648,7 +3601,7 @@ proto.jspb.test.MineField.prototype.setCookie = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.MineField} returns this */ -proto.jspb.test.MineField.prototype.clearCookie = function() { +MineField.prototype.clearCookie = function() { return jspb.Message.setField(this, 1, undefined); }; @@ -3657,7 +3610,7 @@ proto.jspb.test.MineField.prototype.clearCookie = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.MineField.prototype.hasCookie = function() { +MineField.prototype.hasCookie = function() { return jspb.Message.getField(this, 1) != null; }; @@ -3678,8 +3631,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.jspb.test.IsExtension.prototype.toObject = function(opt_includeInstance) { - return proto.jspb.test.IsExtension.toObject(opt_includeInstance, this); +IsExtension.prototype.toObject = function(opt_includeInstance) { + return IsExtension.toObject(opt_includeInstance, this); }; @@ -3692,7 +3645,7 @@ proto.jspb.test.IsExtension.prototype.toObject = function(opt_includeInstance) { * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.IsExtension.toObject = function(includeInstance, msg) { +IsExtension.toObject = function(includeInstance, msg) { var f, obj = { ext1: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f }; @@ -3710,10 +3663,10 @@ ext1: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.jspb.test.IsExtension} */ -proto.jspb.test.IsExtension.deserializeBinary = function(bytes) { +IsExtension.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.jspb.test.IsExtension; - return proto.jspb.test.IsExtension.deserializeBinaryFromReader(msg, reader); + var msg = new IsExtension; + return IsExtension.deserializeBinaryFromReader(msg, reader); }; @@ -3724,7 +3677,7 @@ proto.jspb.test.IsExtension.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.jspb.test.IsExtension} */ -proto.jspb.test.IsExtension.deserializeBinaryFromReader = function(msg, reader) { +IsExtension.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -3748,9 +3701,9 @@ proto.jspb.test.IsExtension.deserializeBinaryFromReader = function(msg, reader) * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.jspb.test.IsExtension.prototype.serializeBinary = function() { +IsExtension.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.jspb.test.IsExtension.serializeBinaryToWriter(this, writer); + IsExtension.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -3762,7 +3715,7 @@ proto.jspb.test.IsExtension.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.IsExtension.serializeBinaryToWriter = function(message, writer) { +IsExtension.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = /** @type {string} */ (jspb.Message.getField(message, 1)); if (f != null) { @@ -3780,30 +3733,30 @@ proto.jspb.test.IsExtension.serializeBinaryToWriter = function(message, writer) * field named `extField`. * @type {!jspb.ExtensionFieldInfo} */ -proto.jspb.test.IsExtension.extField = new jspb.ExtensionFieldInfo( +IsExtension.extField = new jspb.ExtensionFieldInfo( 100, {extField: 0}, - proto.jspb.test.IsExtension, + IsExtension, /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( - proto.jspb.test.IsExtension.toObject), + IsExtension.toObject), 0); -proto.jspb.test.HasExtensions.extensionsBinary[100] = new jspb.ExtensionFieldBinaryInfo( - proto.jspb.test.IsExtension.extField, +HasExtensions.extensionsBinary[100] = new jspb.ExtensionFieldBinaryInfo( + IsExtension.extField, jspb.BinaryReader.prototype.readMessage, jspb.BinaryWriter.prototype.writeMessage, - proto.jspb.test.IsExtension.serializeBinaryToWriter, - proto.jspb.test.IsExtension.deserializeBinaryFromReader, + IsExtension.serializeBinaryToWriter, + IsExtension.deserializeBinaryFromReader, false); // This registers the extension field with the extended class, so that // toObject() will function correctly. -proto.jspb.test.HasExtensions.extensions[100] = proto.jspb.test.IsExtension.extField; +HasExtensions.extensions[100] = IsExtension.extField; /** * optional string ext1 = 1; * @return {string} */ -proto.jspb.test.IsExtension.prototype.getExt1 = function() { +IsExtension.prototype.getExt1 = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; @@ -3812,7 +3765,7 @@ proto.jspb.test.IsExtension.prototype.getExt1 = function() { * @param {string} value * @return {!proto.jspb.test.IsExtension} returns this */ -proto.jspb.test.IsExtension.prototype.setExt1 = function(value) { +IsExtension.prototype.setExt1 = function(value) { return jspb.Message.setField(this, 1, value); }; @@ -3821,7 +3774,7 @@ proto.jspb.test.IsExtension.prototype.setExt1 = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.IsExtension} returns this */ -proto.jspb.test.IsExtension.prototype.clearExt1 = function() { +IsExtension.prototype.clearExt1 = function() { return jspb.Message.setField(this, 1, undefined); }; @@ -3830,7 +3783,7 @@ proto.jspb.test.IsExtension.prototype.clearExt1 = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.IsExtension.prototype.hasExt1 = function() { +IsExtension.prototype.hasExt1 = function() { return jspb.Message.getField(this, 1) != null; }; @@ -3841,24 +3794,24 @@ proto.jspb.test.IsExtension.prototype.hasExt1 = function() { * field named `extField`. * @type {!jspb.ExtensionFieldInfo} */ -proto.jspb.test.IsExtension.extField = new jspb.ExtensionFieldInfo( +IsExtension.extField = new jspb.ExtensionFieldInfo( 100, {extField: 0}, - proto.jspb.test.IsExtension, + IsExtension, /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( - proto.jspb.test.IsExtension.toObject), + IsExtension.toObject), 0); -proto.jspb.test.HasExtensions.extensionsBinary[100] = new jspb.ExtensionFieldBinaryInfo( - proto.jspb.test.IsExtension.extField, +HasExtensions.extensionsBinary[100] = new jspb.ExtensionFieldBinaryInfo( + IsExtension.extField, jspb.BinaryReader.prototype.readMessage, jspb.BinaryWriter.prototype.writeMessage, - proto.jspb.test.IsExtension.serializeBinaryToWriter, - proto.jspb.test.IsExtension.deserializeBinaryFromReader, + IsExtension.serializeBinaryToWriter, + IsExtension.deserializeBinaryFromReader, false); // This registers the extension field with the extended class, so that // toObject() will function correctly. -proto.jspb.test.HasExtensions.extensions[100] = proto.jspb.test.IsExtension.extField; +HasExtensions.extensions[100] = IsExtension.extField; /** @@ -3866,7 +3819,7 @@ proto.jspb.test.HasExtensions.extensions[100] = proto.jspb.test.IsExtension.extF * field named `simpleOption`. * @type {!jspb.ExtensionFieldInfo} */ -proto.jspb.test.IsExtension.simpleOption = new jspb.ExtensionFieldInfo( +IsExtension.simpleOption = new jspb.ExtensionFieldInfo( 42113038, {simpleOption: 0}, null, @@ -3875,7 +3828,7 @@ proto.jspb.test.IsExtension.simpleOption = new jspb.ExtensionFieldInfo( 0); google_protobuf_descriptor_pb.EnumOptions.extensionsBinary[42113038] = new jspb.ExtensionFieldBinaryInfo( - proto.jspb.test.IsExtension.simpleOption, + IsExtension.simpleOption, jspb.BinaryReader.prototype.readString, jspb.BinaryWriter.prototype.writeString, undefined, @@ -3883,7 +3836,7 @@ google_protobuf_descriptor_pb.EnumOptions.extensionsBinary[42113038] = new jspb. false); // This registers the extension field with the extended class, so that // toObject() will function correctly. -google_protobuf_descriptor_pb.EnumOptions.extensions[42113038] = proto.jspb.test.IsExtension.simpleOption; +google_protobuf_descriptor_pb.EnumOptions.extensions[42113038] = IsExtension.simpleOption; @@ -3901,8 +3854,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.jspb.test.IndirectExtension.prototype.toObject = function(opt_includeInstance) { - return proto.jspb.test.IndirectExtension.toObject(opt_includeInstance, this); +IndirectExtension.prototype.toObject = function(opt_includeInstance) { + return IndirectExtension.toObject(opt_includeInstance, this); }; @@ -3915,7 +3868,7 @@ proto.jspb.test.IndirectExtension.prototype.toObject = function(opt_includeInsta * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.IndirectExtension.toObject = function(includeInstance, msg) { +IndirectExtension.toObject = function(includeInstance, msg) { var f, obj = { }; @@ -3933,10 +3886,10 @@ proto.jspb.test.IndirectExtension.toObject = function(includeInstance, msg) { * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.jspb.test.IndirectExtension} */ -proto.jspb.test.IndirectExtension.deserializeBinary = function(bytes) { +IndirectExtension.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.jspb.test.IndirectExtension; - return proto.jspb.test.IndirectExtension.deserializeBinaryFromReader(msg, reader); + var msg = new IndirectExtension; + return IndirectExtension.deserializeBinaryFromReader(msg, reader); }; @@ -3947,7 +3900,7 @@ proto.jspb.test.IndirectExtension.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.jspb.test.IndirectExtension} */ -proto.jspb.test.IndirectExtension.deserializeBinaryFromReader = function(msg, reader) { +IndirectExtension.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -3967,9 +3920,9 @@ proto.jspb.test.IndirectExtension.deserializeBinaryFromReader = function(msg, re * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.jspb.test.IndirectExtension.prototype.serializeBinary = function() { +IndirectExtension.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.jspb.test.IndirectExtension.serializeBinaryToWriter(this, writer); + IndirectExtension.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -3981,7 +3934,7 @@ proto.jspb.test.IndirectExtension.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.IndirectExtension.serializeBinaryToWriter = function(message, writer) { +IndirectExtension.serializeBinaryToWriter = function(message, writer) { var f = undefined; }; @@ -3992,24 +3945,24 @@ proto.jspb.test.IndirectExtension.serializeBinaryToWriter = function(message, wr * field named `simple`. * @type {!jspb.ExtensionFieldInfo} */ -proto.jspb.test.IndirectExtension.simple = new jspb.ExtensionFieldInfo( +IndirectExtension.simple = new jspb.ExtensionFieldInfo( 101, {simple: 0}, - proto.jspb.test.Simple1, + Simple1, /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( - proto.jspb.test.Simple1.toObject), + Simple1.toObject), 0); -proto.jspb.test.HasExtensions.extensionsBinary[101] = new jspb.ExtensionFieldBinaryInfo( - proto.jspb.test.IndirectExtension.simple, +HasExtensions.extensionsBinary[101] = new jspb.ExtensionFieldBinaryInfo( + IndirectExtension.simple, jspb.BinaryReader.prototype.readMessage, jspb.BinaryWriter.prototype.writeMessage, - proto.jspb.test.Simple1.serializeBinaryToWriter, - proto.jspb.test.Simple1.deserializeBinaryFromReader, + Simple1.serializeBinaryToWriter, + Simple1.deserializeBinaryFromReader, false); // This registers the extension field with the extended class, so that // toObject() will function correctly. -proto.jspb.test.HasExtensions.extensions[101] = proto.jspb.test.IndirectExtension.simple; +HasExtensions.extensions[101] = IndirectExtension.simple; /** @@ -4017,7 +3970,7 @@ proto.jspb.test.HasExtensions.extensions[101] = proto.jspb.test.IndirectExtensio * field named `str`. * @type {!jspb.ExtensionFieldInfo} */ -proto.jspb.test.IndirectExtension.str = new jspb.ExtensionFieldInfo( +IndirectExtension.str = new jspb.ExtensionFieldInfo( 102, {str: 0}, null, @@ -4025,8 +3978,8 @@ proto.jspb.test.IndirectExtension.str = new jspb.ExtensionFieldInfo( null), 0); -proto.jspb.test.HasExtensions.extensionsBinary[102] = new jspb.ExtensionFieldBinaryInfo( - proto.jspb.test.IndirectExtension.str, +HasExtensions.extensionsBinary[102] = new jspb.ExtensionFieldBinaryInfo( + IndirectExtension.str, jspb.BinaryReader.prototype.readString, jspb.BinaryWriter.prototype.writeString, undefined, @@ -4034,7 +3987,7 @@ proto.jspb.test.HasExtensions.extensionsBinary[102] = new jspb.ExtensionFieldBin false); // This registers the extension field with the extended class, so that // toObject() will function correctly. -proto.jspb.test.HasExtensions.extensions[102] = proto.jspb.test.IndirectExtension.str; +HasExtensions.extensions[102] = IndirectExtension.str; /** @@ -4042,7 +3995,7 @@ proto.jspb.test.HasExtensions.extensions[102] = proto.jspb.test.IndirectExtensio * field named `repeatedStrList`. * @type {!jspb.ExtensionFieldInfo>} */ -proto.jspb.test.IndirectExtension.repeatedStrList = new jspb.ExtensionFieldInfo( +IndirectExtension.repeatedStrList = new jspb.ExtensionFieldInfo( 103, {repeatedStrList: 0}, null, @@ -4050,8 +4003,8 @@ proto.jspb.test.IndirectExtension.repeatedStrList = new jspb.ExtensionFieldInfo( null), 1); -proto.jspb.test.HasExtensions.extensionsBinary[103] = new jspb.ExtensionFieldBinaryInfo( - proto.jspb.test.IndirectExtension.repeatedStrList, +HasExtensions.extensionsBinary[103] = new jspb.ExtensionFieldBinaryInfo( + IndirectExtension.repeatedStrList, jspb.BinaryReader.prototype.readString, jspb.BinaryWriter.prototype.writeRepeatedString, undefined, @@ -4059,7 +4012,7 @@ proto.jspb.test.HasExtensions.extensionsBinary[103] = new jspb.ExtensionFieldBin false); // This registers the extension field with the extended class, so that // toObject() will function correctly. -proto.jspb.test.HasExtensions.extensions[103] = proto.jspb.test.IndirectExtension.repeatedStrList; +HasExtensions.extensions[103] = IndirectExtension.repeatedStrList; /** @@ -4067,24 +4020,24 @@ proto.jspb.test.HasExtensions.extensions[103] = proto.jspb.test.IndirectExtensio * field named `repeatedSimpleList`. * @type {!jspb.ExtensionFieldInfo>} */ -proto.jspb.test.IndirectExtension.repeatedSimpleList = new jspb.ExtensionFieldInfo( +IndirectExtension.repeatedSimpleList = new jspb.ExtensionFieldInfo( 104, {repeatedSimpleList: 0}, - proto.jspb.test.Simple1, + Simple1, /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( - proto.jspb.test.Simple1.toObject), + Simple1.toObject), 1); -proto.jspb.test.HasExtensions.extensionsBinary[104] = new jspb.ExtensionFieldBinaryInfo( - proto.jspb.test.IndirectExtension.repeatedSimpleList, +HasExtensions.extensionsBinary[104] = new jspb.ExtensionFieldBinaryInfo( + IndirectExtension.repeatedSimpleList, jspb.BinaryReader.prototype.readMessage, jspb.BinaryWriter.prototype.writeRepeatedMessage, - proto.jspb.test.Simple1.serializeBinaryToWriter, - proto.jspb.test.Simple1.deserializeBinaryFromReader, + Simple1.serializeBinaryToWriter, + Simple1.deserializeBinaryFromReader, false); // This registers the extension field with the extended class, so that // toObject() will function correctly. -proto.jspb.test.HasExtensions.extensions[104] = proto.jspb.test.IndirectExtension.repeatedSimpleList; +HasExtensions.extensions[104] = IndirectExtension.repeatedSimpleList; /** @@ -4092,24 +4045,24 @@ proto.jspb.test.HasExtensions.extensions[104] = proto.jspb.test.IndirectExtensio * field named `simple`. * @type {!jspb.ExtensionFieldInfo} */ -proto.jspb.test.IndirectExtension.simple = new jspb.ExtensionFieldInfo( +IndirectExtension.simple = new jspb.ExtensionFieldInfo( 101, {simple: 0}, - proto.jspb.test.Simple1, + Simple1, /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( - proto.jspb.test.Simple1.toObject), + Simple1.toObject), 0); -proto.jspb.test.HasExtensions.extensionsBinary[101] = new jspb.ExtensionFieldBinaryInfo( - proto.jspb.test.IndirectExtension.simple, +HasExtensions.extensionsBinary[101] = new jspb.ExtensionFieldBinaryInfo( + IndirectExtension.simple, jspb.BinaryReader.prototype.readMessage, jspb.BinaryWriter.prototype.writeMessage, - proto.jspb.test.Simple1.serializeBinaryToWriter, - proto.jspb.test.Simple1.deserializeBinaryFromReader, + Simple1.serializeBinaryToWriter, + Simple1.deserializeBinaryFromReader, false); // This registers the extension field with the extended class, so that // toObject() will function correctly. -proto.jspb.test.HasExtensions.extensions[101] = proto.jspb.test.IndirectExtension.simple; +HasExtensions.extensions[101] = IndirectExtension.simple; /** @@ -4117,7 +4070,7 @@ proto.jspb.test.HasExtensions.extensions[101] = proto.jspb.test.IndirectExtensio * field named `str`. * @type {!jspb.ExtensionFieldInfo} */ -proto.jspb.test.IndirectExtension.str = new jspb.ExtensionFieldInfo( +IndirectExtension.str = new jspb.ExtensionFieldInfo( 102, {str: 0}, null, @@ -4125,8 +4078,8 @@ proto.jspb.test.IndirectExtension.str = new jspb.ExtensionFieldInfo( null), 0); -proto.jspb.test.HasExtensions.extensionsBinary[102] = new jspb.ExtensionFieldBinaryInfo( - proto.jspb.test.IndirectExtension.str, +HasExtensions.extensionsBinary[102] = new jspb.ExtensionFieldBinaryInfo( + IndirectExtension.str, jspb.BinaryReader.prototype.readString, jspb.BinaryWriter.prototype.writeString, undefined, @@ -4134,7 +4087,7 @@ proto.jspb.test.HasExtensions.extensionsBinary[102] = new jspb.ExtensionFieldBin false); // This registers the extension field with the extended class, so that // toObject() will function correctly. -proto.jspb.test.HasExtensions.extensions[102] = proto.jspb.test.IndirectExtension.str; +HasExtensions.extensions[102] = IndirectExtension.str; /** @@ -4142,7 +4095,7 @@ proto.jspb.test.HasExtensions.extensions[102] = proto.jspb.test.IndirectExtensio * field named `repeatedStrList`. * @type {!jspb.ExtensionFieldInfo>} */ -proto.jspb.test.IndirectExtension.repeatedStrList = new jspb.ExtensionFieldInfo( +IndirectExtension.repeatedStrList = new jspb.ExtensionFieldInfo( 103, {repeatedStrList: 0}, null, @@ -4150,8 +4103,8 @@ proto.jspb.test.IndirectExtension.repeatedStrList = new jspb.ExtensionFieldInfo( null), 1); -proto.jspb.test.HasExtensions.extensionsBinary[103] = new jspb.ExtensionFieldBinaryInfo( - proto.jspb.test.IndirectExtension.repeatedStrList, +HasExtensions.extensionsBinary[103] = new jspb.ExtensionFieldBinaryInfo( + IndirectExtension.repeatedStrList, jspb.BinaryReader.prototype.readString, jspb.BinaryWriter.prototype.writeRepeatedString, undefined, @@ -4159,7 +4112,7 @@ proto.jspb.test.HasExtensions.extensionsBinary[103] = new jspb.ExtensionFieldBin false); // This registers the extension field with the extended class, so that // toObject() will function correctly. -proto.jspb.test.HasExtensions.extensions[103] = proto.jspb.test.IndirectExtension.repeatedStrList; +HasExtensions.extensions[103] = IndirectExtension.repeatedStrList; /** @@ -4167,24 +4120,24 @@ proto.jspb.test.HasExtensions.extensions[103] = proto.jspb.test.IndirectExtensio * field named `repeatedSimpleList`. * @type {!jspb.ExtensionFieldInfo>} */ -proto.jspb.test.IndirectExtension.repeatedSimpleList = new jspb.ExtensionFieldInfo( +IndirectExtension.repeatedSimpleList = new jspb.ExtensionFieldInfo( 104, {repeatedSimpleList: 0}, - proto.jspb.test.Simple1, + Simple1, /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( - proto.jspb.test.Simple1.toObject), + Simple1.toObject), 1); -proto.jspb.test.HasExtensions.extensionsBinary[104] = new jspb.ExtensionFieldBinaryInfo( - proto.jspb.test.IndirectExtension.repeatedSimpleList, +HasExtensions.extensionsBinary[104] = new jspb.ExtensionFieldBinaryInfo( + IndirectExtension.repeatedSimpleList, jspb.BinaryReader.prototype.readMessage, jspb.BinaryWriter.prototype.writeRepeatedMessage, - proto.jspb.test.Simple1.serializeBinaryToWriter, - proto.jspb.test.Simple1.deserializeBinaryFromReader, + Simple1.serializeBinaryToWriter, + Simple1.deserializeBinaryFromReader, false); // This registers the extension field with the extended class, so that // toObject() will function correctly. -proto.jspb.test.HasExtensions.extensions[104] = proto.jspb.test.IndirectExtension.repeatedSimpleList; +HasExtensions.extensions[104] = IndirectExtension.repeatedSimpleList; @@ -4202,8 +4155,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.jspb.test.DefaultValues.prototype.toObject = function(opt_includeInstance) { - return proto.jspb.test.DefaultValues.toObject(opt_includeInstance, this); +DefaultValues.prototype.toObject = function(opt_includeInstance) { + return DefaultValues.toObject(opt_includeInstance, this); }; @@ -4216,7 +4169,7 @@ proto.jspb.test.DefaultValues.prototype.toObject = function(opt_includeInstance) * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.DefaultValues.toObject = function(includeInstance, msg) { +DefaultValues.toObject = function(includeInstance, msg) { var f, obj = { stringField: jspb.Message.getFieldWithDefault(msg, 1, "default\x3c\x3e\x27\x22abc"), boolField: jspb.Message.getBooleanFieldWithDefault(msg, 2, true), @@ -4239,10 +4192,10 @@ bytesField: msg.getBytesField_asB64() * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.jspb.test.DefaultValues} */ -proto.jspb.test.DefaultValues.deserializeBinary = function(bytes) { +DefaultValues.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.jspb.test.DefaultValues; - return proto.jspb.test.DefaultValues.deserializeBinaryFromReader(msg, reader); + var msg = new DefaultValues; + return DefaultValues.deserializeBinaryFromReader(msg, reader); }; @@ -4253,7 +4206,7 @@ proto.jspb.test.DefaultValues.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.jspb.test.DefaultValues} */ -proto.jspb.test.DefaultValues.deserializeBinaryFromReader = function(msg, reader) { +DefaultValues.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -4297,9 +4250,9 @@ proto.jspb.test.DefaultValues.deserializeBinaryFromReader = function(msg, reader * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.jspb.test.DefaultValues.prototype.serializeBinary = function() { +DefaultValues.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.jspb.test.DefaultValues.serializeBinaryToWriter(this, writer); + DefaultValues.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -4311,7 +4264,7 @@ proto.jspb.test.DefaultValues.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.DefaultValues.serializeBinaryToWriter = function(message, writer) { +DefaultValues.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = /** @type {string} */ (jspb.Message.getField(message, 1)); if (f != null) { @@ -4361,7 +4314,7 @@ proto.jspb.test.DefaultValues.serializeBinaryToWriter = function(message, writer /** * @enum {number} */ -proto.jspb.test.DefaultValues.Enum = { +DefaultValues.Enum = { E1: 13, E2: 77 }; @@ -4370,7 +4323,7 @@ proto.jspb.test.DefaultValues.Enum = { * optional string string_field = 1; * @return {string} */ -proto.jspb.test.DefaultValues.prototype.getStringField = function() { +DefaultValues.prototype.getStringField = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "default\x3c\x3e\x27\x22abc")); }; @@ -4379,7 +4332,7 @@ proto.jspb.test.DefaultValues.prototype.getStringField = function() { * @param {string} value * @return {!proto.jspb.test.DefaultValues} returns this */ -proto.jspb.test.DefaultValues.prototype.setStringField = function(value) { +DefaultValues.prototype.setStringField = function(value) { return jspb.Message.setField(this, 1, value); }; @@ -4388,7 +4341,7 @@ proto.jspb.test.DefaultValues.prototype.setStringField = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.DefaultValues} returns this */ -proto.jspb.test.DefaultValues.prototype.clearStringField = function() { +DefaultValues.prototype.clearStringField = function() { return jspb.Message.setField(this, 1, undefined); }; @@ -4397,7 +4350,7 @@ proto.jspb.test.DefaultValues.prototype.clearStringField = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.DefaultValues.prototype.hasStringField = function() { +DefaultValues.prototype.hasStringField = function() { return jspb.Message.getField(this, 1) != null; }; @@ -4406,7 +4359,7 @@ proto.jspb.test.DefaultValues.prototype.hasStringField = function() { * optional bool bool_field = 2; * @return {boolean} */ -proto.jspb.test.DefaultValues.prototype.getBoolField = function() { +DefaultValues.prototype.getBoolField = function() { return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, true)); }; @@ -4415,7 +4368,7 @@ proto.jspb.test.DefaultValues.prototype.getBoolField = function() { * @param {boolean} value * @return {!proto.jspb.test.DefaultValues} returns this */ -proto.jspb.test.DefaultValues.prototype.setBoolField = function(value) { +DefaultValues.prototype.setBoolField = function(value) { return jspb.Message.setField(this, 2, value); }; @@ -4424,7 +4377,7 @@ proto.jspb.test.DefaultValues.prototype.setBoolField = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.DefaultValues} returns this */ -proto.jspb.test.DefaultValues.prototype.clearBoolField = function() { +DefaultValues.prototype.clearBoolField = function() { return jspb.Message.setField(this, 2, undefined); }; @@ -4433,7 +4386,7 @@ proto.jspb.test.DefaultValues.prototype.clearBoolField = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.DefaultValues.prototype.hasBoolField = function() { +DefaultValues.prototype.hasBoolField = function() { return jspb.Message.getField(this, 2) != null; }; @@ -4442,7 +4395,7 @@ proto.jspb.test.DefaultValues.prototype.hasBoolField = function() { * optional int64 int_field = 3; * @return {number} */ -proto.jspb.test.DefaultValues.prototype.getIntField = function() { +DefaultValues.prototype.getIntField = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 11)); }; @@ -4451,7 +4404,7 @@ proto.jspb.test.DefaultValues.prototype.getIntField = function() { * @param {number} value * @return {!proto.jspb.test.DefaultValues} returns this */ -proto.jspb.test.DefaultValues.prototype.setIntField = function(value) { +DefaultValues.prototype.setIntField = function(value) { return jspb.Message.setField(this, 3, value); }; @@ -4460,7 +4413,7 @@ proto.jspb.test.DefaultValues.prototype.setIntField = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.DefaultValues} returns this */ -proto.jspb.test.DefaultValues.prototype.clearIntField = function() { +DefaultValues.prototype.clearIntField = function() { return jspb.Message.setField(this, 3, undefined); }; @@ -4469,7 +4422,7 @@ proto.jspb.test.DefaultValues.prototype.clearIntField = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.DefaultValues.prototype.hasIntField = function() { +DefaultValues.prototype.hasIntField = function() { return jspb.Message.getField(this, 3) != null; }; @@ -4478,7 +4431,7 @@ proto.jspb.test.DefaultValues.prototype.hasIntField = function() { * optional Enum enum_field = 4; * @return {!proto.jspb.test.DefaultValues.Enum} */ -proto.jspb.test.DefaultValues.prototype.getEnumField = function() { +DefaultValues.prototype.getEnumField = function() { return /** @type {!proto.jspb.test.DefaultValues.Enum} */ (jspb.Message.getFieldWithDefault(this, 4, 13)); }; @@ -4487,7 +4440,7 @@ proto.jspb.test.DefaultValues.prototype.getEnumField = function() { * @param {!proto.jspb.test.DefaultValues.Enum} value * @return {!proto.jspb.test.DefaultValues} returns this */ -proto.jspb.test.DefaultValues.prototype.setEnumField = function(value) { +DefaultValues.prototype.setEnumField = function(value) { return jspb.Message.setField(this, 4, value); }; @@ -4496,7 +4449,7 @@ proto.jspb.test.DefaultValues.prototype.setEnumField = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.DefaultValues} returns this */ -proto.jspb.test.DefaultValues.prototype.clearEnumField = function() { +DefaultValues.prototype.clearEnumField = function() { return jspb.Message.setField(this, 4, undefined); }; @@ -4505,7 +4458,7 @@ proto.jspb.test.DefaultValues.prototype.clearEnumField = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.DefaultValues.prototype.hasEnumField = function() { +DefaultValues.prototype.hasEnumField = function() { return jspb.Message.getField(this, 4) != null; }; @@ -4514,7 +4467,7 @@ proto.jspb.test.DefaultValues.prototype.hasEnumField = function() { * optional string empty_field = 6; * @return {string} */ -proto.jspb.test.DefaultValues.prototype.getEmptyField = function() { +DefaultValues.prototype.getEmptyField = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); }; @@ -4523,7 +4476,7 @@ proto.jspb.test.DefaultValues.prototype.getEmptyField = function() { * @param {string} value * @return {!proto.jspb.test.DefaultValues} returns this */ -proto.jspb.test.DefaultValues.prototype.setEmptyField = function(value) { +DefaultValues.prototype.setEmptyField = function(value) { return jspb.Message.setField(this, 6, value); }; @@ -4532,7 +4485,7 @@ proto.jspb.test.DefaultValues.prototype.setEmptyField = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.DefaultValues} returns this */ -proto.jspb.test.DefaultValues.prototype.clearEmptyField = function() { +DefaultValues.prototype.clearEmptyField = function() { return jspb.Message.setField(this, 6, undefined); }; @@ -4541,7 +4494,7 @@ proto.jspb.test.DefaultValues.prototype.clearEmptyField = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.DefaultValues.prototype.hasEmptyField = function() { +DefaultValues.prototype.hasEmptyField = function() { return jspb.Message.getField(this, 6) != null; }; @@ -4550,7 +4503,7 @@ proto.jspb.test.DefaultValues.prototype.hasEmptyField = function() { * optional bytes bytes_field = 8; * @return {!(string|Uint8Array)} */ -proto.jspb.test.DefaultValues.prototype.getBytesField = function() { +DefaultValues.prototype.getBytesField = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 8, "bW9v")); }; @@ -4560,7 +4513,7 @@ proto.jspb.test.DefaultValues.prototype.getBytesField = function() { * This is a type-conversion wrapper around `getBytesField()` * @return {string} */ -proto.jspb.test.DefaultValues.prototype.getBytesField_asB64 = function() { +DefaultValues.prototype.getBytesField_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getBytesField())); }; @@ -4573,7 +4526,7 @@ proto.jspb.test.DefaultValues.prototype.getBytesField_asB64 = function() { * This is a type-conversion wrapper around `getBytesField()` * @return {!Uint8Array} */ -proto.jspb.test.DefaultValues.prototype.getBytesField_asU8 = function() { +DefaultValues.prototype.getBytesField_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getBytesField())); }; @@ -4583,7 +4536,7 @@ proto.jspb.test.DefaultValues.prototype.getBytesField_asU8 = function() { * @param {!(string|Uint8Array)} value * @return {!proto.jspb.test.DefaultValues} returns this */ -proto.jspb.test.DefaultValues.prototype.setBytesField = function(value) { +DefaultValues.prototype.setBytesField = function(value) { return jspb.Message.setField(this, 8, value); }; @@ -4592,7 +4545,7 @@ proto.jspb.test.DefaultValues.prototype.setBytesField = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.DefaultValues} returns this */ -proto.jspb.test.DefaultValues.prototype.clearBytesField = function() { +DefaultValues.prototype.clearBytesField = function() { return jspb.Message.setField(this, 8, undefined); }; @@ -4601,7 +4554,7 @@ proto.jspb.test.DefaultValues.prototype.clearBytesField = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.DefaultValues.prototype.hasBytesField = function() { +DefaultValues.prototype.hasBytesField = function() { return jspb.Message.getField(this, 8) != null; }; @@ -4612,7 +4565,7 @@ proto.jspb.test.DefaultValues.prototype.hasBytesField = function() { * @private {!Array} * @const */ -proto.jspb.test.FloatingPointFields.repeatedFields_ = [3,7]; +FloatingPointFields.repeatedFields_ = [3,7]; @@ -4629,8 +4582,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.jspb.test.FloatingPointFields.prototype.toObject = function(opt_includeInstance) { - return proto.jspb.test.FloatingPointFields.toObject(opt_includeInstance, this); +FloatingPointFields.prototype.toObject = function(opt_includeInstance) { + return FloatingPointFields.toObject(opt_includeInstance, this); }; @@ -4643,7 +4596,7 @@ proto.jspb.test.FloatingPointFields.prototype.toObject = function(opt_includeIns * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.FloatingPointFields.toObject = function(includeInstance, msg) { +FloatingPointFields.toObject = function(includeInstance, msg) { var f, obj = { optionalFloatField: (f = jspb.Message.getOptionalFloatingPointField(msg, 1)) == null ? undefined : f, requiredFloatField: (f = jspb.Message.getOptionalFloatingPointField(msg, 2)) == null ? undefined : f, @@ -4668,10 +4621,10 @@ defaultDoubleField: jspb.Message.getFloatingPointFieldWithDefault(msg, 8, 2.0) * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.jspb.test.FloatingPointFields} */ -proto.jspb.test.FloatingPointFields.deserializeBinary = function(bytes) { +FloatingPointFields.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.jspb.test.FloatingPointFields; - return proto.jspb.test.FloatingPointFields.deserializeBinaryFromReader(msg, reader); + var msg = new FloatingPointFields; + return FloatingPointFields.deserializeBinaryFromReader(msg, reader); }; @@ -4682,7 +4635,7 @@ proto.jspb.test.FloatingPointFields.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.jspb.test.FloatingPointFields} */ -proto.jspb.test.FloatingPointFields.deserializeBinaryFromReader = function(msg, reader) { +FloatingPointFields.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -4738,9 +4691,9 @@ proto.jspb.test.FloatingPointFields.deserializeBinaryFromReader = function(msg, * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.jspb.test.FloatingPointFields.prototype.serializeBinary = function() { +FloatingPointFields.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.jspb.test.FloatingPointFields.serializeBinaryToWriter(this, writer); + FloatingPointFields.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -4752,7 +4705,7 @@ proto.jspb.test.FloatingPointFields.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.FloatingPointFields.serializeBinaryToWriter = function(message, writer) { +FloatingPointFields.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = /** @type {number} */ (jspb.Message.getField(message, 1)); if (f != null) { @@ -4817,7 +4770,7 @@ proto.jspb.test.FloatingPointFields.serializeBinaryToWriter = function(message, * optional float optional_float_field = 1; * @return {number} */ -proto.jspb.test.FloatingPointFields.prototype.getOptionalFloatField = function() { +FloatingPointFields.prototype.getOptionalFloatField = function() { return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 1, 0.0)); }; @@ -4826,7 +4779,7 @@ proto.jspb.test.FloatingPointFields.prototype.getOptionalFloatField = function() * @param {number} value * @return {!proto.jspb.test.FloatingPointFields} returns this */ -proto.jspb.test.FloatingPointFields.prototype.setOptionalFloatField = function(value) { +FloatingPointFields.prototype.setOptionalFloatField = function(value) { return jspb.Message.setField(this, 1, value); }; @@ -4835,7 +4788,7 @@ proto.jspb.test.FloatingPointFields.prototype.setOptionalFloatField = function(v * Clears the field making it undefined. * @return {!proto.jspb.test.FloatingPointFields} returns this */ -proto.jspb.test.FloatingPointFields.prototype.clearOptionalFloatField = function() { +FloatingPointFields.prototype.clearOptionalFloatField = function() { return jspb.Message.setField(this, 1, undefined); }; @@ -4844,7 +4797,7 @@ proto.jspb.test.FloatingPointFields.prototype.clearOptionalFloatField = function * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.FloatingPointFields.prototype.hasOptionalFloatField = function() { +FloatingPointFields.prototype.hasOptionalFloatField = function() { return jspb.Message.getField(this, 1) != null; }; @@ -4853,7 +4806,7 @@ proto.jspb.test.FloatingPointFields.prototype.hasOptionalFloatField = function() * required float required_float_field = 2; * @return {number} */ -proto.jspb.test.FloatingPointFields.prototype.getRequiredFloatField = function() { +FloatingPointFields.prototype.getRequiredFloatField = function() { return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 2, 0.0)); }; @@ -4862,7 +4815,7 @@ proto.jspb.test.FloatingPointFields.prototype.getRequiredFloatField = function() * @param {number} value * @return {!proto.jspb.test.FloatingPointFields} returns this */ -proto.jspb.test.FloatingPointFields.prototype.setRequiredFloatField = function(value) { +FloatingPointFields.prototype.setRequiredFloatField = function(value) { return jspb.Message.setField(this, 2, value); }; @@ -4871,7 +4824,7 @@ proto.jspb.test.FloatingPointFields.prototype.setRequiredFloatField = function(v * Clears the field making it undefined. * @return {!proto.jspb.test.FloatingPointFields} returns this */ -proto.jspb.test.FloatingPointFields.prototype.clearRequiredFloatField = function() { +FloatingPointFields.prototype.clearRequiredFloatField = function() { return jspb.Message.setField(this, 2, undefined); }; @@ -4880,7 +4833,7 @@ proto.jspb.test.FloatingPointFields.prototype.clearRequiredFloatField = function * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.FloatingPointFields.prototype.hasRequiredFloatField = function() { +FloatingPointFields.prototype.hasRequiredFloatField = function() { return jspb.Message.getField(this, 2) != null; }; @@ -4889,7 +4842,7 @@ proto.jspb.test.FloatingPointFields.prototype.hasRequiredFloatField = function() * repeated float repeated_float_field = 3; * @return {!Array} */ -proto.jspb.test.FloatingPointFields.prototype.getRepeatedFloatFieldList = function() { +FloatingPointFields.prototype.getRepeatedFloatFieldList = function() { return /** @type {!Array} */ (jspb.Message.getRepeatedFloatingPointField(this, 3)); }; @@ -4898,7 +4851,7 @@ proto.jspb.test.FloatingPointFields.prototype.getRepeatedFloatFieldList = functi * @param {!Array} value * @return {!proto.jspb.test.FloatingPointFields} returns this */ -proto.jspb.test.FloatingPointFields.prototype.setRepeatedFloatFieldList = function(value) { +FloatingPointFields.prototype.setRepeatedFloatFieldList = function(value) { return jspb.Message.setField(this, 3, value || []); }; @@ -4908,7 +4861,7 @@ proto.jspb.test.FloatingPointFields.prototype.setRepeatedFloatFieldList = functi * @param {number=} opt_index * @return {!proto.jspb.test.FloatingPointFields} returns this */ -proto.jspb.test.FloatingPointFields.prototype.addRepeatedFloatField = function(value, opt_index) { +FloatingPointFields.prototype.addRepeatedFloatField = function(value, opt_index) { return jspb.Message.addToRepeatedField(this, 3, value, opt_index); }; @@ -4917,7 +4870,7 @@ proto.jspb.test.FloatingPointFields.prototype.addRepeatedFloatField = function(v * Clears the list making it empty but non-null. * @return {!proto.jspb.test.FloatingPointFields} returns this */ -proto.jspb.test.FloatingPointFields.prototype.clearRepeatedFloatFieldList = function() { +FloatingPointFields.prototype.clearRepeatedFloatFieldList = function() { return this.setRepeatedFloatFieldList([]); }; @@ -4926,7 +4879,7 @@ proto.jspb.test.FloatingPointFields.prototype.clearRepeatedFloatFieldList = func * optional float default_float_field = 4; * @return {number} */ -proto.jspb.test.FloatingPointFields.prototype.getDefaultFloatField = function() { +FloatingPointFields.prototype.getDefaultFloatField = function() { return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 4, 2.0)); }; @@ -4935,7 +4888,7 @@ proto.jspb.test.FloatingPointFields.prototype.getDefaultFloatField = function() * @param {number} value * @return {!proto.jspb.test.FloatingPointFields} returns this */ -proto.jspb.test.FloatingPointFields.prototype.setDefaultFloatField = function(value) { +FloatingPointFields.prototype.setDefaultFloatField = function(value) { return jspb.Message.setField(this, 4, value); }; @@ -4944,7 +4897,7 @@ proto.jspb.test.FloatingPointFields.prototype.setDefaultFloatField = function(va * Clears the field making it undefined. * @return {!proto.jspb.test.FloatingPointFields} returns this */ -proto.jspb.test.FloatingPointFields.prototype.clearDefaultFloatField = function() { +FloatingPointFields.prototype.clearDefaultFloatField = function() { return jspb.Message.setField(this, 4, undefined); }; @@ -4953,7 +4906,7 @@ proto.jspb.test.FloatingPointFields.prototype.clearDefaultFloatField = function( * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.FloatingPointFields.prototype.hasDefaultFloatField = function() { +FloatingPointFields.prototype.hasDefaultFloatField = function() { return jspb.Message.getField(this, 4) != null; }; @@ -4962,7 +4915,7 @@ proto.jspb.test.FloatingPointFields.prototype.hasDefaultFloatField = function() * optional double optional_double_field = 5; * @return {number} */ -proto.jspb.test.FloatingPointFields.prototype.getOptionalDoubleField = function() { +FloatingPointFields.prototype.getOptionalDoubleField = function() { return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 5, 0.0)); }; @@ -4971,7 +4924,7 @@ proto.jspb.test.FloatingPointFields.prototype.getOptionalDoubleField = function( * @param {number} value * @return {!proto.jspb.test.FloatingPointFields} returns this */ -proto.jspb.test.FloatingPointFields.prototype.setOptionalDoubleField = function(value) { +FloatingPointFields.prototype.setOptionalDoubleField = function(value) { return jspb.Message.setField(this, 5, value); }; @@ -4980,7 +4933,7 @@ proto.jspb.test.FloatingPointFields.prototype.setOptionalDoubleField = function( * Clears the field making it undefined. * @return {!proto.jspb.test.FloatingPointFields} returns this */ -proto.jspb.test.FloatingPointFields.prototype.clearOptionalDoubleField = function() { +FloatingPointFields.prototype.clearOptionalDoubleField = function() { return jspb.Message.setField(this, 5, undefined); }; @@ -4989,7 +4942,7 @@ proto.jspb.test.FloatingPointFields.prototype.clearOptionalDoubleField = functio * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.FloatingPointFields.prototype.hasOptionalDoubleField = function() { +FloatingPointFields.prototype.hasOptionalDoubleField = function() { return jspb.Message.getField(this, 5) != null; }; @@ -4998,7 +4951,7 @@ proto.jspb.test.FloatingPointFields.prototype.hasOptionalDoubleField = function( * required double required_double_field = 6; * @return {number} */ -proto.jspb.test.FloatingPointFields.prototype.getRequiredDoubleField = function() { +FloatingPointFields.prototype.getRequiredDoubleField = function() { return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 6, 0.0)); }; @@ -5007,7 +4960,7 @@ proto.jspb.test.FloatingPointFields.prototype.getRequiredDoubleField = function( * @param {number} value * @return {!proto.jspb.test.FloatingPointFields} returns this */ -proto.jspb.test.FloatingPointFields.prototype.setRequiredDoubleField = function(value) { +FloatingPointFields.prototype.setRequiredDoubleField = function(value) { return jspb.Message.setField(this, 6, value); }; @@ -5016,7 +4969,7 @@ proto.jspb.test.FloatingPointFields.prototype.setRequiredDoubleField = function( * Clears the field making it undefined. * @return {!proto.jspb.test.FloatingPointFields} returns this */ -proto.jspb.test.FloatingPointFields.prototype.clearRequiredDoubleField = function() { +FloatingPointFields.prototype.clearRequiredDoubleField = function() { return jspb.Message.setField(this, 6, undefined); }; @@ -5025,7 +4978,7 @@ proto.jspb.test.FloatingPointFields.prototype.clearRequiredDoubleField = functio * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.FloatingPointFields.prototype.hasRequiredDoubleField = function() { +FloatingPointFields.prototype.hasRequiredDoubleField = function() { return jspb.Message.getField(this, 6) != null; }; @@ -5034,7 +4987,7 @@ proto.jspb.test.FloatingPointFields.prototype.hasRequiredDoubleField = function( * repeated double repeated_double_field = 7; * @return {!Array} */ -proto.jspb.test.FloatingPointFields.prototype.getRepeatedDoubleFieldList = function() { +FloatingPointFields.prototype.getRepeatedDoubleFieldList = function() { return /** @type {!Array} */ (jspb.Message.getRepeatedFloatingPointField(this, 7)); }; @@ -5043,7 +4996,7 @@ proto.jspb.test.FloatingPointFields.prototype.getRepeatedDoubleFieldList = funct * @param {!Array} value * @return {!proto.jspb.test.FloatingPointFields} returns this */ -proto.jspb.test.FloatingPointFields.prototype.setRepeatedDoubleFieldList = function(value) { +FloatingPointFields.prototype.setRepeatedDoubleFieldList = function(value) { return jspb.Message.setField(this, 7, value || []); }; @@ -5053,7 +5006,7 @@ proto.jspb.test.FloatingPointFields.prototype.setRepeatedDoubleFieldList = funct * @param {number=} opt_index * @return {!proto.jspb.test.FloatingPointFields} returns this */ -proto.jspb.test.FloatingPointFields.prototype.addRepeatedDoubleField = function(value, opt_index) { +FloatingPointFields.prototype.addRepeatedDoubleField = function(value, opt_index) { return jspb.Message.addToRepeatedField(this, 7, value, opt_index); }; @@ -5062,7 +5015,7 @@ proto.jspb.test.FloatingPointFields.prototype.addRepeatedDoubleField = function( * Clears the list making it empty but non-null. * @return {!proto.jspb.test.FloatingPointFields} returns this */ -proto.jspb.test.FloatingPointFields.prototype.clearRepeatedDoubleFieldList = function() { +FloatingPointFields.prototype.clearRepeatedDoubleFieldList = function() { return this.setRepeatedDoubleFieldList([]); }; @@ -5071,7 +5024,7 @@ proto.jspb.test.FloatingPointFields.prototype.clearRepeatedDoubleFieldList = fun * optional double default_double_field = 8; * @return {number} */ -proto.jspb.test.FloatingPointFields.prototype.getDefaultDoubleField = function() { +FloatingPointFields.prototype.getDefaultDoubleField = function() { return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 8, 2.0)); }; @@ -5080,7 +5033,7 @@ proto.jspb.test.FloatingPointFields.prototype.getDefaultDoubleField = function() * @param {number} value * @return {!proto.jspb.test.FloatingPointFields} returns this */ -proto.jspb.test.FloatingPointFields.prototype.setDefaultDoubleField = function(value) { +FloatingPointFields.prototype.setDefaultDoubleField = function(value) { return jspb.Message.setField(this, 8, value); }; @@ -5089,7 +5042,7 @@ proto.jspb.test.FloatingPointFields.prototype.setDefaultDoubleField = function(v * Clears the field making it undefined. * @return {!proto.jspb.test.FloatingPointFields} returns this */ -proto.jspb.test.FloatingPointFields.prototype.clearDefaultDoubleField = function() { +FloatingPointFields.prototype.clearDefaultDoubleField = function() { return jspb.Message.setField(this, 8, undefined); }; @@ -5098,7 +5051,7 @@ proto.jspb.test.FloatingPointFields.prototype.clearDefaultDoubleField = function * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.FloatingPointFields.prototype.hasDefaultDoubleField = function() { +FloatingPointFields.prototype.hasDefaultDoubleField = function() { return jspb.Message.getField(this, 8) != null; }; @@ -5109,7 +5062,7 @@ proto.jspb.test.FloatingPointFields.prototype.hasDefaultDoubleField = function() * @private {!Array} * @const */ -proto.jspb.test.BooleanFields.repeatedFields_ = [3]; +BooleanFields.repeatedFields_ = [3]; @@ -5126,8 +5079,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.jspb.test.BooleanFields.prototype.toObject = function(opt_includeInstance) { - return proto.jspb.test.BooleanFields.toObject(opt_includeInstance, this); +BooleanFields.prototype.toObject = function(opt_includeInstance) { + return BooleanFields.toObject(opt_includeInstance, this); }; @@ -5140,7 +5093,7 @@ proto.jspb.test.BooleanFields.prototype.toObject = function(opt_includeInstance) * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.BooleanFields.toObject = function(includeInstance, msg) { +BooleanFields.toObject = function(includeInstance, msg) { var f, obj = { optionalBooleanField: (f = jspb.Message.getBooleanField(msg, 1)) == null ? undefined : f, requiredBooleanField: (f = jspb.Message.getBooleanField(msg, 2)) == null ? undefined : f, @@ -5161,10 +5114,10 @@ defaultBooleanField: jspb.Message.getBooleanFieldWithDefault(msg, 4, true) * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.jspb.test.BooleanFields} */ -proto.jspb.test.BooleanFields.deserializeBinary = function(bytes) { +BooleanFields.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.jspb.test.BooleanFields; - return proto.jspb.test.BooleanFields.deserializeBinaryFromReader(msg, reader); + var msg = new BooleanFields; + return BooleanFields.deserializeBinaryFromReader(msg, reader); }; @@ -5175,7 +5128,7 @@ proto.jspb.test.BooleanFields.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.jspb.test.BooleanFields} */ -proto.jspb.test.BooleanFields.deserializeBinaryFromReader = function(msg, reader) { +BooleanFields.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -5213,9 +5166,9 @@ proto.jspb.test.BooleanFields.deserializeBinaryFromReader = function(msg, reader * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.jspb.test.BooleanFields.prototype.serializeBinary = function() { +BooleanFields.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.jspb.test.BooleanFields.serializeBinaryToWriter(this, writer); + BooleanFields.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -5227,7 +5180,7 @@ proto.jspb.test.BooleanFields.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.BooleanFields.serializeBinaryToWriter = function(message, writer) { +BooleanFields.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = /** @type {boolean} */ (jspb.Message.getField(message, 1)); if (f != null) { @@ -5264,7 +5217,7 @@ proto.jspb.test.BooleanFields.serializeBinaryToWriter = function(message, writer * optional bool optional_boolean_field = 1; * @return {boolean} */ -proto.jspb.test.BooleanFields.prototype.getOptionalBooleanField = function() { +BooleanFields.prototype.getOptionalBooleanField = function() { return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false)); }; @@ -5273,7 +5226,7 @@ proto.jspb.test.BooleanFields.prototype.getOptionalBooleanField = function() { * @param {boolean} value * @return {!proto.jspb.test.BooleanFields} returns this */ -proto.jspb.test.BooleanFields.prototype.setOptionalBooleanField = function(value) { +BooleanFields.prototype.setOptionalBooleanField = function(value) { return jspb.Message.setField(this, 1, value); }; @@ -5282,7 +5235,7 @@ proto.jspb.test.BooleanFields.prototype.setOptionalBooleanField = function(value * Clears the field making it undefined. * @return {!proto.jspb.test.BooleanFields} returns this */ -proto.jspb.test.BooleanFields.prototype.clearOptionalBooleanField = function() { +BooleanFields.prototype.clearOptionalBooleanField = function() { return jspb.Message.setField(this, 1, undefined); }; @@ -5291,7 +5244,7 @@ proto.jspb.test.BooleanFields.prototype.clearOptionalBooleanField = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.BooleanFields.prototype.hasOptionalBooleanField = function() { +BooleanFields.prototype.hasOptionalBooleanField = function() { return jspb.Message.getField(this, 1) != null; }; @@ -5300,7 +5253,7 @@ proto.jspb.test.BooleanFields.prototype.hasOptionalBooleanField = function() { * required bool required_boolean_field = 2; * @return {boolean} */ -proto.jspb.test.BooleanFields.prototype.getRequiredBooleanField = function() { +BooleanFields.prototype.getRequiredBooleanField = function() { return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); }; @@ -5309,7 +5262,7 @@ proto.jspb.test.BooleanFields.prototype.getRequiredBooleanField = function() { * @param {boolean} value * @return {!proto.jspb.test.BooleanFields} returns this */ -proto.jspb.test.BooleanFields.prototype.setRequiredBooleanField = function(value) { +BooleanFields.prototype.setRequiredBooleanField = function(value) { return jspb.Message.setField(this, 2, value); }; @@ -5318,7 +5271,7 @@ proto.jspb.test.BooleanFields.prototype.setRequiredBooleanField = function(value * Clears the field making it undefined. * @return {!proto.jspb.test.BooleanFields} returns this */ -proto.jspb.test.BooleanFields.prototype.clearRequiredBooleanField = function() { +BooleanFields.prototype.clearRequiredBooleanField = function() { return jspb.Message.setField(this, 2, undefined); }; @@ -5327,7 +5280,7 @@ proto.jspb.test.BooleanFields.prototype.clearRequiredBooleanField = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.BooleanFields.prototype.hasRequiredBooleanField = function() { +BooleanFields.prototype.hasRequiredBooleanField = function() { return jspb.Message.getField(this, 2) != null; }; @@ -5336,7 +5289,7 @@ proto.jspb.test.BooleanFields.prototype.hasRequiredBooleanField = function() { * repeated bool repeated_boolean_field = 3; * @return {!Array} */ -proto.jspb.test.BooleanFields.prototype.getRepeatedBooleanFieldList = function() { +BooleanFields.prototype.getRepeatedBooleanFieldList = function() { return /** @type {!Array} */ (jspb.Message.getRepeatedBooleanField(this, 3)); }; @@ -5345,7 +5298,7 @@ proto.jspb.test.BooleanFields.prototype.getRepeatedBooleanFieldList = function() * @param {!Array} value * @return {!proto.jspb.test.BooleanFields} returns this */ -proto.jspb.test.BooleanFields.prototype.setRepeatedBooleanFieldList = function(value) { +BooleanFields.prototype.setRepeatedBooleanFieldList = function(value) { return jspb.Message.setField(this, 3, value || []); }; @@ -5355,7 +5308,7 @@ proto.jspb.test.BooleanFields.prototype.setRepeatedBooleanFieldList = function(v * @param {number=} opt_index * @return {!proto.jspb.test.BooleanFields} returns this */ -proto.jspb.test.BooleanFields.prototype.addRepeatedBooleanField = function(value, opt_index) { +BooleanFields.prototype.addRepeatedBooleanField = function(value, opt_index) { return jspb.Message.addToRepeatedField(this, 3, value, opt_index); }; @@ -5364,7 +5317,7 @@ proto.jspb.test.BooleanFields.prototype.addRepeatedBooleanField = function(value * Clears the list making it empty but non-null. * @return {!proto.jspb.test.BooleanFields} returns this */ -proto.jspb.test.BooleanFields.prototype.clearRepeatedBooleanFieldList = function() { +BooleanFields.prototype.clearRepeatedBooleanFieldList = function() { return this.setRepeatedBooleanFieldList([]); }; @@ -5373,7 +5326,7 @@ proto.jspb.test.BooleanFields.prototype.clearRepeatedBooleanFieldList = function * optional bool default_boolean_field = 4; * @return {boolean} */ -proto.jspb.test.BooleanFields.prototype.getDefaultBooleanField = function() { +BooleanFields.prototype.getDefaultBooleanField = function() { return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, true)); }; @@ -5382,7 +5335,7 @@ proto.jspb.test.BooleanFields.prototype.getDefaultBooleanField = function() { * @param {boolean} value * @return {!proto.jspb.test.BooleanFields} returns this */ -proto.jspb.test.BooleanFields.prototype.setDefaultBooleanField = function(value) { +BooleanFields.prototype.setDefaultBooleanField = function(value) { return jspb.Message.setField(this, 4, value); }; @@ -5391,7 +5344,7 @@ proto.jspb.test.BooleanFields.prototype.setDefaultBooleanField = function(value) * Clears the field making it undefined. * @return {!proto.jspb.test.BooleanFields} returns this */ -proto.jspb.test.BooleanFields.prototype.clearDefaultBooleanField = function() { +BooleanFields.prototype.clearDefaultBooleanField = function() { return jspb.Message.setField(this, 4, undefined); }; @@ -5400,7 +5353,7 @@ proto.jspb.test.BooleanFields.prototype.clearDefaultBooleanField = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.BooleanFields.prototype.hasDefaultBooleanField = function() { +BooleanFields.prototype.hasDefaultBooleanField = function() { return jspb.Message.getField(this, 4) != null; }; @@ -5411,7 +5364,7 @@ proto.jspb.test.BooleanFields.prototype.hasDefaultBooleanField = function() { * @private {!Array} * @const */ -proto.jspb.test.TestClone.repeatedFields_ = [5]; +TestClone.repeatedFields_ = [5]; @@ -5428,8 +5381,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.jspb.test.TestClone.prototype.toObject = function(opt_includeInstance) { - return proto.jspb.test.TestClone.toObject(opt_includeInstance, this); +TestClone.prototype.toObject = function(opt_includeInstance) { + return TestClone.toObject(opt_includeInstance, this); }; @@ -5442,18 +5395,18 @@ proto.jspb.test.TestClone.prototype.toObject = function(opt_includeInstance) { * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.TestClone.toObject = function(includeInstance, msg) { +TestClone.toObject = function(includeInstance, msg) { var f, obj = { str: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, -simple1: (f = msg.getSimple1()) && proto.jspb.test.Simple1.toObject(includeInstance, f), +simple1: (f = msg.getSimple1()) && Simple1.toObject(includeInstance, f), simple2List: jspb.Message.toObjectList(msg.getSimple2List(), - proto.jspb.test.Simple1.toObject, includeInstance), + Simple1.toObject, includeInstance), bytesField: msg.getBytesField_asB64(), unused: (f = jspb.Message.getField(msg, 7)) == null ? undefined : f }; jspb.Message.toObjectExtension(/** @type {!jspb.Message} */ (msg), obj, - proto.jspb.test.TestClone.extensions, proto.jspb.test.TestClone.prototype.getExtension, + TestClone.extensions, TestClone.prototype.getExtension, includeInstance); if (includeInstance) { obj.$jspbMessageInstance = msg; @@ -5468,10 +5421,10 @@ unused: (f = jspb.Message.getField(msg, 7)) == null ? undefined : f * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.jspb.test.TestClone} */ -proto.jspb.test.TestClone.deserializeBinary = function(bytes) { +TestClone.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.jspb.test.TestClone; - return proto.jspb.test.TestClone.deserializeBinaryFromReader(msg, reader); + var msg = new TestClone; + return TestClone.deserializeBinaryFromReader(msg, reader); }; @@ -5482,7 +5435,7 @@ proto.jspb.test.TestClone.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.jspb.test.TestClone} */ -proto.jspb.test.TestClone.deserializeBinaryFromReader = function(msg, reader) { +TestClone.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -5494,13 +5447,13 @@ proto.jspb.test.TestClone.deserializeBinaryFromReader = function(msg, reader) { msg.setStr(value); break; case 3: - var value = new proto.jspb.test.Simple1; - reader.readMessage(value,proto.jspb.test.Simple1.deserializeBinaryFromReader); + var value = new Simple1; + reader.readMessage(value,Simple1.deserializeBinaryFromReader); msg.setSimple1(value); break; case 5: - var value = new proto.jspb.test.Simple1; - reader.readMessage(value,proto.jspb.test.Simple1.deserializeBinaryFromReader); + var value = new Simple1; + reader.readMessage(value,Simple1.deserializeBinaryFromReader); msg.addSimple2(value); break; case 6: @@ -5513,9 +5466,9 @@ proto.jspb.test.TestClone.deserializeBinaryFromReader = function(msg, reader) { break; default: jspb.Message.readBinaryExtension(msg, reader, - proto.jspb.test.TestClone.extensionsBinary, - proto.jspb.test.TestClone.prototype.getExtension, - proto.jspb.test.TestClone.prototype.setExtension); + TestClone.extensionsBinary, + TestClone.prototype.getExtension, + TestClone.prototype.setExtension); break; } } @@ -5527,9 +5480,9 @@ proto.jspb.test.TestClone.deserializeBinaryFromReader = function(msg, reader) { * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.jspb.test.TestClone.prototype.serializeBinary = function() { +TestClone.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.jspb.test.TestClone.serializeBinaryToWriter(this, writer); + TestClone.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -5541,7 +5494,7 @@ proto.jspb.test.TestClone.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.TestClone.serializeBinaryToWriter = function(message, writer) { +TestClone.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = /** @type {string} */ (jspb.Message.getField(message, 1)); if (f != null) { @@ -5555,7 +5508,7 @@ proto.jspb.test.TestClone.serializeBinaryToWriter = function(message, writer) { writer.writeMessage( 3, f, - proto.jspb.test.Simple1.serializeBinaryToWriter + Simple1.serializeBinaryToWriter ); } f = message.getSimple2List(); @@ -5563,7 +5516,7 @@ proto.jspb.test.TestClone.serializeBinaryToWriter = function(message, writer) { writer.writeRepeatedMessage( 5, f, - proto.jspb.test.Simple1.serializeBinaryToWriter + Simple1.serializeBinaryToWriter ); } f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 6)); @@ -5581,7 +5534,7 @@ proto.jspb.test.TestClone.serializeBinaryToWriter = function(message, writer) { ); } jspb.Message.serializeBinaryExtensions(message, writer, - proto.jspb.test.TestClone.extensionsBinary, proto.jspb.test.TestClone.prototype.getExtension); + TestClone.extensionsBinary, TestClone.prototype.getExtension); }; @@ -5589,7 +5542,7 @@ proto.jspb.test.TestClone.serializeBinaryToWriter = function(message, writer) { * optional string str = 1; * @return {string} */ -proto.jspb.test.TestClone.prototype.getStr = function() { +TestClone.prototype.getStr = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; @@ -5598,7 +5551,7 @@ proto.jspb.test.TestClone.prototype.getStr = function() { * @param {string} value * @return {!proto.jspb.test.TestClone} returns this */ -proto.jspb.test.TestClone.prototype.setStr = function(value) { +TestClone.prototype.setStr = function(value) { return jspb.Message.setField(this, 1, value); }; @@ -5607,7 +5560,7 @@ proto.jspb.test.TestClone.prototype.setStr = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.TestClone} returns this */ -proto.jspb.test.TestClone.prototype.clearStr = function() { +TestClone.prototype.clearStr = function() { return jspb.Message.setField(this, 1, undefined); }; @@ -5616,7 +5569,7 @@ proto.jspb.test.TestClone.prototype.clearStr = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.TestClone.prototype.hasStr = function() { +TestClone.prototype.hasStr = function() { return jspb.Message.getField(this, 1) != null; }; @@ -5625,9 +5578,9 @@ proto.jspb.test.TestClone.prototype.hasStr = function() { * optional Simple1 simple1 = 3; * @return {?proto.jspb.test.Simple1} */ -proto.jspb.test.TestClone.prototype.getSimple1 = function() { +TestClone.prototype.getSimple1 = function() { return /** @type{?proto.jspb.test.Simple1} */ ( - jspb.Message.getWrapperField(this, proto.jspb.test.Simple1, 3)); + jspb.Message.getWrapperField(this, Simple1, 3)); }; @@ -5635,7 +5588,7 @@ proto.jspb.test.TestClone.prototype.getSimple1 = function() { * @param {?proto.jspb.test.Simple1|undefined} value * @return {!proto.jspb.test.TestClone} returns this */ -proto.jspb.test.TestClone.prototype.setSimple1 = function(value) { +TestClone.prototype.setSimple1 = function(value) { return jspb.Message.setWrapperField(this, 3, value); }; @@ -5644,7 +5597,7 @@ proto.jspb.test.TestClone.prototype.setSimple1 = function(value) { * Clears the message field making it undefined. * @return {!proto.jspb.test.TestClone} returns this */ -proto.jspb.test.TestClone.prototype.clearSimple1 = function() { +TestClone.prototype.clearSimple1 = function() { return this.setSimple1(undefined); }; @@ -5653,7 +5606,7 @@ proto.jspb.test.TestClone.prototype.clearSimple1 = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.TestClone.prototype.hasSimple1 = function() { +TestClone.prototype.hasSimple1 = function() { return jspb.Message.getField(this, 3) != null; }; @@ -5662,9 +5615,9 @@ proto.jspb.test.TestClone.prototype.hasSimple1 = function() { * repeated Simple1 simple2 = 5; * @return {!Array} */ -proto.jspb.test.TestClone.prototype.getSimple2List = function() { +TestClone.prototype.getSimple2List = function() { return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.jspb.test.Simple1, 5)); + jspb.Message.getRepeatedWrapperField(this, Simple1, 5)); }; @@ -5672,7 +5625,7 @@ proto.jspb.test.TestClone.prototype.getSimple2List = function() { * @param {!Array} value * @return {!proto.jspb.test.TestClone} returns this */ -proto.jspb.test.TestClone.prototype.setSimple2List = function(value) { +TestClone.prototype.setSimple2List = function(value) { return jspb.Message.setRepeatedWrapperField(this, 5, value); }; @@ -5682,8 +5635,8 @@ proto.jspb.test.TestClone.prototype.setSimple2List = function(value) { * @param {number=} opt_index * @return {!proto.jspb.test.Simple1} */ -proto.jspb.test.TestClone.prototype.addSimple2 = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, proto.jspb.test.Simple1, opt_index); +TestClone.prototype.addSimple2 = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, Simple1, opt_index); }; @@ -5691,7 +5644,7 @@ proto.jspb.test.TestClone.prototype.addSimple2 = function(opt_value, opt_index) * Clears the list making it empty but non-null. * @return {!proto.jspb.test.TestClone} returns this */ -proto.jspb.test.TestClone.prototype.clearSimple2List = function() { +TestClone.prototype.clearSimple2List = function() { return this.setSimple2List([]); }; @@ -5700,7 +5653,7 @@ proto.jspb.test.TestClone.prototype.clearSimple2List = function() { * optional bytes bytes_field = 6; * @return {!(string|Uint8Array)} */ -proto.jspb.test.TestClone.prototype.getBytesField = function() { +TestClone.prototype.getBytesField = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 6, "")); }; @@ -5710,7 +5663,7 @@ proto.jspb.test.TestClone.prototype.getBytesField = function() { * This is a type-conversion wrapper around `getBytesField()` * @return {string} */ -proto.jspb.test.TestClone.prototype.getBytesField_asB64 = function() { +TestClone.prototype.getBytesField_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getBytesField())); }; @@ -5723,7 +5676,7 @@ proto.jspb.test.TestClone.prototype.getBytesField_asB64 = function() { * This is a type-conversion wrapper around `getBytesField()` * @return {!Uint8Array} */ -proto.jspb.test.TestClone.prototype.getBytesField_asU8 = function() { +TestClone.prototype.getBytesField_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getBytesField())); }; @@ -5733,7 +5686,7 @@ proto.jspb.test.TestClone.prototype.getBytesField_asU8 = function() { * @param {!(string|Uint8Array)} value * @return {!proto.jspb.test.TestClone} returns this */ -proto.jspb.test.TestClone.prototype.setBytesField = function(value) { +TestClone.prototype.setBytesField = function(value) { return jspb.Message.setField(this, 6, value); }; @@ -5742,7 +5695,7 @@ proto.jspb.test.TestClone.prototype.setBytesField = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.TestClone} returns this */ -proto.jspb.test.TestClone.prototype.clearBytesField = function() { +TestClone.prototype.clearBytesField = function() { return jspb.Message.setField(this, 6, undefined); }; @@ -5751,7 +5704,7 @@ proto.jspb.test.TestClone.prototype.clearBytesField = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.TestClone.prototype.hasBytesField = function() { +TestClone.prototype.hasBytesField = function() { return jspb.Message.getField(this, 6) != null; }; @@ -5760,7 +5713,7 @@ proto.jspb.test.TestClone.prototype.hasBytesField = function() { * optional string unused = 7; * @return {string} */ -proto.jspb.test.TestClone.prototype.getUnused = function() { +TestClone.prototype.getUnused = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); }; @@ -5769,7 +5722,7 @@ proto.jspb.test.TestClone.prototype.getUnused = function() { * @param {string} value * @return {!proto.jspb.test.TestClone} returns this */ -proto.jspb.test.TestClone.prototype.setUnused = function(value) { +TestClone.prototype.setUnused = function(value) { return jspb.Message.setField(this, 7, value); }; @@ -5778,7 +5731,7 @@ proto.jspb.test.TestClone.prototype.setUnused = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.TestClone} returns this */ -proto.jspb.test.TestClone.prototype.clearUnused = function() { +TestClone.prototype.clearUnused = function() { return jspb.Message.setField(this, 7, undefined); }; @@ -5787,7 +5740,7 @@ proto.jspb.test.TestClone.prototype.clearUnused = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.TestClone.prototype.hasUnused = function() { +TestClone.prototype.hasUnused = function() { return jspb.Message.getField(this, 7) != null; }; @@ -5808,8 +5761,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.jspb.test.TestCloneExtension.prototype.toObject = function(opt_includeInstance) { - return proto.jspb.test.TestCloneExtension.toObject(opt_includeInstance, this); +TestCloneExtension.prototype.toObject = function(opt_includeInstance) { + return TestCloneExtension.toObject(opt_includeInstance, this); }; @@ -5822,7 +5775,7 @@ proto.jspb.test.TestCloneExtension.prototype.toObject = function(opt_includeInst * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.TestCloneExtension.toObject = function(includeInstance, msg) { +TestCloneExtension.toObject = function(includeInstance, msg) { var f, obj = { f: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f }; @@ -5840,10 +5793,10 @@ f: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.jspb.test.TestCloneExtension} */ -proto.jspb.test.TestCloneExtension.deserializeBinary = function(bytes) { +TestCloneExtension.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.jspb.test.TestCloneExtension; - return proto.jspb.test.TestCloneExtension.deserializeBinaryFromReader(msg, reader); + var msg = new TestCloneExtension; + return TestCloneExtension.deserializeBinaryFromReader(msg, reader); }; @@ -5854,7 +5807,7 @@ proto.jspb.test.TestCloneExtension.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.jspb.test.TestCloneExtension} */ -proto.jspb.test.TestCloneExtension.deserializeBinaryFromReader = function(msg, reader) { +TestCloneExtension.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -5878,9 +5831,9 @@ proto.jspb.test.TestCloneExtension.deserializeBinaryFromReader = function(msg, r * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.jspb.test.TestCloneExtension.prototype.serializeBinary = function() { +TestCloneExtension.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.jspb.test.TestCloneExtension.serializeBinaryToWriter(this, writer); + TestCloneExtension.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -5892,7 +5845,7 @@ proto.jspb.test.TestCloneExtension.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.TestCloneExtension.serializeBinaryToWriter = function(message, writer) { +TestCloneExtension.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = /** @type {number} */ (jspb.Message.getField(message, 1)); if (f != null) { @@ -5910,30 +5863,30 @@ proto.jspb.test.TestCloneExtension.serializeBinaryToWriter = function(message, w * field named `lowExt`. * @type {!jspb.ExtensionFieldInfo} */ -proto.jspb.test.TestCloneExtension.lowExt = new jspb.ExtensionFieldInfo( +TestCloneExtension.lowExt = new jspb.ExtensionFieldInfo( 11, {lowExt: 0}, - proto.jspb.test.TestCloneExtension, + TestCloneExtension, /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( - proto.jspb.test.TestCloneExtension.toObject), + TestCloneExtension.toObject), 0); -proto.jspb.test.TestClone.extensionsBinary[11] = new jspb.ExtensionFieldBinaryInfo( - proto.jspb.test.TestCloneExtension.lowExt, +TestClone.extensionsBinary[11] = new jspb.ExtensionFieldBinaryInfo( + TestCloneExtension.lowExt, jspb.BinaryReader.prototype.readMessage, jspb.BinaryWriter.prototype.writeMessage, - proto.jspb.test.TestCloneExtension.serializeBinaryToWriter, - proto.jspb.test.TestCloneExtension.deserializeBinaryFromReader, + TestCloneExtension.serializeBinaryToWriter, + TestCloneExtension.deserializeBinaryFromReader, false); // This registers the extension field with the extended class, so that // toObject() will function correctly. -proto.jspb.test.TestClone.extensions[11] = proto.jspb.test.TestCloneExtension.lowExt; +TestClone.extensions[11] = TestCloneExtension.lowExt; /** * optional int32 f = 1; * @return {number} */ -proto.jspb.test.TestCloneExtension.prototype.getF = function() { +TestCloneExtension.prototype.getF = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; @@ -5942,7 +5895,7 @@ proto.jspb.test.TestCloneExtension.prototype.getF = function() { * @param {number} value * @return {!proto.jspb.test.TestCloneExtension} returns this */ -proto.jspb.test.TestCloneExtension.prototype.setF = function(value) { +TestCloneExtension.prototype.setF = function(value) { return jspb.Message.setField(this, 1, value); }; @@ -5951,7 +5904,7 @@ proto.jspb.test.TestCloneExtension.prototype.setF = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.TestCloneExtension} returns this */ -proto.jspb.test.TestCloneExtension.prototype.clearF = function() { +TestCloneExtension.prototype.clearF = function() { return jspb.Message.setField(this, 1, undefined); }; @@ -5960,7 +5913,7 @@ proto.jspb.test.TestCloneExtension.prototype.clearF = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.TestCloneExtension.prototype.hasF = function() { +TestCloneExtension.prototype.hasF = function() { return jspb.Message.getField(this, 1) != null; }; @@ -5971,24 +5924,24 @@ proto.jspb.test.TestCloneExtension.prototype.hasF = function() { * field named `lowExt`. * @type {!jspb.ExtensionFieldInfo} */ -proto.jspb.test.TestCloneExtension.lowExt = new jspb.ExtensionFieldInfo( +TestCloneExtension.lowExt = new jspb.ExtensionFieldInfo( 11, {lowExt: 0}, - proto.jspb.test.TestCloneExtension, + TestCloneExtension, /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( - proto.jspb.test.TestCloneExtension.toObject), + TestCloneExtension.toObject), 0); -proto.jspb.test.TestClone.extensionsBinary[11] = new jspb.ExtensionFieldBinaryInfo( - proto.jspb.test.TestCloneExtension.lowExt, +TestClone.extensionsBinary[11] = new jspb.ExtensionFieldBinaryInfo( + TestCloneExtension.lowExt, jspb.BinaryReader.prototype.readMessage, jspb.BinaryWriter.prototype.writeMessage, - proto.jspb.test.TestCloneExtension.serializeBinaryToWriter, - proto.jspb.test.TestCloneExtension.deserializeBinaryFromReader, + TestCloneExtension.serializeBinaryToWriter, + TestCloneExtension.deserializeBinaryFromReader, false); // This registers the extension field with the extended class, so that // toObject() will function correctly. -proto.jspb.test.TestClone.extensions[11] = proto.jspb.test.TestCloneExtension.lowExt; +TestClone.extensions[11] = TestCloneExtension.lowExt; @@ -6006,8 +5959,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.jspb.test.CloneExtension.prototype.toObject = function(opt_includeInstance) { - return proto.jspb.test.CloneExtension.toObject(opt_includeInstance, this); +CloneExtension.prototype.toObject = function(opt_includeInstance) { + return CloneExtension.toObject(opt_includeInstance, this); }; @@ -6020,7 +5973,7 @@ proto.jspb.test.CloneExtension.prototype.toObject = function(opt_includeInstance * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.CloneExtension.toObject = function(includeInstance, msg) { +CloneExtension.toObject = function(includeInstance, msg) { var f, obj = { ext: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f }; @@ -6038,10 +5991,10 @@ ext: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.jspb.test.CloneExtension} */ -proto.jspb.test.CloneExtension.deserializeBinary = function(bytes) { +CloneExtension.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.jspb.test.CloneExtension; - return proto.jspb.test.CloneExtension.deserializeBinaryFromReader(msg, reader); + var msg = new CloneExtension; + return CloneExtension.deserializeBinaryFromReader(msg, reader); }; @@ -6052,7 +6005,7 @@ proto.jspb.test.CloneExtension.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.jspb.test.CloneExtension} */ -proto.jspb.test.CloneExtension.deserializeBinaryFromReader = function(msg, reader) { +CloneExtension.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -6076,9 +6029,9 @@ proto.jspb.test.CloneExtension.deserializeBinaryFromReader = function(msg, reade * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.jspb.test.CloneExtension.prototype.serializeBinary = function() { +CloneExtension.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.jspb.test.CloneExtension.serializeBinaryToWriter(this, writer); + CloneExtension.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -6090,7 +6043,7 @@ proto.jspb.test.CloneExtension.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.CloneExtension.serializeBinaryToWriter = function(message, writer) { +CloneExtension.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = /** @type {string} */ (jspb.Message.getField(message, 2)); if (f != null) { @@ -6108,30 +6061,30 @@ proto.jspb.test.CloneExtension.serializeBinaryToWriter = function(message, write * field named `extField`. * @type {!jspb.ExtensionFieldInfo} */ -proto.jspb.test.CloneExtension.extField = new jspb.ExtensionFieldInfo( +CloneExtension.extField = new jspb.ExtensionFieldInfo( 100, {extField: 0}, - proto.jspb.test.CloneExtension, + CloneExtension, /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( - proto.jspb.test.CloneExtension.toObject), + CloneExtension.toObject), 0); -proto.jspb.test.TestClone.extensionsBinary[100] = new jspb.ExtensionFieldBinaryInfo( - proto.jspb.test.CloneExtension.extField, +TestClone.extensionsBinary[100] = new jspb.ExtensionFieldBinaryInfo( + CloneExtension.extField, jspb.BinaryReader.prototype.readMessage, jspb.BinaryWriter.prototype.writeMessage, - proto.jspb.test.CloneExtension.serializeBinaryToWriter, - proto.jspb.test.CloneExtension.deserializeBinaryFromReader, + CloneExtension.serializeBinaryToWriter, + CloneExtension.deserializeBinaryFromReader, false); // This registers the extension field with the extended class, so that // toObject() will function correctly. -proto.jspb.test.TestClone.extensions[100] = proto.jspb.test.CloneExtension.extField; +TestClone.extensions[100] = CloneExtension.extField; /** * optional string ext = 2; * @return {string} */ -proto.jspb.test.CloneExtension.prototype.getExt = function() { +CloneExtension.prototype.getExt = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; @@ -6140,7 +6093,7 @@ proto.jspb.test.CloneExtension.prototype.getExt = function() { * @param {string} value * @return {!proto.jspb.test.CloneExtension} returns this */ -proto.jspb.test.CloneExtension.prototype.setExt = function(value) { +CloneExtension.prototype.setExt = function(value) { return jspb.Message.setField(this, 2, value); }; @@ -6149,7 +6102,7 @@ proto.jspb.test.CloneExtension.prototype.setExt = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.CloneExtension} returns this */ -proto.jspb.test.CloneExtension.prototype.clearExt = function() { +CloneExtension.prototype.clearExt = function() { return jspb.Message.setField(this, 2, undefined); }; @@ -6158,7 +6111,7 @@ proto.jspb.test.CloneExtension.prototype.clearExt = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.CloneExtension.prototype.hasExt = function() { +CloneExtension.prototype.hasExt = function() { return jspb.Message.getField(this, 2) != null; }; @@ -6169,24 +6122,24 @@ proto.jspb.test.CloneExtension.prototype.hasExt = function() { * field named `extField`. * @type {!jspb.ExtensionFieldInfo} */ -proto.jspb.test.CloneExtension.extField = new jspb.ExtensionFieldInfo( +CloneExtension.extField = new jspb.ExtensionFieldInfo( 100, {extField: 0}, - proto.jspb.test.CloneExtension, + CloneExtension, /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( - proto.jspb.test.CloneExtension.toObject), + CloneExtension.toObject), 0); -proto.jspb.test.TestClone.extensionsBinary[100] = new jspb.ExtensionFieldBinaryInfo( - proto.jspb.test.CloneExtension.extField, +TestClone.extensionsBinary[100] = new jspb.ExtensionFieldBinaryInfo( + CloneExtension.extField, jspb.BinaryReader.prototype.readMessage, jspb.BinaryWriter.prototype.writeMessage, - proto.jspb.test.CloneExtension.serializeBinaryToWriter, - proto.jspb.test.CloneExtension.deserializeBinaryFromReader, + CloneExtension.serializeBinaryToWriter, + CloneExtension.deserializeBinaryFromReader, false); // This registers the extension field with the extended class, so that // toObject() will function correctly. -proto.jspb.test.TestClone.extensions[100] = proto.jspb.test.CloneExtension.extField; +TestClone.extensions[100] = CloneExtension.extField; /** @@ -6194,7 +6147,7 @@ proto.jspb.test.TestClone.extensions[100] = proto.jspb.test.CloneExtension.extFi * @private {!Array} * @const */ -proto.jspb.test.TestGroup.repeatedFields_ = [1]; +TestGroup.repeatedFields_ = [1]; @@ -6211,8 +6164,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.jspb.test.TestGroup.prototype.toObject = function(opt_includeInstance) { - return proto.jspb.test.TestGroup.toObject(opt_includeInstance, this); +TestGroup.prototype.toObject = function(opt_includeInstance) { + return TestGroup.toObject(opt_includeInstance, this); }; @@ -6225,15 +6178,15 @@ proto.jspb.test.TestGroup.prototype.toObject = function(opt_includeInstance) { * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.TestGroup.toObject = function(includeInstance, msg) { +TestGroup.toObject = function(includeInstance, msg) { var f, obj = { repeatedGroupList: jspb.Message.toObjectList(msg.getRepeatedGroupList(), - proto.jspb.test.TestGroup.RepeatedGroup.toObject, includeInstance), -requiredGroup: (f = msg.getRequiredGroup()) && proto.jspb.test.TestGroup.RequiredGroup.toObject(includeInstance, f), -optionalGroup: (f = msg.getOptionalGroup()) && proto.jspb.test.TestGroup.OptionalGroup.toObject(includeInstance, f), + TestGroup.RepeatedGroup.toObject, includeInstance), +requiredGroup: (f = msg.getRequiredGroup()) && TestGroup.RequiredGroup.toObject(includeInstance, f), +optionalGroup: (f = msg.getOptionalGroup()) && TestGroup.OptionalGroup.toObject(includeInstance, f), id: (f = jspb.Message.getField(msg, 4)) == null ? undefined : f, -requiredSimple: (f = msg.getRequiredSimple()) && proto.jspb.test.Simple2.toObject(includeInstance, f), -optionalSimple: (f = msg.getOptionalSimple()) && proto.jspb.test.Simple2.toObject(includeInstance, f) +requiredSimple: (f = msg.getRequiredSimple()) && Simple2.toObject(includeInstance, f), +optionalSimple: (f = msg.getOptionalSimple()) && Simple2.toObject(includeInstance, f) }; if (includeInstance) { @@ -6249,10 +6202,10 @@ optionalSimple: (f = msg.getOptionalSimple()) && proto.jspb.test.Simple2.toObjec * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.jspb.test.TestGroup} */ -proto.jspb.test.TestGroup.deserializeBinary = function(bytes) { +TestGroup.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.jspb.test.TestGroup; - return proto.jspb.test.TestGroup.deserializeBinaryFromReader(msg, reader); + var msg = new TestGroup; + return TestGroup.deserializeBinaryFromReader(msg, reader); }; @@ -6263,7 +6216,7 @@ proto.jspb.test.TestGroup.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.jspb.test.TestGroup} */ -proto.jspb.test.TestGroup.deserializeBinaryFromReader = function(msg, reader) { +TestGroup.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -6271,18 +6224,18 @@ proto.jspb.test.TestGroup.deserializeBinaryFromReader = function(msg, reader) { var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.jspb.test.TestGroup.RepeatedGroup; - reader.readGroup(1, value,proto.jspb.test.TestGroup.RepeatedGroup.deserializeBinaryFromReader); + var value = new TestGroup.RepeatedGroup; + reader.readGroup(1, value,TestGroup.RepeatedGroup.deserializeBinaryFromReader); msg.addRepeatedGroup(value); break; case 2: - var value = new proto.jspb.test.TestGroup.RequiredGroup; - reader.readGroup(2, value,proto.jspb.test.TestGroup.RequiredGroup.deserializeBinaryFromReader); + var value = new TestGroup.RequiredGroup; + reader.readGroup(2, value,TestGroup.RequiredGroup.deserializeBinaryFromReader); msg.setRequiredGroup(value); break; case 3: - var value = new proto.jspb.test.TestGroup.OptionalGroup; - reader.readGroup(3, value,proto.jspb.test.TestGroup.OptionalGroup.deserializeBinaryFromReader); + var value = new TestGroup.OptionalGroup; + reader.readGroup(3, value,TestGroup.OptionalGroup.deserializeBinaryFromReader); msg.setOptionalGroup(value); break; case 4: @@ -6290,13 +6243,13 @@ proto.jspb.test.TestGroup.deserializeBinaryFromReader = function(msg, reader) { msg.setId(value); break; case 5: - var value = new proto.jspb.test.Simple2; - reader.readMessage(value,proto.jspb.test.Simple2.deserializeBinaryFromReader); + var value = new Simple2; + reader.readMessage(value,Simple2.deserializeBinaryFromReader); msg.setRequiredSimple(value); break; case 6: - var value = new proto.jspb.test.Simple2; - reader.readMessage(value,proto.jspb.test.Simple2.deserializeBinaryFromReader); + var value = new Simple2; + reader.readMessage(value,Simple2.deserializeBinaryFromReader); msg.setOptionalSimple(value); break; default: @@ -6312,9 +6265,9 @@ proto.jspb.test.TestGroup.deserializeBinaryFromReader = function(msg, reader) { * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.jspb.test.TestGroup.prototype.serializeBinary = function() { +TestGroup.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.jspb.test.TestGroup.serializeBinaryToWriter(this, writer); + TestGroup.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -6326,14 +6279,14 @@ proto.jspb.test.TestGroup.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.TestGroup.serializeBinaryToWriter = function(message, writer) { +TestGroup.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getRepeatedGroupList(); if (f.length > 0) { writer.writeRepeatedGroup( 1, f, - proto.jspb.test.TestGroup.RepeatedGroup.serializeBinaryToWriter + TestGroup.RepeatedGroup.serializeBinaryToWriter ); } f = message.getRequiredGroup(); @@ -6341,7 +6294,7 @@ proto.jspb.test.TestGroup.serializeBinaryToWriter = function(message, writer) { writer.writeGroup( 2, f, - proto.jspb.test.TestGroup.RequiredGroup.serializeBinaryToWriter + TestGroup.RequiredGroup.serializeBinaryToWriter ); } f = message.getOptionalGroup(); @@ -6349,7 +6302,7 @@ proto.jspb.test.TestGroup.serializeBinaryToWriter = function(message, writer) { writer.writeGroup( 3, f, - proto.jspb.test.TestGroup.OptionalGroup.serializeBinaryToWriter + TestGroup.OptionalGroup.serializeBinaryToWriter ); } f = /** @type {string} */ (jspb.Message.getField(message, 4)); @@ -6364,7 +6317,7 @@ proto.jspb.test.TestGroup.serializeBinaryToWriter = function(message, writer) { writer.writeMessage( 5, f, - proto.jspb.test.Simple2.serializeBinaryToWriter + Simple2.serializeBinaryToWriter ); } f = message.getOptionalSimple(); @@ -6372,7 +6325,7 @@ proto.jspb.test.TestGroup.serializeBinaryToWriter = function(message, writer) { writer.writeMessage( 6, f, - proto.jspb.test.Simple2.serializeBinaryToWriter + Simple2.serializeBinaryToWriter ); } }; @@ -6384,7 +6337,7 @@ proto.jspb.test.TestGroup.serializeBinaryToWriter = function(message, writer) { * @private {!Array} * @const */ -proto.jspb.test.TestGroup.RepeatedGroup.repeatedFields_ = [1]; +TestGroup.RepeatedGroup.repeatedFields_ = [1]; @@ -6401,8 +6354,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.jspb.test.TestGroup.RepeatedGroup.prototype.toObject = function(opt_includeInstance) { - return proto.jspb.test.TestGroup.RepeatedGroup.toObject(opt_includeInstance, this); +TestGroup.RepeatedGroup.prototype.toObject = function(opt_includeInstance) { + return TestGroup.RepeatedGroup.toObject(opt_includeInstance, this); }; @@ -6415,7 +6368,7 @@ proto.jspb.test.TestGroup.RepeatedGroup.prototype.toObject = function(opt_includ * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.TestGroup.RepeatedGroup.toObject = function(includeInstance, msg) { +TestGroup.RepeatedGroup.toObject = function(includeInstance, msg) { var f, obj = { id: (f = jspb.Message.getField(msg, 0)) == null ? undefined : f, someBoolList: (f = jspb.Message.getRepeatedBooleanField(msg, 1)) == null ? undefined : f @@ -6434,10 +6387,10 @@ someBoolList: (f = jspb.Message.getRepeatedBooleanField(msg, 1)) == null ? undef * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.jspb.test.TestGroup.RepeatedGroup} */ -proto.jspb.test.TestGroup.RepeatedGroup.deserializeBinary = function(bytes) { +TestGroup.RepeatedGroup.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.jspb.test.TestGroup.RepeatedGroup; - return proto.jspb.test.TestGroup.RepeatedGroup.deserializeBinaryFromReader(msg, reader); + var msg = new TestGroup.RepeatedGroup; + return TestGroup.RepeatedGroup.deserializeBinaryFromReader(msg, reader); }; @@ -6448,7 +6401,7 @@ proto.jspb.test.TestGroup.RepeatedGroup.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.jspb.test.TestGroup.RepeatedGroup} */ -proto.jspb.test.TestGroup.RepeatedGroup.deserializeBinaryFromReader = function(msg, reader) { +TestGroup.RepeatedGroup.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -6478,9 +6431,9 @@ proto.jspb.test.TestGroup.RepeatedGroup.deserializeBinaryFromReader = function(m * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.jspb.test.TestGroup.RepeatedGroup.prototype.serializeBinary = function() { +TestGroup.RepeatedGroup.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.jspb.test.TestGroup.RepeatedGroup.serializeBinaryToWriter(this, writer); + TestGroup.RepeatedGroup.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -6492,7 +6445,7 @@ proto.jspb.test.TestGroup.RepeatedGroup.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.TestGroup.RepeatedGroup.serializeBinaryToWriter = function(message, writer) { +TestGroup.RepeatedGroup.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = /** @type {string} */ (jspb.Message.getField(message, 0)); if (f != null) { @@ -6515,7 +6468,7 @@ proto.jspb.test.TestGroup.RepeatedGroup.serializeBinaryToWriter = function(messa * required string id = 1; * @return {string} */ -proto.jspb.test.TestGroup.RepeatedGroup.prototype.getId = function() { +TestGroup.RepeatedGroup.prototype.getId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 0, "")); }; @@ -6524,7 +6477,7 @@ proto.jspb.test.TestGroup.RepeatedGroup.prototype.getId = function() { * @param {string} value * @return {!proto.jspb.test.TestGroup.RepeatedGroup} returns this */ -proto.jspb.test.TestGroup.RepeatedGroup.prototype.setId = function(value) { +TestGroup.RepeatedGroup.prototype.setId = function(value) { return jspb.Message.setField(this, 0, value); }; @@ -6533,7 +6486,7 @@ proto.jspb.test.TestGroup.RepeatedGroup.prototype.setId = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.TestGroup.RepeatedGroup} returns this */ -proto.jspb.test.TestGroup.RepeatedGroup.prototype.clearId = function() { +TestGroup.RepeatedGroup.prototype.clearId = function() { return jspb.Message.setField(this, 0, undefined); }; @@ -6542,7 +6495,7 @@ proto.jspb.test.TestGroup.RepeatedGroup.prototype.clearId = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.TestGroup.RepeatedGroup.prototype.hasId = function() { +TestGroup.RepeatedGroup.prototype.hasId = function() { return jspb.Message.getField(this, 0) != null; }; @@ -6551,7 +6504,7 @@ proto.jspb.test.TestGroup.RepeatedGroup.prototype.hasId = function() { * repeated bool some_bool = 2; * @return {!Array} */ -proto.jspb.test.TestGroup.RepeatedGroup.prototype.getSomeBoolList = function() { +TestGroup.RepeatedGroup.prototype.getSomeBoolList = function() { return /** @type {!Array} */ (jspb.Message.getRepeatedBooleanField(this, 1)); }; @@ -6560,7 +6513,7 @@ proto.jspb.test.TestGroup.RepeatedGroup.prototype.getSomeBoolList = function() { * @param {!Array} value * @return {!proto.jspb.test.TestGroup.RepeatedGroup} returns this */ -proto.jspb.test.TestGroup.RepeatedGroup.prototype.setSomeBoolList = function(value) { +TestGroup.RepeatedGroup.prototype.setSomeBoolList = function(value) { return jspb.Message.setField(this, 1, value || []); }; @@ -6570,7 +6523,7 @@ proto.jspb.test.TestGroup.RepeatedGroup.prototype.setSomeBoolList = function(val * @param {number=} opt_index * @return {!proto.jspb.test.TestGroup.RepeatedGroup} returns this */ -proto.jspb.test.TestGroup.RepeatedGroup.prototype.addSomeBool = function(value, opt_index) { +TestGroup.RepeatedGroup.prototype.addSomeBool = function(value, opt_index) { return jspb.Message.addToRepeatedField(this, 1, value, opt_index); }; @@ -6579,7 +6532,7 @@ proto.jspb.test.TestGroup.RepeatedGroup.prototype.addSomeBool = function(value, * Clears the list making it empty but non-null. * @return {!proto.jspb.test.TestGroup.RepeatedGroup} returns this */ -proto.jspb.test.TestGroup.RepeatedGroup.prototype.clearSomeBoolList = function() { +TestGroup.RepeatedGroup.prototype.clearSomeBoolList = function() { return this.setSomeBoolList([]); }; @@ -6600,8 +6553,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.jspb.test.TestGroup.RequiredGroup.prototype.toObject = function(opt_includeInstance) { - return proto.jspb.test.TestGroup.RequiredGroup.toObject(opt_includeInstance, this); +TestGroup.RequiredGroup.prototype.toObject = function(opt_includeInstance) { + return TestGroup.RequiredGroup.toObject(opt_includeInstance, this); }; @@ -6614,7 +6567,7 @@ proto.jspb.test.TestGroup.RequiredGroup.prototype.toObject = function(opt_includ * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.TestGroup.RequiredGroup.toObject = function(includeInstance, msg) { +TestGroup.RequiredGroup.toObject = function(includeInstance, msg) { var f, obj = { id: (f = jspb.Message.getField(msg, -1)) == null ? undefined : f }; @@ -6632,10 +6585,10 @@ id: (f = jspb.Message.getField(msg, -1)) == null ? undefined : f * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.jspb.test.TestGroup.RequiredGroup} */ -proto.jspb.test.TestGroup.RequiredGroup.deserializeBinary = function(bytes) { +TestGroup.RequiredGroup.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.jspb.test.TestGroup.RequiredGroup; - return proto.jspb.test.TestGroup.RequiredGroup.deserializeBinaryFromReader(msg, reader); + var msg = new TestGroup.RequiredGroup; + return TestGroup.RequiredGroup.deserializeBinaryFromReader(msg, reader); }; @@ -6646,7 +6599,7 @@ proto.jspb.test.TestGroup.RequiredGroup.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.jspb.test.TestGroup.RequiredGroup} */ -proto.jspb.test.TestGroup.RequiredGroup.deserializeBinaryFromReader = function(msg, reader) { +TestGroup.RequiredGroup.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -6670,9 +6623,9 @@ proto.jspb.test.TestGroup.RequiredGroup.deserializeBinaryFromReader = function(m * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.jspb.test.TestGroup.RequiredGroup.prototype.serializeBinary = function() { +TestGroup.RequiredGroup.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.jspb.test.TestGroup.RequiredGroup.serializeBinaryToWriter(this, writer); + TestGroup.RequiredGroup.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -6684,7 +6637,7 @@ proto.jspb.test.TestGroup.RequiredGroup.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.TestGroup.RequiredGroup.serializeBinaryToWriter = function(message, writer) { +TestGroup.RequiredGroup.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = /** @type {string} */ (jspb.Message.getField(message, -1)); if (f != null) { @@ -6700,7 +6653,7 @@ proto.jspb.test.TestGroup.RequiredGroup.serializeBinaryToWriter = function(messa * required string id = 1; * @return {string} */ -proto.jspb.test.TestGroup.RequiredGroup.prototype.getId = function() { +TestGroup.RequiredGroup.prototype.getId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, -1, "")); }; @@ -6709,7 +6662,7 @@ proto.jspb.test.TestGroup.RequiredGroup.prototype.getId = function() { * @param {string} value * @return {!proto.jspb.test.TestGroup.RequiredGroup} returns this */ -proto.jspb.test.TestGroup.RequiredGroup.prototype.setId = function(value) { +TestGroup.RequiredGroup.prototype.setId = function(value) { return jspb.Message.setField(this, -1, value); }; @@ -6718,7 +6671,7 @@ proto.jspb.test.TestGroup.RequiredGroup.prototype.setId = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.TestGroup.RequiredGroup} returns this */ -proto.jspb.test.TestGroup.RequiredGroup.prototype.clearId = function() { +TestGroup.RequiredGroup.prototype.clearId = function() { return jspb.Message.setField(this, -1, undefined); }; @@ -6727,7 +6680,7 @@ proto.jspb.test.TestGroup.RequiredGroup.prototype.clearId = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.TestGroup.RequiredGroup.prototype.hasId = function() { +TestGroup.RequiredGroup.prototype.hasId = function() { return jspb.Message.getField(this, -1) != null; }; @@ -6748,8 +6701,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.jspb.test.TestGroup.OptionalGroup.prototype.toObject = function(opt_includeInstance) { - return proto.jspb.test.TestGroup.OptionalGroup.toObject(opt_includeInstance, this); +TestGroup.OptionalGroup.prototype.toObject = function(opt_includeInstance) { + return TestGroup.OptionalGroup.toObject(opt_includeInstance, this); }; @@ -6762,7 +6715,7 @@ proto.jspb.test.TestGroup.OptionalGroup.prototype.toObject = function(opt_includ * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.TestGroup.OptionalGroup.toObject = function(includeInstance, msg) { +TestGroup.OptionalGroup.toObject = function(includeInstance, msg) { var f, obj = { id: (f = jspb.Message.getField(msg, -2)) == null ? undefined : f }; @@ -6780,10 +6733,10 @@ id: (f = jspb.Message.getField(msg, -2)) == null ? undefined : f * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.jspb.test.TestGroup.OptionalGroup} */ -proto.jspb.test.TestGroup.OptionalGroup.deserializeBinary = function(bytes) { +TestGroup.OptionalGroup.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.jspb.test.TestGroup.OptionalGroup; - return proto.jspb.test.TestGroup.OptionalGroup.deserializeBinaryFromReader(msg, reader); + var msg = new TestGroup.OptionalGroup; + return TestGroup.OptionalGroup.deserializeBinaryFromReader(msg, reader); }; @@ -6794,7 +6747,7 @@ proto.jspb.test.TestGroup.OptionalGroup.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.jspb.test.TestGroup.OptionalGroup} */ -proto.jspb.test.TestGroup.OptionalGroup.deserializeBinaryFromReader = function(msg, reader) { +TestGroup.OptionalGroup.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -6818,9 +6771,9 @@ proto.jspb.test.TestGroup.OptionalGroup.deserializeBinaryFromReader = function(m * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.jspb.test.TestGroup.OptionalGroup.prototype.serializeBinary = function() { +TestGroup.OptionalGroup.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.jspb.test.TestGroup.OptionalGroup.serializeBinaryToWriter(this, writer); + TestGroup.OptionalGroup.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -6832,7 +6785,7 @@ proto.jspb.test.TestGroup.OptionalGroup.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.TestGroup.OptionalGroup.serializeBinaryToWriter = function(message, writer) { +TestGroup.OptionalGroup.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = /** @type {string} */ (jspb.Message.getField(message, -2)); if (f != null) { @@ -6848,7 +6801,7 @@ proto.jspb.test.TestGroup.OptionalGroup.serializeBinaryToWriter = function(messa * required string id = 1; * @return {string} */ -proto.jspb.test.TestGroup.OptionalGroup.prototype.getId = function() { +TestGroup.OptionalGroup.prototype.getId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, -2, "")); }; @@ -6857,7 +6810,7 @@ proto.jspb.test.TestGroup.OptionalGroup.prototype.getId = function() { * @param {string} value * @return {!proto.jspb.test.TestGroup.OptionalGroup} returns this */ -proto.jspb.test.TestGroup.OptionalGroup.prototype.setId = function(value) { +TestGroup.OptionalGroup.prototype.setId = function(value) { return jspb.Message.setField(this, -2, value); }; @@ -6866,7 +6819,7 @@ proto.jspb.test.TestGroup.OptionalGroup.prototype.setId = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.TestGroup.OptionalGroup} returns this */ -proto.jspb.test.TestGroup.OptionalGroup.prototype.clearId = function() { +TestGroup.OptionalGroup.prototype.clearId = function() { return jspb.Message.setField(this, -2, undefined); }; @@ -6875,7 +6828,7 @@ proto.jspb.test.TestGroup.OptionalGroup.prototype.clearId = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.TestGroup.OptionalGroup.prototype.hasId = function() { +TestGroup.OptionalGroup.prototype.hasId = function() { return jspb.Message.getField(this, -2) != null; }; @@ -6884,9 +6837,9 @@ proto.jspb.test.TestGroup.OptionalGroup.prototype.hasId = function() { * repeated group RepeatedGroup = 1; * @return {!Array} */ -proto.jspb.test.TestGroup.prototype.getRepeatedGroupList = function() { +TestGroup.prototype.getRepeatedGroupList = function() { return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.jspb.test.TestGroup.RepeatedGroup, 1)); + jspb.Message.getRepeatedWrapperField(this, TestGroup.RepeatedGroup, 1)); }; @@ -6894,7 +6847,7 @@ proto.jspb.test.TestGroup.prototype.getRepeatedGroupList = function() { * @param {!Array} value * @return {!proto.jspb.test.TestGroup} returns this */ -proto.jspb.test.TestGroup.prototype.setRepeatedGroupList = function(value) { +TestGroup.prototype.setRepeatedGroupList = function(value) { return jspb.Message.setRepeatedWrapperField(this, 1, value); }; @@ -6904,8 +6857,8 @@ proto.jspb.test.TestGroup.prototype.setRepeatedGroupList = function(value) { * @param {number=} opt_index * @return {!proto.jspb.test.TestGroup.RepeatedGroup} */ -proto.jspb.test.TestGroup.prototype.addRepeatedGroup = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.jspb.test.TestGroup.RepeatedGroup, opt_index); +TestGroup.prototype.addRepeatedGroup = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, TestGroup.RepeatedGroup, opt_index); }; @@ -6913,7 +6866,7 @@ proto.jspb.test.TestGroup.prototype.addRepeatedGroup = function(opt_value, opt_i * Clears the list making it empty but non-null. * @return {!proto.jspb.test.TestGroup} returns this */ -proto.jspb.test.TestGroup.prototype.clearRepeatedGroupList = function() { +TestGroup.prototype.clearRepeatedGroupList = function() { return this.setRepeatedGroupList([]); }; @@ -6922,9 +6875,9 @@ proto.jspb.test.TestGroup.prototype.clearRepeatedGroupList = function() { * required group RequiredGroup = 2; * @return {!proto.jspb.test.TestGroup.RequiredGroup} */ -proto.jspb.test.TestGroup.prototype.getRequiredGroup = function() { +TestGroup.prototype.getRequiredGroup = function() { return /** @type{!proto.jspb.test.TestGroup.RequiredGroup} */ ( - jspb.Message.getWrapperField(this, proto.jspb.test.TestGroup.RequiredGroup, 2, 1)); + jspb.Message.getWrapperField(this, TestGroup.RequiredGroup, 2, 1)); }; @@ -6932,7 +6885,7 @@ proto.jspb.test.TestGroup.prototype.getRequiredGroup = function() { * @param {!proto.jspb.test.TestGroup.RequiredGroup} value * @return {!proto.jspb.test.TestGroup} returns this */ -proto.jspb.test.TestGroup.prototype.setRequiredGroup = function(value) { +TestGroup.prototype.setRequiredGroup = function(value) { return jspb.Message.setWrapperField(this, 2, value); }; @@ -6941,7 +6894,7 @@ proto.jspb.test.TestGroup.prototype.setRequiredGroup = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.TestGroup} returns this */ -proto.jspb.test.TestGroup.prototype.clearRequiredGroup = function() { +TestGroup.prototype.clearRequiredGroup = function() { return jspb.Message.setField(this, 2, undefined); }; @@ -6950,7 +6903,7 @@ proto.jspb.test.TestGroup.prototype.clearRequiredGroup = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.TestGroup.prototype.hasRequiredGroup = function() { +TestGroup.prototype.hasRequiredGroup = function() { return jspb.Message.getField(this, 2) != null; }; @@ -6959,9 +6912,9 @@ proto.jspb.test.TestGroup.prototype.hasRequiredGroup = function() { * optional group OptionalGroup = 3; * @return {?proto.jspb.test.TestGroup.OptionalGroup} */ -proto.jspb.test.TestGroup.prototype.getOptionalGroup = function() { +TestGroup.prototype.getOptionalGroup = function() { return /** @type{?proto.jspb.test.TestGroup.OptionalGroup} */ ( - jspb.Message.getWrapperField(this, proto.jspb.test.TestGroup.OptionalGroup, 3)); + jspb.Message.getWrapperField(this, TestGroup.OptionalGroup, 3)); }; @@ -6969,7 +6922,7 @@ proto.jspb.test.TestGroup.prototype.getOptionalGroup = function() { * @param {?proto.jspb.test.TestGroup.OptionalGroup|undefined} value * @return {!proto.jspb.test.TestGroup} returns this */ -proto.jspb.test.TestGroup.prototype.setOptionalGroup = function(value) { +TestGroup.prototype.setOptionalGroup = function(value) { return jspb.Message.setWrapperField(this, 3, value); }; @@ -6978,7 +6931,7 @@ proto.jspb.test.TestGroup.prototype.setOptionalGroup = function(value) { * Clears the message field making it undefined. * @return {!proto.jspb.test.TestGroup} returns this */ -proto.jspb.test.TestGroup.prototype.clearOptionalGroup = function() { +TestGroup.prototype.clearOptionalGroup = function() { return this.setOptionalGroup(undefined); }; @@ -6987,7 +6940,7 @@ proto.jspb.test.TestGroup.prototype.clearOptionalGroup = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.TestGroup.prototype.hasOptionalGroup = function() { +TestGroup.prototype.hasOptionalGroup = function() { return jspb.Message.getField(this, 3) != null; }; @@ -6996,7 +6949,7 @@ proto.jspb.test.TestGroup.prototype.hasOptionalGroup = function() { * optional string id = 4; * @return {string} */ -proto.jspb.test.TestGroup.prototype.getId = function() { +TestGroup.prototype.getId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); }; @@ -7005,7 +6958,7 @@ proto.jspb.test.TestGroup.prototype.getId = function() { * @param {string} value * @return {!proto.jspb.test.TestGroup} returns this */ -proto.jspb.test.TestGroup.prototype.setId = function(value) { +TestGroup.prototype.setId = function(value) { return jspb.Message.setField(this, 4, value); }; @@ -7014,7 +6967,7 @@ proto.jspb.test.TestGroup.prototype.setId = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.TestGroup} returns this */ -proto.jspb.test.TestGroup.prototype.clearId = function() { +TestGroup.prototype.clearId = function() { return jspb.Message.setField(this, 4, undefined); }; @@ -7023,7 +6976,7 @@ proto.jspb.test.TestGroup.prototype.clearId = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.TestGroup.prototype.hasId = function() { +TestGroup.prototype.hasId = function() { return jspb.Message.getField(this, 4) != null; }; @@ -7032,9 +6985,9 @@ proto.jspb.test.TestGroup.prototype.hasId = function() { * required Simple2 required_simple = 5; * @return {!proto.jspb.test.Simple2} */ -proto.jspb.test.TestGroup.prototype.getRequiredSimple = function() { +TestGroup.prototype.getRequiredSimple = function() { return /** @type{!proto.jspb.test.Simple2} */ ( - jspb.Message.getWrapperField(this, proto.jspb.test.Simple2, 5, 1)); + jspb.Message.getWrapperField(this, Simple2, 5, 1)); }; @@ -7042,7 +6995,7 @@ proto.jspb.test.TestGroup.prototype.getRequiredSimple = function() { * @param {!proto.jspb.test.Simple2} value * @return {!proto.jspb.test.TestGroup} returns this */ -proto.jspb.test.TestGroup.prototype.setRequiredSimple = function(value) { +TestGroup.prototype.setRequiredSimple = function(value) { return jspb.Message.setWrapperField(this, 5, value); }; @@ -7051,7 +7004,7 @@ proto.jspb.test.TestGroup.prototype.setRequiredSimple = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.TestGroup} returns this */ -proto.jspb.test.TestGroup.prototype.clearRequiredSimple = function() { +TestGroup.prototype.clearRequiredSimple = function() { return jspb.Message.setField(this, 5, undefined); }; @@ -7060,7 +7013,7 @@ proto.jspb.test.TestGroup.prototype.clearRequiredSimple = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.TestGroup.prototype.hasRequiredSimple = function() { +TestGroup.prototype.hasRequiredSimple = function() { return jspb.Message.getField(this, 5) != null; }; @@ -7069,9 +7022,9 @@ proto.jspb.test.TestGroup.prototype.hasRequiredSimple = function() { * optional Simple2 optional_simple = 6; * @return {?proto.jspb.test.Simple2} */ -proto.jspb.test.TestGroup.prototype.getOptionalSimple = function() { +TestGroup.prototype.getOptionalSimple = function() { return /** @type{?proto.jspb.test.Simple2} */ ( - jspb.Message.getWrapperField(this, proto.jspb.test.Simple2, 6)); + jspb.Message.getWrapperField(this, Simple2, 6)); }; @@ -7079,7 +7032,7 @@ proto.jspb.test.TestGroup.prototype.getOptionalSimple = function() { * @param {?proto.jspb.test.Simple2|undefined} value * @return {!proto.jspb.test.TestGroup} returns this */ -proto.jspb.test.TestGroup.prototype.setOptionalSimple = function(value) { +TestGroup.prototype.setOptionalSimple = function(value) { return jspb.Message.setWrapperField(this, 6, value); }; @@ -7088,7 +7041,7 @@ proto.jspb.test.TestGroup.prototype.setOptionalSimple = function(value) { * Clears the message field making it undefined. * @return {!proto.jspb.test.TestGroup} returns this */ -proto.jspb.test.TestGroup.prototype.clearOptionalSimple = function() { +TestGroup.prototype.clearOptionalSimple = function() { return this.setOptionalSimple(undefined); }; @@ -7097,7 +7050,7 @@ proto.jspb.test.TestGroup.prototype.clearOptionalSimple = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.TestGroup.prototype.hasOptionalSimple = function() { +TestGroup.prototype.hasOptionalSimple = function() { return jspb.Message.getField(this, 6) != null; }; @@ -7118,8 +7071,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.jspb.test.TestGroup1.prototype.toObject = function(opt_includeInstance) { - return proto.jspb.test.TestGroup1.toObject(opt_includeInstance, this); +TestGroup1.prototype.toObject = function(opt_includeInstance) { + return TestGroup1.toObject(opt_includeInstance, this); }; @@ -7132,9 +7085,9 @@ proto.jspb.test.TestGroup1.prototype.toObject = function(opt_includeInstance) { * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.TestGroup1.toObject = function(includeInstance, msg) { +TestGroup1.toObject = function(includeInstance, msg) { var f, obj = { -group: (f = msg.getGroup()) && proto.jspb.test.TestGroup.RepeatedGroup.toObject(includeInstance, f) +group: (f = msg.getGroup()) && TestGroup.RepeatedGroup.toObject(includeInstance, f) }; if (includeInstance) { @@ -7150,10 +7103,10 @@ group: (f = msg.getGroup()) && proto.jspb.test.TestGroup.RepeatedGroup.toObject( * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.jspb.test.TestGroup1} */ -proto.jspb.test.TestGroup1.deserializeBinary = function(bytes) { +TestGroup1.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.jspb.test.TestGroup1; - return proto.jspb.test.TestGroup1.deserializeBinaryFromReader(msg, reader); + var msg = new TestGroup1; + return TestGroup1.deserializeBinaryFromReader(msg, reader); }; @@ -7164,7 +7117,7 @@ proto.jspb.test.TestGroup1.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.jspb.test.TestGroup1} */ -proto.jspb.test.TestGroup1.deserializeBinaryFromReader = function(msg, reader) { +TestGroup1.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -7172,8 +7125,8 @@ proto.jspb.test.TestGroup1.deserializeBinaryFromReader = function(msg, reader) { var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.jspb.test.TestGroup.RepeatedGroup; - reader.readMessage(value,proto.jspb.test.TestGroup.RepeatedGroup.deserializeBinaryFromReader); + var value = new TestGroup.RepeatedGroup; + reader.readMessage(value,TestGroup.RepeatedGroup.deserializeBinaryFromReader); msg.setGroup(value); break; default: @@ -7189,9 +7142,9 @@ proto.jspb.test.TestGroup1.deserializeBinaryFromReader = function(msg, reader) { * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.jspb.test.TestGroup1.prototype.serializeBinary = function() { +TestGroup1.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.jspb.test.TestGroup1.serializeBinaryToWriter(this, writer); + TestGroup1.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -7203,14 +7156,14 @@ proto.jspb.test.TestGroup1.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.TestGroup1.serializeBinaryToWriter = function(message, writer) { +TestGroup1.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getGroup(); if (f != null) { writer.writeMessage( 1, f, - proto.jspb.test.TestGroup.RepeatedGroup.serializeBinaryToWriter + TestGroup.RepeatedGroup.serializeBinaryToWriter ); } }; @@ -7220,9 +7173,9 @@ proto.jspb.test.TestGroup1.serializeBinaryToWriter = function(message, writer) { * optional TestGroup.RepeatedGroup group = 1; * @return {?proto.jspb.test.TestGroup.RepeatedGroup} */ -proto.jspb.test.TestGroup1.prototype.getGroup = function() { +TestGroup1.prototype.getGroup = function() { return /** @type{?proto.jspb.test.TestGroup.RepeatedGroup} */ ( - jspb.Message.getWrapperField(this, proto.jspb.test.TestGroup.RepeatedGroup, 1)); + jspb.Message.getWrapperField(this, TestGroup.RepeatedGroup, 1)); }; @@ -7230,7 +7183,7 @@ proto.jspb.test.TestGroup1.prototype.getGroup = function() { * @param {?proto.jspb.test.TestGroup.RepeatedGroup|undefined} value * @return {!proto.jspb.test.TestGroup1} returns this */ -proto.jspb.test.TestGroup1.prototype.setGroup = function(value) { +TestGroup1.prototype.setGroup = function(value) { return jspb.Message.setWrapperField(this, 1, value); }; @@ -7239,7 +7192,7 @@ proto.jspb.test.TestGroup1.prototype.setGroup = function(value) { * Clears the message field making it undefined. * @return {!proto.jspb.test.TestGroup1} returns this */ -proto.jspb.test.TestGroup1.prototype.clearGroup = function() { +TestGroup1.prototype.clearGroup = function() { return this.setGroup(undefined); }; @@ -7248,7 +7201,7 @@ proto.jspb.test.TestGroup1.prototype.clearGroup = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.TestGroup1.prototype.hasGroup = function() { +TestGroup1.prototype.hasGroup = function() { return jspb.Message.getField(this, 1) != null; }; @@ -7269,8 +7222,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.jspb.test.TestReservedNames.prototype.toObject = function(opt_includeInstance) { - return proto.jspb.test.TestReservedNames.toObject(opt_includeInstance, this); +TestReservedNames.prototype.toObject = function(opt_includeInstance) { + return TestReservedNames.toObject(opt_includeInstance, this); }; @@ -7283,13 +7236,13 @@ proto.jspb.test.TestReservedNames.prototype.toObject = function(opt_includeInsta * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.TestReservedNames.toObject = function(includeInstance, msg) { +TestReservedNames.toObject = function(includeInstance, msg) { var f, obj = { extension: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f }; jspb.Message.toObjectExtension(/** @type {!jspb.Message} */ (msg), obj, - proto.jspb.test.TestReservedNames.extensions, proto.jspb.test.TestReservedNames.prototype.getExtension, + TestReservedNames.extensions, TestReservedNames.prototype.getExtension, includeInstance); if (includeInstance) { obj.$jspbMessageInstance = msg; @@ -7304,10 +7257,10 @@ extension: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.jspb.test.TestReservedNames} */ -proto.jspb.test.TestReservedNames.deserializeBinary = function(bytes) { +TestReservedNames.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.jspb.test.TestReservedNames; - return proto.jspb.test.TestReservedNames.deserializeBinaryFromReader(msg, reader); + var msg = new TestReservedNames; + return TestReservedNames.deserializeBinaryFromReader(msg, reader); }; @@ -7318,7 +7271,7 @@ proto.jspb.test.TestReservedNames.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.jspb.test.TestReservedNames} */ -proto.jspb.test.TestReservedNames.deserializeBinaryFromReader = function(msg, reader) { +TestReservedNames.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -7331,9 +7284,9 @@ proto.jspb.test.TestReservedNames.deserializeBinaryFromReader = function(msg, re break; default: jspb.Message.readBinaryExtension(msg, reader, - proto.jspb.test.TestReservedNames.extensionsBinary, - proto.jspb.test.TestReservedNames.prototype.getExtension, - proto.jspb.test.TestReservedNames.prototype.setExtension); + TestReservedNames.extensionsBinary, + TestReservedNames.prototype.getExtension, + TestReservedNames.prototype.setExtension); break; } } @@ -7345,9 +7298,9 @@ proto.jspb.test.TestReservedNames.deserializeBinaryFromReader = function(msg, re * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.jspb.test.TestReservedNames.prototype.serializeBinary = function() { +TestReservedNames.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.jspb.test.TestReservedNames.serializeBinaryToWriter(this, writer); + TestReservedNames.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -7359,7 +7312,7 @@ proto.jspb.test.TestReservedNames.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.TestReservedNames.serializeBinaryToWriter = function(message, writer) { +TestReservedNames.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = /** @type {number} */ (jspb.Message.getField(message, 1)); if (f != null) { @@ -7369,7 +7322,7 @@ proto.jspb.test.TestReservedNames.serializeBinaryToWriter = function(message, wr ); } jspb.Message.serializeBinaryExtensions(message, writer, - proto.jspb.test.TestReservedNames.extensionsBinary, proto.jspb.test.TestReservedNames.prototype.getExtension); + TestReservedNames.extensionsBinary, TestReservedNames.prototype.getExtension); }; @@ -7377,7 +7330,7 @@ proto.jspb.test.TestReservedNames.serializeBinaryToWriter = function(message, wr * optional int32 extension = 1; * @return {number} */ -proto.jspb.test.TestReservedNames.prototype.getExtension$ = function() { +TestReservedNames.prototype.getExtension$ = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; @@ -7386,7 +7339,7 @@ proto.jspb.test.TestReservedNames.prototype.getExtension$ = function() { * @param {number} value * @return {!proto.jspb.test.TestReservedNames} returns this */ -proto.jspb.test.TestReservedNames.prototype.setExtension$ = function(value) { +TestReservedNames.prototype.setExtension$ = function(value) { return jspb.Message.setField(this, 1, value); }; @@ -7395,7 +7348,7 @@ proto.jspb.test.TestReservedNames.prototype.setExtension$ = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.TestReservedNames} returns this */ -proto.jspb.test.TestReservedNames.prototype.clearExtension$ = function() { +TestReservedNames.prototype.clearExtension$ = function() { return jspb.Message.setField(this, 1, undefined); }; @@ -7404,7 +7357,7 @@ proto.jspb.test.TestReservedNames.prototype.clearExtension$ = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.TestReservedNames.prototype.hasExtension$ = function() { +TestReservedNames.prototype.hasExtension$ = function() { return jspb.Message.getField(this, 1) != null; }; @@ -7425,8 +7378,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.jspb.test.TestReservedNamesExtension.prototype.toObject = function(opt_includeInstance) { - return proto.jspb.test.TestReservedNamesExtension.toObject(opt_includeInstance, this); +TestReservedNamesExtension.prototype.toObject = function(opt_includeInstance) { + return TestReservedNamesExtension.toObject(opt_includeInstance, this); }; @@ -7439,7 +7392,7 @@ proto.jspb.test.TestReservedNamesExtension.prototype.toObject = function(opt_inc * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.TestReservedNamesExtension.toObject = function(includeInstance, msg) { +TestReservedNamesExtension.toObject = function(includeInstance, msg) { var f, obj = { }; @@ -7457,10 +7410,10 @@ proto.jspb.test.TestReservedNamesExtension.toObject = function(includeInstance, * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.jspb.test.TestReservedNamesExtension} */ -proto.jspb.test.TestReservedNamesExtension.deserializeBinary = function(bytes) { +TestReservedNamesExtension.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.jspb.test.TestReservedNamesExtension; - return proto.jspb.test.TestReservedNamesExtension.deserializeBinaryFromReader(msg, reader); + var msg = new TestReservedNamesExtension; + return TestReservedNamesExtension.deserializeBinaryFromReader(msg, reader); }; @@ -7471,7 +7424,7 @@ proto.jspb.test.TestReservedNamesExtension.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.jspb.test.TestReservedNamesExtension} */ -proto.jspb.test.TestReservedNamesExtension.deserializeBinaryFromReader = function(msg, reader) { +TestReservedNamesExtension.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -7491,9 +7444,9 @@ proto.jspb.test.TestReservedNamesExtension.deserializeBinaryFromReader = functio * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.jspb.test.TestReservedNamesExtension.prototype.serializeBinary = function() { +TestReservedNamesExtension.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.jspb.test.TestReservedNamesExtension.serializeBinaryToWriter(this, writer); + TestReservedNamesExtension.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -7505,7 +7458,7 @@ proto.jspb.test.TestReservedNamesExtension.prototype.serializeBinary = function( * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.TestReservedNamesExtension.serializeBinaryToWriter = function(message, writer) { +TestReservedNamesExtension.serializeBinaryToWriter = function(message, writer) { var f = undefined; }; @@ -7516,7 +7469,7 @@ proto.jspb.test.TestReservedNamesExtension.serializeBinaryToWriter = function(me * field named `foo`. * @type {!jspb.ExtensionFieldInfo} */ -proto.jspb.test.TestReservedNamesExtension.foo = new jspb.ExtensionFieldInfo( +TestReservedNamesExtension.foo = new jspb.ExtensionFieldInfo( 10, {foo: 0}, null, @@ -7524,8 +7477,8 @@ proto.jspb.test.TestReservedNamesExtension.foo = new jspb.ExtensionFieldInfo( null), 0); -proto.jspb.test.TestReservedNames.extensionsBinary[10] = new jspb.ExtensionFieldBinaryInfo( - proto.jspb.test.TestReservedNamesExtension.foo, +TestReservedNames.extensionsBinary[10] = new jspb.ExtensionFieldBinaryInfo( + TestReservedNamesExtension.foo, jspb.BinaryReader.prototype.readInt32, jspb.BinaryWriter.prototype.writeInt32, undefined, @@ -7533,7 +7486,7 @@ proto.jspb.test.TestReservedNames.extensionsBinary[10] = new jspb.ExtensionField false); // This registers the extension field with the extended class, so that // toObject() will function correctly. -proto.jspb.test.TestReservedNames.extensions[10] = proto.jspb.test.TestReservedNamesExtension.foo; +TestReservedNames.extensions[10] = TestReservedNamesExtension.foo; /** @@ -7541,7 +7494,7 @@ proto.jspb.test.TestReservedNames.extensions[10] = proto.jspb.test.TestReservedN * field named `foo`. * @type {!jspb.ExtensionFieldInfo} */ -proto.jspb.test.TestReservedNamesExtension.foo = new jspb.ExtensionFieldInfo( +TestReservedNamesExtension.foo = new jspb.ExtensionFieldInfo( 10, {foo: 0}, null, @@ -7549,8 +7502,8 @@ proto.jspb.test.TestReservedNamesExtension.foo = new jspb.ExtensionFieldInfo( null), 0); -proto.jspb.test.TestReservedNames.extensionsBinary[10] = new jspb.ExtensionFieldBinaryInfo( - proto.jspb.test.TestReservedNamesExtension.foo, +TestReservedNames.extensionsBinary[10] = new jspb.ExtensionFieldBinaryInfo( + TestReservedNamesExtension.foo, jspb.BinaryReader.prototype.readInt32, jspb.BinaryWriter.prototype.writeInt32, undefined, @@ -7558,7 +7511,7 @@ proto.jspb.test.TestReservedNames.extensionsBinary[10] = new jspb.ExtensionField false); // This registers the extension field with the extended class, so that // toObject() will function correctly. -proto.jspb.test.TestReservedNames.extensions[10] = proto.jspb.test.TestReservedNamesExtension.foo; +TestReservedNames.extensions[10] = TestReservedNamesExtension.foo; /** @@ -7566,7 +7519,7 @@ proto.jspb.test.TestReservedNames.extensions[10] = proto.jspb.test.TestReservedN * @private {!Array} * @const */ -proto.jspb.test.TestMessageWithOneof.repeatedFields_ = [9]; +TestMessageWithOneof.repeatedFields_ = [9]; /** * Oneof group definitions for this message. Each group defines the field @@ -7576,12 +7529,12 @@ proto.jspb.test.TestMessageWithOneof.repeatedFields_ = [9]; * @private {!Array>} * @const */ -proto.jspb.test.TestMessageWithOneof.oneofGroups_ = [[3,5],[6,7],[10,11],[12,13]]; +TestMessageWithOneof.oneofGroups_ = [[3,5],[6,7],[10,11],[12,13]]; /** * @enum {number} */ -proto.jspb.test.TestMessageWithOneof.PartialOneofCase = { +TestMessageWithOneof.PartialOneofCase = { PARTIAL_ONEOF_NOT_SET: 0, PONE: 3, PTHREE: 5 @@ -7590,14 +7543,14 @@ proto.jspb.test.TestMessageWithOneof.PartialOneofCase = { /** * @return {proto.jspb.test.TestMessageWithOneof.PartialOneofCase} */ -proto.jspb.test.TestMessageWithOneof.prototype.getPartialOneofCase = function() { - return /** @type {proto.jspb.test.TestMessageWithOneof.PartialOneofCase} */(jspb.Message.computeOneofCase(this, proto.jspb.test.TestMessageWithOneof.oneofGroups_[0])); +TestMessageWithOneof.prototype.getPartialOneofCase = function() { + return /** @type {proto.jspb.test.TestMessageWithOneof.PartialOneofCase} */(jspb.Message.computeOneofCase(this, TestMessageWithOneof.oneofGroups_[0])); }; /** * @enum {number} */ -proto.jspb.test.TestMessageWithOneof.RecursiveOneofCase = { +TestMessageWithOneof.RecursiveOneofCase = { RECURSIVE_ONEOF_NOT_SET: 0, RONE: 6, RTWO: 7 @@ -7606,14 +7559,14 @@ proto.jspb.test.TestMessageWithOneof.RecursiveOneofCase = { /** * @return {proto.jspb.test.TestMessageWithOneof.RecursiveOneofCase} */ -proto.jspb.test.TestMessageWithOneof.prototype.getRecursiveOneofCase = function() { - return /** @type {proto.jspb.test.TestMessageWithOneof.RecursiveOneofCase} */(jspb.Message.computeOneofCase(this, proto.jspb.test.TestMessageWithOneof.oneofGroups_[1])); +TestMessageWithOneof.prototype.getRecursiveOneofCase = function() { + return /** @type {proto.jspb.test.TestMessageWithOneof.RecursiveOneofCase} */(jspb.Message.computeOneofCase(this, TestMessageWithOneof.oneofGroups_[1])); }; /** * @enum {number} */ -proto.jspb.test.TestMessageWithOneof.DefaultOneofACase = { +TestMessageWithOneof.DefaultOneofACase = { DEFAULT_ONEOF_A_NOT_SET: 0, AONE: 10, ATWO: 11 @@ -7622,14 +7575,14 @@ proto.jspb.test.TestMessageWithOneof.DefaultOneofACase = { /** * @return {proto.jspb.test.TestMessageWithOneof.DefaultOneofACase} */ -proto.jspb.test.TestMessageWithOneof.prototype.getDefaultOneofACase = function() { - return /** @type {proto.jspb.test.TestMessageWithOneof.DefaultOneofACase} */(jspb.Message.computeOneofCase(this, proto.jspb.test.TestMessageWithOneof.oneofGroups_[2])); +TestMessageWithOneof.prototype.getDefaultOneofACase = function() { + return /** @type {proto.jspb.test.TestMessageWithOneof.DefaultOneofACase} */(jspb.Message.computeOneofCase(this, TestMessageWithOneof.oneofGroups_[2])); }; /** * @enum {number} */ -proto.jspb.test.TestMessageWithOneof.DefaultOneofBCase = { +TestMessageWithOneof.DefaultOneofBCase = { DEFAULT_ONEOF_B_NOT_SET: 0, BONE: 12, BTWO: 13 @@ -7638,8 +7591,8 @@ proto.jspb.test.TestMessageWithOneof.DefaultOneofBCase = { /** * @return {proto.jspb.test.TestMessageWithOneof.DefaultOneofBCase} */ -proto.jspb.test.TestMessageWithOneof.prototype.getDefaultOneofBCase = function() { - return /** @type {proto.jspb.test.TestMessageWithOneof.DefaultOneofBCase} */(jspb.Message.computeOneofCase(this, proto.jspb.test.TestMessageWithOneof.oneofGroups_[3])); +TestMessageWithOneof.prototype.getDefaultOneofBCase = function() { + return /** @type {proto.jspb.test.TestMessageWithOneof.DefaultOneofBCase} */(jspb.Message.computeOneofCase(this, TestMessageWithOneof.oneofGroups_[3])); }; @@ -7657,8 +7610,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.jspb.test.TestMessageWithOneof.prototype.toObject = function(opt_includeInstance) { - return proto.jspb.test.TestMessageWithOneof.toObject(opt_includeInstance, this); +TestMessageWithOneof.prototype.toObject = function(opt_includeInstance) { + return TestMessageWithOneof.toObject(opt_includeInstance, this); }; @@ -7671,11 +7624,11 @@ proto.jspb.test.TestMessageWithOneof.prototype.toObject = function(opt_includeIn * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.TestMessageWithOneof.toObject = function(includeInstance, msg) { +TestMessageWithOneof.toObject = function(includeInstance, msg) { var f, obj = { pone: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f, pthree: (f = jspb.Message.getField(msg, 5)) == null ? undefined : f, -rone: (f = msg.getRone()) && proto.jspb.test.TestMessageWithOneof.toObject(includeInstance, f), +rone: (f = msg.getRone()) && TestMessageWithOneof.toObject(includeInstance, f), rtwo: (f = jspb.Message.getField(msg, 7)) == null ? undefined : f, normalField: (f = jspb.Message.getBooleanField(msg, 8)) == null ? undefined : f, repeatedFieldList: (f = jspb.Message.getRepeatedField(msg, 9)) == null ? undefined : f, @@ -7698,10 +7651,10 @@ btwo: jspb.Message.getFieldWithDefault(msg, 13, 1234) * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.jspb.test.TestMessageWithOneof} */ -proto.jspb.test.TestMessageWithOneof.deserializeBinary = function(bytes) { +TestMessageWithOneof.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.jspb.test.TestMessageWithOneof; - return proto.jspb.test.TestMessageWithOneof.deserializeBinaryFromReader(msg, reader); + var msg = new TestMessageWithOneof; + return TestMessageWithOneof.deserializeBinaryFromReader(msg, reader); }; @@ -7712,7 +7665,7 @@ proto.jspb.test.TestMessageWithOneof.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.jspb.test.TestMessageWithOneof} */ -proto.jspb.test.TestMessageWithOneof.deserializeBinaryFromReader = function(msg, reader) { +TestMessageWithOneof.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -7728,8 +7681,8 @@ proto.jspb.test.TestMessageWithOneof.deserializeBinaryFromReader = function(msg, msg.setPthree(value); break; case 6: - var value = new proto.jspb.test.TestMessageWithOneof; - reader.readMessage(value,proto.jspb.test.TestMessageWithOneof.deserializeBinaryFromReader); + var value = new TestMessageWithOneof; + reader.readMessage(value,TestMessageWithOneof.deserializeBinaryFromReader); msg.setRone(value); break; case 7: @@ -7773,9 +7726,9 @@ proto.jspb.test.TestMessageWithOneof.deserializeBinaryFromReader = function(msg, * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.jspb.test.TestMessageWithOneof.prototype.serializeBinary = function() { +TestMessageWithOneof.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.jspb.test.TestMessageWithOneof.serializeBinaryToWriter(this, writer); + TestMessageWithOneof.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -7787,7 +7740,7 @@ proto.jspb.test.TestMessageWithOneof.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.TestMessageWithOneof.serializeBinaryToWriter = function(message, writer) { +TestMessageWithOneof.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = /** @type {string} */ (jspb.Message.getField(message, 3)); if (f != null) { @@ -7808,7 +7761,7 @@ proto.jspb.test.TestMessageWithOneof.serializeBinaryToWriter = function(message, writer.writeMessage( 6, f, - proto.jspb.test.TestMessageWithOneof.serializeBinaryToWriter + TestMessageWithOneof.serializeBinaryToWriter ); } f = /** @type {string} */ (jspb.Message.getField(message, 7)); @@ -7867,7 +7820,7 @@ proto.jspb.test.TestMessageWithOneof.serializeBinaryToWriter = function(message, * optional string pone = 3; * @return {string} */ -proto.jspb.test.TestMessageWithOneof.prototype.getPone = function() { +TestMessageWithOneof.prototype.getPone = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); }; @@ -7876,8 +7829,8 @@ proto.jspb.test.TestMessageWithOneof.prototype.getPone = function() { * @param {string} value * @return {!proto.jspb.test.TestMessageWithOneof} returns this */ -proto.jspb.test.TestMessageWithOneof.prototype.setPone = function(value) { - return jspb.Message.setOneofField(this, 3, proto.jspb.test.TestMessageWithOneof.oneofGroups_[0], value); +TestMessageWithOneof.prototype.setPone = function(value) { + return jspb.Message.setOneofField(this, 3, TestMessageWithOneof.oneofGroups_[0], value); }; @@ -7885,8 +7838,8 @@ proto.jspb.test.TestMessageWithOneof.prototype.setPone = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.TestMessageWithOneof} returns this */ -proto.jspb.test.TestMessageWithOneof.prototype.clearPone = function() { - return jspb.Message.setOneofField(this, 3, proto.jspb.test.TestMessageWithOneof.oneofGroups_[0], undefined); +TestMessageWithOneof.prototype.clearPone = function() { + return jspb.Message.setOneofField(this, 3, TestMessageWithOneof.oneofGroups_[0], undefined); }; @@ -7894,7 +7847,7 @@ proto.jspb.test.TestMessageWithOneof.prototype.clearPone = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.TestMessageWithOneof.prototype.hasPone = function() { +TestMessageWithOneof.prototype.hasPone = function() { return jspb.Message.getField(this, 3) != null; }; @@ -7903,7 +7856,7 @@ proto.jspb.test.TestMessageWithOneof.prototype.hasPone = function() { * optional string pthree = 5; * @return {string} */ -proto.jspb.test.TestMessageWithOneof.prototype.getPthree = function() { +TestMessageWithOneof.prototype.getPthree = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); }; @@ -7912,8 +7865,8 @@ proto.jspb.test.TestMessageWithOneof.prototype.getPthree = function() { * @param {string} value * @return {!proto.jspb.test.TestMessageWithOneof} returns this */ -proto.jspb.test.TestMessageWithOneof.prototype.setPthree = function(value) { - return jspb.Message.setOneofField(this, 5, proto.jspb.test.TestMessageWithOneof.oneofGroups_[0], value); +TestMessageWithOneof.prototype.setPthree = function(value) { + return jspb.Message.setOneofField(this, 5, TestMessageWithOneof.oneofGroups_[0], value); }; @@ -7921,8 +7874,8 @@ proto.jspb.test.TestMessageWithOneof.prototype.setPthree = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.TestMessageWithOneof} returns this */ -proto.jspb.test.TestMessageWithOneof.prototype.clearPthree = function() { - return jspb.Message.setOneofField(this, 5, proto.jspb.test.TestMessageWithOneof.oneofGroups_[0], undefined); +TestMessageWithOneof.prototype.clearPthree = function() { + return jspb.Message.setOneofField(this, 5, TestMessageWithOneof.oneofGroups_[0], undefined); }; @@ -7930,7 +7883,7 @@ proto.jspb.test.TestMessageWithOneof.prototype.clearPthree = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.TestMessageWithOneof.prototype.hasPthree = function() { +TestMessageWithOneof.prototype.hasPthree = function() { return jspb.Message.getField(this, 5) != null; }; @@ -7939,9 +7892,9 @@ proto.jspb.test.TestMessageWithOneof.prototype.hasPthree = function() { * optional TestMessageWithOneof rone = 6; * @return {?proto.jspb.test.TestMessageWithOneof} */ -proto.jspb.test.TestMessageWithOneof.prototype.getRone = function() { +TestMessageWithOneof.prototype.getRone = function() { return /** @type{?proto.jspb.test.TestMessageWithOneof} */ ( - jspb.Message.getWrapperField(this, proto.jspb.test.TestMessageWithOneof, 6)); + jspb.Message.getWrapperField(this, TestMessageWithOneof, 6)); }; @@ -7949,8 +7902,8 @@ proto.jspb.test.TestMessageWithOneof.prototype.getRone = function() { * @param {?proto.jspb.test.TestMessageWithOneof|undefined} value * @return {!proto.jspb.test.TestMessageWithOneof} returns this */ -proto.jspb.test.TestMessageWithOneof.prototype.setRone = function(value) { - return jspb.Message.setOneofWrapperField(this, 6, proto.jspb.test.TestMessageWithOneof.oneofGroups_[1], value); +TestMessageWithOneof.prototype.setRone = function(value) { + return jspb.Message.setOneofWrapperField(this, 6, TestMessageWithOneof.oneofGroups_[1], value); }; @@ -7958,7 +7911,7 @@ proto.jspb.test.TestMessageWithOneof.prototype.setRone = function(value) { * Clears the message field making it undefined. * @return {!proto.jspb.test.TestMessageWithOneof} returns this */ -proto.jspb.test.TestMessageWithOneof.prototype.clearRone = function() { +TestMessageWithOneof.prototype.clearRone = function() { return this.setRone(undefined); }; @@ -7967,7 +7920,7 @@ proto.jspb.test.TestMessageWithOneof.prototype.clearRone = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.TestMessageWithOneof.prototype.hasRone = function() { +TestMessageWithOneof.prototype.hasRone = function() { return jspb.Message.getField(this, 6) != null; }; @@ -7976,7 +7929,7 @@ proto.jspb.test.TestMessageWithOneof.prototype.hasRone = function() { * optional string rtwo = 7; * @return {string} */ -proto.jspb.test.TestMessageWithOneof.prototype.getRtwo = function() { +TestMessageWithOneof.prototype.getRtwo = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); }; @@ -7985,8 +7938,8 @@ proto.jspb.test.TestMessageWithOneof.prototype.getRtwo = function() { * @param {string} value * @return {!proto.jspb.test.TestMessageWithOneof} returns this */ -proto.jspb.test.TestMessageWithOneof.prototype.setRtwo = function(value) { - return jspb.Message.setOneofField(this, 7, proto.jspb.test.TestMessageWithOneof.oneofGroups_[1], value); +TestMessageWithOneof.prototype.setRtwo = function(value) { + return jspb.Message.setOneofField(this, 7, TestMessageWithOneof.oneofGroups_[1], value); }; @@ -7994,8 +7947,8 @@ proto.jspb.test.TestMessageWithOneof.prototype.setRtwo = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.TestMessageWithOneof} returns this */ -proto.jspb.test.TestMessageWithOneof.prototype.clearRtwo = function() { - return jspb.Message.setOneofField(this, 7, proto.jspb.test.TestMessageWithOneof.oneofGroups_[1], undefined); +TestMessageWithOneof.prototype.clearRtwo = function() { + return jspb.Message.setOneofField(this, 7, TestMessageWithOneof.oneofGroups_[1], undefined); }; @@ -8003,7 +7956,7 @@ proto.jspb.test.TestMessageWithOneof.prototype.clearRtwo = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.TestMessageWithOneof.prototype.hasRtwo = function() { +TestMessageWithOneof.prototype.hasRtwo = function() { return jspb.Message.getField(this, 7) != null; }; @@ -8012,7 +7965,7 @@ proto.jspb.test.TestMessageWithOneof.prototype.hasRtwo = function() { * optional bool normal_field = 8; * @return {boolean} */ -proto.jspb.test.TestMessageWithOneof.prototype.getNormalField = function() { +TestMessageWithOneof.prototype.getNormalField = function() { return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 8, false)); }; @@ -8021,7 +7974,7 @@ proto.jspb.test.TestMessageWithOneof.prototype.getNormalField = function() { * @param {boolean} value * @return {!proto.jspb.test.TestMessageWithOneof} returns this */ -proto.jspb.test.TestMessageWithOneof.prototype.setNormalField = function(value) { +TestMessageWithOneof.prototype.setNormalField = function(value) { return jspb.Message.setField(this, 8, value); }; @@ -8030,7 +7983,7 @@ proto.jspb.test.TestMessageWithOneof.prototype.setNormalField = function(value) * Clears the field making it undefined. * @return {!proto.jspb.test.TestMessageWithOneof} returns this */ -proto.jspb.test.TestMessageWithOneof.prototype.clearNormalField = function() { +TestMessageWithOneof.prototype.clearNormalField = function() { return jspb.Message.setField(this, 8, undefined); }; @@ -8039,7 +7992,7 @@ proto.jspb.test.TestMessageWithOneof.prototype.clearNormalField = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.TestMessageWithOneof.prototype.hasNormalField = function() { +TestMessageWithOneof.prototype.hasNormalField = function() { return jspb.Message.getField(this, 8) != null; }; @@ -8048,7 +8001,7 @@ proto.jspb.test.TestMessageWithOneof.prototype.hasNormalField = function() { * repeated string repeated_field = 9; * @return {!Array} */ -proto.jspb.test.TestMessageWithOneof.prototype.getRepeatedFieldList = function() { +TestMessageWithOneof.prototype.getRepeatedFieldList = function() { return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 9)); }; @@ -8057,7 +8010,7 @@ proto.jspb.test.TestMessageWithOneof.prototype.getRepeatedFieldList = function() * @param {!Array} value * @return {!proto.jspb.test.TestMessageWithOneof} returns this */ -proto.jspb.test.TestMessageWithOneof.prototype.setRepeatedFieldList = function(value) { +TestMessageWithOneof.prototype.setRepeatedFieldList = function(value) { return jspb.Message.setField(this, 9, value || []); }; @@ -8067,7 +8020,7 @@ proto.jspb.test.TestMessageWithOneof.prototype.setRepeatedFieldList = function(v * @param {number=} opt_index * @return {!proto.jspb.test.TestMessageWithOneof} returns this */ -proto.jspb.test.TestMessageWithOneof.prototype.addRepeatedField = function(value, opt_index) { +TestMessageWithOneof.prototype.addRepeatedField = function(value, opt_index) { return jspb.Message.addToRepeatedField(this, 9, value, opt_index); }; @@ -8076,7 +8029,7 @@ proto.jspb.test.TestMessageWithOneof.prototype.addRepeatedField = function(value * Clears the list making it empty but non-null. * @return {!proto.jspb.test.TestMessageWithOneof} returns this */ -proto.jspb.test.TestMessageWithOneof.prototype.clearRepeatedFieldList = function() { +TestMessageWithOneof.prototype.clearRepeatedFieldList = function() { return this.setRepeatedFieldList([]); }; @@ -8085,7 +8038,7 @@ proto.jspb.test.TestMessageWithOneof.prototype.clearRepeatedFieldList = function * optional int32 aone = 10; * @return {number} */ -proto.jspb.test.TestMessageWithOneof.prototype.getAone = function() { +TestMessageWithOneof.prototype.getAone = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 10, 1234)); }; @@ -8094,8 +8047,8 @@ proto.jspb.test.TestMessageWithOneof.prototype.getAone = function() { * @param {number} value * @return {!proto.jspb.test.TestMessageWithOneof} returns this */ -proto.jspb.test.TestMessageWithOneof.prototype.setAone = function(value) { - return jspb.Message.setOneofField(this, 10, proto.jspb.test.TestMessageWithOneof.oneofGroups_[2], value); +TestMessageWithOneof.prototype.setAone = function(value) { + return jspb.Message.setOneofField(this, 10, TestMessageWithOneof.oneofGroups_[2], value); }; @@ -8103,8 +8056,8 @@ proto.jspb.test.TestMessageWithOneof.prototype.setAone = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.TestMessageWithOneof} returns this */ -proto.jspb.test.TestMessageWithOneof.prototype.clearAone = function() { - return jspb.Message.setOneofField(this, 10, proto.jspb.test.TestMessageWithOneof.oneofGroups_[2], undefined); +TestMessageWithOneof.prototype.clearAone = function() { + return jspb.Message.setOneofField(this, 10, TestMessageWithOneof.oneofGroups_[2], undefined); }; @@ -8112,7 +8065,7 @@ proto.jspb.test.TestMessageWithOneof.prototype.clearAone = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.TestMessageWithOneof.prototype.hasAone = function() { +TestMessageWithOneof.prototype.hasAone = function() { return jspb.Message.getField(this, 10) != null; }; @@ -8121,7 +8074,7 @@ proto.jspb.test.TestMessageWithOneof.prototype.hasAone = function() { * optional int32 atwo = 11; * @return {number} */ -proto.jspb.test.TestMessageWithOneof.prototype.getAtwo = function() { +TestMessageWithOneof.prototype.getAtwo = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 11, 0)); }; @@ -8130,8 +8083,8 @@ proto.jspb.test.TestMessageWithOneof.prototype.getAtwo = function() { * @param {number} value * @return {!proto.jspb.test.TestMessageWithOneof} returns this */ -proto.jspb.test.TestMessageWithOneof.prototype.setAtwo = function(value) { - return jspb.Message.setOneofField(this, 11, proto.jspb.test.TestMessageWithOneof.oneofGroups_[2], value); +TestMessageWithOneof.prototype.setAtwo = function(value) { + return jspb.Message.setOneofField(this, 11, TestMessageWithOneof.oneofGroups_[2], value); }; @@ -8139,8 +8092,8 @@ proto.jspb.test.TestMessageWithOneof.prototype.setAtwo = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.TestMessageWithOneof} returns this */ -proto.jspb.test.TestMessageWithOneof.prototype.clearAtwo = function() { - return jspb.Message.setOneofField(this, 11, proto.jspb.test.TestMessageWithOneof.oneofGroups_[2], undefined); +TestMessageWithOneof.prototype.clearAtwo = function() { + return jspb.Message.setOneofField(this, 11, TestMessageWithOneof.oneofGroups_[2], undefined); }; @@ -8148,7 +8101,7 @@ proto.jspb.test.TestMessageWithOneof.prototype.clearAtwo = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.TestMessageWithOneof.prototype.hasAtwo = function() { +TestMessageWithOneof.prototype.hasAtwo = function() { return jspb.Message.getField(this, 11) != null; }; @@ -8157,7 +8110,7 @@ proto.jspb.test.TestMessageWithOneof.prototype.hasAtwo = function() { * optional int32 bone = 12; * @return {number} */ -proto.jspb.test.TestMessageWithOneof.prototype.getBone = function() { +TestMessageWithOneof.prototype.getBone = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 12, 0)); }; @@ -8166,8 +8119,8 @@ proto.jspb.test.TestMessageWithOneof.prototype.getBone = function() { * @param {number} value * @return {!proto.jspb.test.TestMessageWithOneof} returns this */ -proto.jspb.test.TestMessageWithOneof.prototype.setBone = function(value) { - return jspb.Message.setOneofField(this, 12, proto.jspb.test.TestMessageWithOneof.oneofGroups_[3], value); +TestMessageWithOneof.prototype.setBone = function(value) { + return jspb.Message.setOneofField(this, 12, TestMessageWithOneof.oneofGroups_[3], value); }; @@ -8175,8 +8128,8 @@ proto.jspb.test.TestMessageWithOneof.prototype.setBone = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.TestMessageWithOneof} returns this */ -proto.jspb.test.TestMessageWithOneof.prototype.clearBone = function() { - return jspb.Message.setOneofField(this, 12, proto.jspb.test.TestMessageWithOneof.oneofGroups_[3], undefined); +TestMessageWithOneof.prototype.clearBone = function() { + return jspb.Message.setOneofField(this, 12, TestMessageWithOneof.oneofGroups_[3], undefined); }; @@ -8184,7 +8137,7 @@ proto.jspb.test.TestMessageWithOneof.prototype.clearBone = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.TestMessageWithOneof.prototype.hasBone = function() { +TestMessageWithOneof.prototype.hasBone = function() { return jspb.Message.getField(this, 12) != null; }; @@ -8193,7 +8146,7 @@ proto.jspb.test.TestMessageWithOneof.prototype.hasBone = function() { * optional int32 btwo = 13; * @return {number} */ -proto.jspb.test.TestMessageWithOneof.prototype.getBtwo = function() { +TestMessageWithOneof.prototype.getBtwo = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 13, 1234)); }; @@ -8202,8 +8155,8 @@ proto.jspb.test.TestMessageWithOneof.prototype.getBtwo = function() { * @param {number} value * @return {!proto.jspb.test.TestMessageWithOneof} returns this */ -proto.jspb.test.TestMessageWithOneof.prototype.setBtwo = function(value) { - return jspb.Message.setOneofField(this, 13, proto.jspb.test.TestMessageWithOneof.oneofGroups_[3], value); +TestMessageWithOneof.prototype.setBtwo = function(value) { + return jspb.Message.setOneofField(this, 13, TestMessageWithOneof.oneofGroups_[3], value); }; @@ -8211,8 +8164,8 @@ proto.jspb.test.TestMessageWithOneof.prototype.setBtwo = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.TestMessageWithOneof} returns this */ -proto.jspb.test.TestMessageWithOneof.prototype.clearBtwo = function() { - return jspb.Message.setOneofField(this, 13, proto.jspb.test.TestMessageWithOneof.oneofGroups_[3], undefined); +TestMessageWithOneof.prototype.clearBtwo = function() { + return jspb.Message.setOneofField(this, 13, TestMessageWithOneof.oneofGroups_[3], undefined); }; @@ -8220,7 +8173,7 @@ proto.jspb.test.TestMessageWithOneof.prototype.clearBtwo = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.TestMessageWithOneof.prototype.hasBtwo = function() { +TestMessageWithOneof.prototype.hasBtwo = function() { return jspb.Message.getField(this, 13) != null; }; @@ -8241,8 +8194,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.jspb.test.TestEndsWithBytes.prototype.toObject = function(opt_includeInstance) { - return proto.jspb.test.TestEndsWithBytes.toObject(opt_includeInstance, this); +TestEndsWithBytes.prototype.toObject = function(opt_includeInstance) { + return TestEndsWithBytes.toObject(opt_includeInstance, this); }; @@ -8255,7 +8208,7 @@ proto.jspb.test.TestEndsWithBytes.prototype.toObject = function(opt_includeInsta * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.TestEndsWithBytes.toObject = function(includeInstance, msg) { +TestEndsWithBytes.toObject = function(includeInstance, msg) { var f, obj = { value: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, data: msg.getData_asB64() @@ -8274,10 +8227,10 @@ data: msg.getData_asB64() * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.jspb.test.TestEndsWithBytes} */ -proto.jspb.test.TestEndsWithBytes.deserializeBinary = function(bytes) { +TestEndsWithBytes.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.jspb.test.TestEndsWithBytes; - return proto.jspb.test.TestEndsWithBytes.deserializeBinaryFromReader(msg, reader); + var msg = new TestEndsWithBytes; + return TestEndsWithBytes.deserializeBinaryFromReader(msg, reader); }; @@ -8288,7 +8241,7 @@ proto.jspb.test.TestEndsWithBytes.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.jspb.test.TestEndsWithBytes} */ -proto.jspb.test.TestEndsWithBytes.deserializeBinaryFromReader = function(msg, reader) { +TestEndsWithBytes.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -8316,9 +8269,9 @@ proto.jspb.test.TestEndsWithBytes.deserializeBinaryFromReader = function(msg, re * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.jspb.test.TestEndsWithBytes.prototype.serializeBinary = function() { +TestEndsWithBytes.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.jspb.test.TestEndsWithBytes.serializeBinaryToWriter(this, writer); + TestEndsWithBytes.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -8330,7 +8283,7 @@ proto.jspb.test.TestEndsWithBytes.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.TestEndsWithBytes.serializeBinaryToWriter = function(message, writer) { +TestEndsWithBytes.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = /** @type {number} */ (jspb.Message.getField(message, 1)); if (f != null) { @@ -8353,7 +8306,7 @@ proto.jspb.test.TestEndsWithBytes.serializeBinaryToWriter = function(message, wr * optional int32 value = 1; * @return {number} */ -proto.jspb.test.TestEndsWithBytes.prototype.getValue = function() { +TestEndsWithBytes.prototype.getValue = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; @@ -8362,7 +8315,7 @@ proto.jspb.test.TestEndsWithBytes.prototype.getValue = function() { * @param {number} value * @return {!proto.jspb.test.TestEndsWithBytes} returns this */ -proto.jspb.test.TestEndsWithBytes.prototype.setValue = function(value) { +TestEndsWithBytes.prototype.setValue = function(value) { return jspb.Message.setField(this, 1, value); }; @@ -8371,7 +8324,7 @@ proto.jspb.test.TestEndsWithBytes.prototype.setValue = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.TestEndsWithBytes} returns this */ -proto.jspb.test.TestEndsWithBytes.prototype.clearValue = function() { +TestEndsWithBytes.prototype.clearValue = function() { return jspb.Message.setField(this, 1, undefined); }; @@ -8380,7 +8333,7 @@ proto.jspb.test.TestEndsWithBytes.prototype.clearValue = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.TestEndsWithBytes.prototype.hasValue = function() { +TestEndsWithBytes.prototype.hasValue = function() { return jspb.Message.getField(this, 1) != null; }; @@ -8389,7 +8342,7 @@ proto.jspb.test.TestEndsWithBytes.prototype.hasValue = function() { * optional bytes data = 2; * @return {!(string|Uint8Array)} */ -proto.jspb.test.TestEndsWithBytes.prototype.getData = function() { +TestEndsWithBytes.prototype.getData = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; @@ -8399,7 +8352,7 @@ proto.jspb.test.TestEndsWithBytes.prototype.getData = function() { * This is a type-conversion wrapper around `getData()` * @return {string} */ -proto.jspb.test.TestEndsWithBytes.prototype.getData_asB64 = function() { +TestEndsWithBytes.prototype.getData_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getData())); }; @@ -8412,7 +8365,7 @@ proto.jspb.test.TestEndsWithBytes.prototype.getData_asB64 = function() { * This is a type-conversion wrapper around `getData()` * @return {!Uint8Array} */ -proto.jspb.test.TestEndsWithBytes.prototype.getData_asU8 = function() { +TestEndsWithBytes.prototype.getData_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getData())); }; @@ -8422,7 +8375,7 @@ proto.jspb.test.TestEndsWithBytes.prototype.getData_asU8 = function() { * @param {!(string|Uint8Array)} value * @return {!proto.jspb.test.TestEndsWithBytes} returns this */ -proto.jspb.test.TestEndsWithBytes.prototype.setData = function(value) { +TestEndsWithBytes.prototype.setData = function(value) { return jspb.Message.setField(this, 2, value); }; @@ -8431,7 +8384,7 @@ proto.jspb.test.TestEndsWithBytes.prototype.setData = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.TestEndsWithBytes} returns this */ -proto.jspb.test.TestEndsWithBytes.prototype.clearData = function() { +TestEndsWithBytes.prototype.clearData = function() { return jspb.Message.setField(this, 2, undefined); }; @@ -8440,7 +8393,7 @@ proto.jspb.test.TestEndsWithBytes.prototype.clearData = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.TestEndsWithBytes.prototype.hasData = function() { +TestEndsWithBytes.prototype.hasData = function() { return jspb.Message.getField(this, 2) != null; }; @@ -8461,8 +8414,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.jspb.test.TestLastFieldBeforePivot.prototype.toObject = function(opt_includeInstance) { - return proto.jspb.test.TestLastFieldBeforePivot.toObject(opt_includeInstance, this); +TestLastFieldBeforePivot.prototype.toObject = function(opt_includeInstance) { + return TestLastFieldBeforePivot.toObject(opt_includeInstance, this); }; @@ -8475,13 +8428,13 @@ proto.jspb.test.TestLastFieldBeforePivot.prototype.toObject = function(opt_inclu * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.TestLastFieldBeforePivot.toObject = function(includeInstance, msg) { +TestLastFieldBeforePivot.toObject = function(includeInstance, msg) { var f, obj = { lastFieldBeforePivot: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f }; jspb.Message.toObjectExtension(/** @type {!jspb.Message} */ (msg), obj, - proto.jspb.test.TestLastFieldBeforePivot.extensions, proto.jspb.test.TestLastFieldBeforePivot.prototype.getExtension, + TestLastFieldBeforePivot.extensions, TestLastFieldBeforePivot.prototype.getExtension, includeInstance); if (includeInstance) { obj.$jspbMessageInstance = msg; @@ -8496,10 +8449,10 @@ lastFieldBeforePivot: (f = jspb.Message.getField(msg, 1)) == null ? undefined : * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.jspb.test.TestLastFieldBeforePivot} */ -proto.jspb.test.TestLastFieldBeforePivot.deserializeBinary = function(bytes) { +TestLastFieldBeforePivot.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.jspb.test.TestLastFieldBeforePivot; - return proto.jspb.test.TestLastFieldBeforePivot.deserializeBinaryFromReader(msg, reader); + var msg = new TestLastFieldBeforePivot; + return TestLastFieldBeforePivot.deserializeBinaryFromReader(msg, reader); }; @@ -8510,7 +8463,7 @@ proto.jspb.test.TestLastFieldBeforePivot.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.jspb.test.TestLastFieldBeforePivot} */ -proto.jspb.test.TestLastFieldBeforePivot.deserializeBinaryFromReader = function(msg, reader) { +TestLastFieldBeforePivot.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -8523,9 +8476,9 @@ proto.jspb.test.TestLastFieldBeforePivot.deserializeBinaryFromReader = function( break; default: jspb.Message.readBinaryExtension(msg, reader, - proto.jspb.test.TestLastFieldBeforePivot.extensionsBinary, - proto.jspb.test.TestLastFieldBeforePivot.prototype.getExtension, - proto.jspb.test.TestLastFieldBeforePivot.prototype.setExtension); + TestLastFieldBeforePivot.extensionsBinary, + TestLastFieldBeforePivot.prototype.getExtension, + TestLastFieldBeforePivot.prototype.setExtension); break; } } @@ -8537,9 +8490,9 @@ proto.jspb.test.TestLastFieldBeforePivot.deserializeBinaryFromReader = function( * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.jspb.test.TestLastFieldBeforePivot.prototype.serializeBinary = function() { +TestLastFieldBeforePivot.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.jspb.test.TestLastFieldBeforePivot.serializeBinaryToWriter(this, writer); + TestLastFieldBeforePivot.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -8551,7 +8504,7 @@ proto.jspb.test.TestLastFieldBeforePivot.prototype.serializeBinary = function() * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.TestLastFieldBeforePivot.serializeBinaryToWriter = function(message, writer) { +TestLastFieldBeforePivot.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = /** @type {number} */ (jspb.Message.getField(message, 1)); if (f != null) { @@ -8561,7 +8514,7 @@ proto.jspb.test.TestLastFieldBeforePivot.serializeBinaryToWriter = function(mess ); } jspb.Message.serializeBinaryExtensions(message, writer, - proto.jspb.test.TestLastFieldBeforePivot.extensionsBinary, proto.jspb.test.TestLastFieldBeforePivot.prototype.getExtension); + TestLastFieldBeforePivot.extensionsBinary, TestLastFieldBeforePivot.prototype.getExtension); }; @@ -8569,7 +8522,7 @@ proto.jspb.test.TestLastFieldBeforePivot.serializeBinaryToWriter = function(mess * optional int32 last_field_before_pivot = 1; * @return {number} */ -proto.jspb.test.TestLastFieldBeforePivot.prototype.getLastFieldBeforePivot = function() { +TestLastFieldBeforePivot.prototype.getLastFieldBeforePivot = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; @@ -8578,7 +8531,7 @@ proto.jspb.test.TestLastFieldBeforePivot.prototype.getLastFieldBeforePivot = fun * @param {number} value * @return {!proto.jspb.test.TestLastFieldBeforePivot} returns this */ -proto.jspb.test.TestLastFieldBeforePivot.prototype.setLastFieldBeforePivot = function(value) { +TestLastFieldBeforePivot.prototype.setLastFieldBeforePivot = function(value) { return jspb.Message.setField(this, 1, value); }; @@ -8587,7 +8540,7 @@ proto.jspb.test.TestLastFieldBeforePivot.prototype.setLastFieldBeforePivot = fun * Clears the field making it undefined. * @return {!proto.jspb.test.TestLastFieldBeforePivot} returns this */ -proto.jspb.test.TestLastFieldBeforePivot.prototype.clearLastFieldBeforePivot = function() { +TestLastFieldBeforePivot.prototype.clearLastFieldBeforePivot = function() { return jspb.Message.setField(this, 1, undefined); }; @@ -8596,7 +8549,7 @@ proto.jspb.test.TestLastFieldBeforePivot.prototype.clearLastFieldBeforePivot = f * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.TestLastFieldBeforePivot.prototype.hasLastFieldBeforePivot = function() { +TestLastFieldBeforePivot.prototype.hasLastFieldBeforePivot = function() { return jspb.Message.getField(this, 1) != null; }; @@ -8617,8 +8570,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.jspb.test.Int64Types.prototype.toObject = function(opt_includeInstance) { - return proto.jspb.test.Int64Types.toObject(opt_includeInstance, this); +Int64Types.prototype.toObject = function(opt_includeInstance) { + return Int64Types.toObject(opt_includeInstance, this); }; @@ -8631,7 +8584,7 @@ proto.jspb.test.Int64Types.prototype.toObject = function(opt_includeInstance) { * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.Int64Types.toObject = function(includeInstance, msg) { +Int64Types.toObject = function(includeInstance, msg) { var f, obj = { int64Normal: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, int64String: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f, @@ -8651,10 +8604,10 @@ int64Number: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.jspb.test.Int64Types} */ -proto.jspb.test.Int64Types.deserializeBinary = function(bytes) { +Int64Types.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.jspb.test.Int64Types; - return proto.jspb.test.Int64Types.deserializeBinaryFromReader(msg, reader); + var msg = new Int64Types; + return Int64Types.deserializeBinaryFromReader(msg, reader); }; @@ -8665,7 +8618,7 @@ proto.jspb.test.Int64Types.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.jspb.test.Int64Types} */ -proto.jspb.test.Int64Types.deserializeBinaryFromReader = function(msg, reader) { +Int64Types.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -8697,9 +8650,9 @@ proto.jspb.test.Int64Types.deserializeBinaryFromReader = function(msg, reader) { * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.jspb.test.Int64Types.prototype.serializeBinary = function() { +Int64Types.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.jspb.test.Int64Types.serializeBinaryToWriter(this, writer); + Int64Types.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -8711,7 +8664,7 @@ proto.jspb.test.Int64Types.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.Int64Types.serializeBinaryToWriter = function(message, writer) { +Int64Types.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = /** @type {number} */ (jspb.Message.getField(message, 1)); if (f != null) { @@ -8741,7 +8694,7 @@ proto.jspb.test.Int64Types.serializeBinaryToWriter = function(message, writer) { * optional int64 int64_normal = 1; * @return {number} */ -proto.jspb.test.Int64Types.prototype.getInt64Normal = function() { +Int64Types.prototype.getInt64Normal = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; @@ -8750,7 +8703,7 @@ proto.jspb.test.Int64Types.prototype.getInt64Normal = function() { * @param {number} value * @return {!proto.jspb.test.Int64Types} returns this */ -proto.jspb.test.Int64Types.prototype.setInt64Normal = function(value) { +Int64Types.prototype.setInt64Normal = function(value) { return jspb.Message.setField(this, 1, value); }; @@ -8759,7 +8712,7 @@ proto.jspb.test.Int64Types.prototype.setInt64Normal = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.Int64Types} returns this */ -proto.jspb.test.Int64Types.prototype.clearInt64Normal = function() { +Int64Types.prototype.clearInt64Normal = function() { return jspb.Message.setField(this, 1, undefined); }; @@ -8768,7 +8721,7 @@ proto.jspb.test.Int64Types.prototype.clearInt64Normal = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.Int64Types.prototype.hasInt64Normal = function() { +Int64Types.prototype.hasInt64Normal = function() { return jspb.Message.getField(this, 1) != null; }; @@ -8777,7 +8730,7 @@ proto.jspb.test.Int64Types.prototype.hasInt64Normal = function() { * optional sint64 int64_string = 2; * @return {string} */ -proto.jspb.test.Int64Types.prototype.getInt64String = function() { +Int64Types.prototype.getInt64String = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "0")); }; @@ -8786,7 +8739,7 @@ proto.jspb.test.Int64Types.prototype.getInt64String = function() { * @param {string} value * @return {!proto.jspb.test.Int64Types} returns this */ -proto.jspb.test.Int64Types.prototype.setInt64String = function(value) { +Int64Types.prototype.setInt64String = function(value) { return jspb.Message.setField(this, 2, value); }; @@ -8795,7 +8748,7 @@ proto.jspb.test.Int64Types.prototype.setInt64String = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.Int64Types} returns this */ -proto.jspb.test.Int64Types.prototype.clearInt64String = function() { +Int64Types.prototype.clearInt64String = function() { return jspb.Message.setField(this, 2, undefined); }; @@ -8804,7 +8757,7 @@ proto.jspb.test.Int64Types.prototype.clearInt64String = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.Int64Types.prototype.hasInt64String = function() { +Int64Types.prototype.hasInt64String = function() { return jspb.Message.getField(this, 2) != null; }; @@ -8813,7 +8766,7 @@ proto.jspb.test.Int64Types.prototype.hasInt64String = function() { * optional uint64 int64_number = 3; * @return {number} */ -proto.jspb.test.Int64Types.prototype.getInt64Number = function() { +Int64Types.prototype.getInt64Number = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); }; @@ -8822,7 +8775,7 @@ proto.jspb.test.Int64Types.prototype.getInt64Number = function() { * @param {number} value * @return {!proto.jspb.test.Int64Types} returns this */ -proto.jspb.test.Int64Types.prototype.setInt64Number = function(value) { +Int64Types.prototype.setInt64Number = function(value) { return jspb.Message.setField(this, 3, value); }; @@ -8831,7 +8784,7 @@ proto.jspb.test.Int64Types.prototype.setInt64Number = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.Int64Types} returns this */ -proto.jspb.test.Int64Types.prototype.clearInt64Number = function() { +Int64Types.prototype.clearInt64Number = function() { return jspb.Message.setField(this, 3, undefined); }; @@ -8840,7 +8793,7 @@ proto.jspb.test.Int64Types.prototype.clearInt64Number = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.Int64Types.prototype.hasInt64Number = function() { +Int64Types.prototype.hasInt64Number = function() { return jspb.Message.getField(this, 3) != null; }; @@ -8861,8 +8814,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.jspb.test.TestMapFieldsNoBinary.prototype.toObject = function(opt_includeInstance) { - return proto.jspb.test.TestMapFieldsNoBinary.toObject(opt_includeInstance, this); +TestMapFieldsNoBinary.prototype.toObject = function(opt_includeInstance) { + return TestMapFieldsNoBinary.toObject(opt_includeInstance, this); }; @@ -8875,7 +8828,7 @@ proto.jspb.test.TestMapFieldsNoBinary.prototype.toObject = function(opt_includeI * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.TestMapFieldsNoBinary.toObject = function(includeInstance, msg) { +TestMapFieldsNoBinary.toObject = function(includeInstance, msg) { var f, obj = { mapStringStringMap: (f = msg.getMapStringStringMap()) ? f.toObject(includeInstance, undefined) : [], mapStringInt32Map: (f = msg.getMapStringInt32Map()) ? f.toObject(includeInstance, undefined) : [], @@ -8883,12 +8836,12 @@ mapStringInt64Map: (f = msg.getMapStringInt64Map()) ? f.toObject(includeInstance mapStringBoolMap: (f = msg.getMapStringBoolMap()) ? f.toObject(includeInstance, undefined) : [], mapStringDoubleMap: (f = msg.getMapStringDoubleMap()) ? f.toObject(includeInstance, undefined) : [], mapStringEnumMap: (f = msg.getMapStringEnumMap()) ? f.toObject(includeInstance, undefined) : [], -mapStringMsgMap: (f = msg.getMapStringMsgMap()) ? f.toObject(includeInstance, proto.jspb.test.MapValueMessageNoBinary.toObject) : [], +mapStringMsgMap: (f = msg.getMapStringMsgMap()) ? f.toObject(includeInstance, MapValueMessageNoBinary.toObject) : [], mapInt32StringMap: (f = msg.getMapInt32StringMap()) ? f.toObject(includeInstance, undefined) : [], mapInt64StringMap: (f = msg.getMapInt64StringMap()) ? f.toObject(includeInstance, undefined) : [], mapBoolStringMap: (f = msg.getMapBoolStringMap()) ? f.toObject(includeInstance, undefined) : [], -testMapFields: (f = msg.getTestMapFields()) && proto.jspb.test.TestMapFieldsNoBinary.toObject(includeInstance, f), -mapStringTestmapfieldsMap: (f = msg.getMapStringTestmapfieldsMap()) ? f.toObject(includeInstance, proto.jspb.test.TestMapFieldsNoBinary.toObject) : [] +testMapFields: (f = msg.getTestMapFields()) && TestMapFieldsNoBinary.toObject(includeInstance, f), +mapStringTestmapfieldsMap: (f = msg.getMapStringTestmapfieldsMap()) ? f.toObject(includeInstance, TestMapFieldsNoBinary.toObject) : [] }; if (includeInstance) { @@ -8904,10 +8857,10 @@ mapStringTestmapfieldsMap: (f = msg.getMapStringTestmapfieldsMap()) ? f.toObject * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.jspb.test.TestMapFieldsNoBinary} */ -proto.jspb.test.TestMapFieldsNoBinary.deserializeBinary = function(bytes) { +TestMapFieldsNoBinary.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.jspb.test.TestMapFieldsNoBinary; - return proto.jspb.test.TestMapFieldsNoBinary.deserializeBinaryFromReader(msg, reader); + var msg = new TestMapFieldsNoBinary; + return TestMapFieldsNoBinary.deserializeBinaryFromReader(msg, reader); }; @@ -8918,7 +8871,7 @@ proto.jspb.test.TestMapFieldsNoBinary.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.jspb.test.TestMapFieldsNoBinary} */ -proto.jspb.test.TestMapFieldsNoBinary.deserializeBinaryFromReader = function(msg, reader) { +TestMapFieldsNoBinary.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -8964,7 +8917,7 @@ proto.jspb.test.TestMapFieldsNoBinary.deserializeBinaryFromReader = function(msg case 7: var value = msg.getMapStringMsgMap(); reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.jspb.test.MapValueMessageNoBinary.deserializeBinaryFromReader, "", new proto.jspb.test.MapValueMessageNoBinary()); + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, MapValueMessageNoBinary.deserializeBinaryFromReader, "", new MapValueMessageNoBinary()); }); break; case 8: @@ -8986,14 +8939,14 @@ proto.jspb.test.TestMapFieldsNoBinary.deserializeBinaryFromReader = function(msg }); break; case 11: - var value = new proto.jspb.test.TestMapFieldsNoBinary; - reader.readMessage(value,proto.jspb.test.TestMapFieldsNoBinary.deserializeBinaryFromReader); + var value = new TestMapFieldsNoBinary; + reader.readMessage(value,TestMapFieldsNoBinary.deserializeBinaryFromReader); msg.setTestMapFields(value); break; case 12: var value = msg.getMapStringTestmapfieldsMap(); reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.jspb.test.TestMapFieldsNoBinary.deserializeBinaryFromReader, "", new proto.jspb.test.TestMapFieldsNoBinary()); + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, TestMapFieldsNoBinary.deserializeBinaryFromReader, "", new TestMapFieldsNoBinary()); }); break; default: @@ -9009,9 +8962,9 @@ proto.jspb.test.TestMapFieldsNoBinary.deserializeBinaryFromReader = function(msg * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.jspb.test.TestMapFieldsNoBinary.prototype.serializeBinary = function() { +TestMapFieldsNoBinary.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.jspb.test.TestMapFieldsNoBinary.serializeBinaryToWriter(this, writer); + TestMapFieldsNoBinary.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -9023,7 +8976,7 @@ proto.jspb.test.TestMapFieldsNoBinary.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.TestMapFieldsNoBinary.serializeBinaryToWriter = function(message, writer) { +TestMapFieldsNoBinary.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getMapStringStringMap(true); if (f && f.getLength() > 0) { @@ -9051,7 +9004,7 @@ proto.jspb.test.TestMapFieldsNoBinary.serializeBinaryToWriter = function(message } f = message.getMapStringMsgMap(true); if (f && f.getLength() > 0) { - f.serializeBinary(7, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.jspb.test.MapValueMessageNoBinary.serializeBinaryToWriter); + f.serializeBinary(7, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, MapValueMessageNoBinary.serializeBinaryToWriter); } f = message.getMapInt32StringMap(true); if (f && f.getLength() > 0) { @@ -9070,12 +9023,12 @@ proto.jspb.test.TestMapFieldsNoBinary.serializeBinaryToWriter = function(message writer.writeMessage( 11, f, - proto.jspb.test.TestMapFieldsNoBinary.serializeBinaryToWriter + TestMapFieldsNoBinary.serializeBinaryToWriter ); } f = message.getMapStringTestmapfieldsMap(true); if (f && f.getLength() > 0) { - f.serializeBinary(12, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.jspb.test.TestMapFieldsNoBinary.serializeBinaryToWriter); + f.serializeBinary(12, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, TestMapFieldsNoBinary.serializeBinaryToWriter); } }; @@ -9086,7 +9039,7 @@ proto.jspb.test.TestMapFieldsNoBinary.serializeBinaryToWriter = function(message * empty, instead returning `undefined` * @return {!jspb.Map} */ -proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapStringStringMap = function(opt_noLazyCreate) { +TestMapFieldsNoBinary.prototype.getMapStringStringMap = function(opt_noLazyCreate) { return /** @type {!jspb.Map} */ ( jspb.Message.getMapField(this, 1, opt_noLazyCreate, null)); @@ -9097,7 +9050,7 @@ proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapStringStringMap = function * Clears values from the map. The map will be non-null. * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this */ -proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapStringStringMap = function() { +TestMapFieldsNoBinary.prototype.clearMapStringStringMap = function() { this.getMapStringStringMap().clear(); return this; }; @@ -9109,7 +9062,7 @@ proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapStringStringMap = functi * empty, instead returning `undefined` * @return {!jspb.Map} */ -proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapStringInt32Map = function(opt_noLazyCreate) { +TestMapFieldsNoBinary.prototype.getMapStringInt32Map = function(opt_noLazyCreate) { return /** @type {!jspb.Map} */ ( jspb.Message.getMapField(this, 2, opt_noLazyCreate, null)); @@ -9120,7 +9073,7 @@ proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapStringInt32Map = function( * Clears values from the map. The map will be non-null. * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this */ -proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapStringInt32Map = function() { +TestMapFieldsNoBinary.prototype.clearMapStringInt32Map = function() { this.getMapStringInt32Map().clear(); return this; }; @@ -9132,7 +9085,7 @@ proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapStringInt32Map = functio * empty, instead returning `undefined` * @return {!jspb.Map} */ -proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapStringInt64Map = function(opt_noLazyCreate) { +TestMapFieldsNoBinary.prototype.getMapStringInt64Map = function(opt_noLazyCreate) { return /** @type {!jspb.Map} */ ( jspb.Message.getMapField(this, 3, opt_noLazyCreate, null)); @@ -9143,7 +9096,7 @@ proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapStringInt64Map = function( * Clears values from the map. The map will be non-null. * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this */ -proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapStringInt64Map = function() { +TestMapFieldsNoBinary.prototype.clearMapStringInt64Map = function() { this.getMapStringInt64Map().clear(); return this; }; @@ -9155,7 +9108,7 @@ proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapStringInt64Map = functio * empty, instead returning `undefined` * @return {!jspb.Map} */ -proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapStringBoolMap = function(opt_noLazyCreate) { +TestMapFieldsNoBinary.prototype.getMapStringBoolMap = function(opt_noLazyCreate) { return /** @type {!jspb.Map} */ ( jspb.Message.getMapField(this, 4, opt_noLazyCreate, null)); @@ -9166,7 +9119,7 @@ proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapStringBoolMap = function(o * Clears values from the map. The map will be non-null. * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this */ -proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapStringBoolMap = function() { +TestMapFieldsNoBinary.prototype.clearMapStringBoolMap = function() { this.getMapStringBoolMap().clear(); return this; }; @@ -9178,7 +9131,7 @@ proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapStringBoolMap = function * empty, instead returning `undefined` * @return {!jspb.Map} */ -proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapStringDoubleMap = function(opt_noLazyCreate) { +TestMapFieldsNoBinary.prototype.getMapStringDoubleMap = function(opt_noLazyCreate) { return /** @type {!jspb.Map} */ ( jspb.Message.getMapField(this, 5, opt_noLazyCreate, null)); @@ -9189,7 +9142,7 @@ proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapStringDoubleMap = function * Clears values from the map. The map will be non-null. * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this */ -proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapStringDoubleMap = function() { +TestMapFieldsNoBinary.prototype.clearMapStringDoubleMap = function() { this.getMapStringDoubleMap().clear(); return this; }; @@ -9201,7 +9154,7 @@ proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapStringDoubleMap = functi * empty, instead returning `undefined` * @return {!jspb.Map} */ -proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapStringEnumMap = function(opt_noLazyCreate) { +TestMapFieldsNoBinary.prototype.getMapStringEnumMap = function(opt_noLazyCreate) { return /** @type {!jspb.Map} */ ( jspb.Message.getMapField(this, 6, opt_noLazyCreate, null)); @@ -9212,7 +9165,7 @@ proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapStringEnumMap = function(o * Clears values from the map. The map will be non-null. * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this */ -proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapStringEnumMap = function() { +TestMapFieldsNoBinary.prototype.clearMapStringEnumMap = function() { this.getMapStringEnumMap().clear(); return this; }; @@ -9224,10 +9177,10 @@ proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapStringEnumMap = function * empty, instead returning `undefined` * @return {!jspb.Map} */ -proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapStringMsgMap = function(opt_noLazyCreate) { +TestMapFieldsNoBinary.prototype.getMapStringMsgMap = function(opt_noLazyCreate) { return /** @type {!jspb.Map} */ ( jspb.Message.getMapField(this, 7, opt_noLazyCreate, - proto.jspb.test.MapValueMessageNoBinary)); + MapValueMessageNoBinary)); }; @@ -9235,7 +9188,7 @@ proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapStringMsgMap = function(op * Clears values from the map. The map will be non-null. * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this */ -proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapStringMsgMap = function() { +TestMapFieldsNoBinary.prototype.clearMapStringMsgMap = function() { this.getMapStringMsgMap().clear(); return this; }; @@ -9247,7 +9200,7 @@ proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapStringMsgMap = function( * empty, instead returning `undefined` * @return {!jspb.Map} */ -proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapInt32StringMap = function(opt_noLazyCreate) { +TestMapFieldsNoBinary.prototype.getMapInt32StringMap = function(opt_noLazyCreate) { return /** @type {!jspb.Map} */ ( jspb.Message.getMapField(this, 8, opt_noLazyCreate, null)); @@ -9258,7 +9211,7 @@ proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapInt32StringMap = function( * Clears values from the map. The map will be non-null. * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this */ -proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapInt32StringMap = function() { +TestMapFieldsNoBinary.prototype.clearMapInt32StringMap = function() { this.getMapInt32StringMap().clear(); return this; }; @@ -9270,7 +9223,7 @@ proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapInt32StringMap = functio * empty, instead returning `undefined` * @return {!jspb.Map} */ -proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapInt64StringMap = function(opt_noLazyCreate) { +TestMapFieldsNoBinary.prototype.getMapInt64StringMap = function(opt_noLazyCreate) { return /** @type {!jspb.Map} */ ( jspb.Message.getMapField(this, 9, opt_noLazyCreate, null)); @@ -9281,7 +9234,7 @@ proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapInt64StringMap = function( * Clears values from the map. The map will be non-null. * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this */ -proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapInt64StringMap = function() { +TestMapFieldsNoBinary.prototype.clearMapInt64StringMap = function() { this.getMapInt64StringMap().clear(); return this; }; @@ -9293,7 +9246,7 @@ proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapInt64StringMap = functio * empty, instead returning `undefined` * @return {!jspb.Map} */ -proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapBoolStringMap = function(opt_noLazyCreate) { +TestMapFieldsNoBinary.prototype.getMapBoolStringMap = function(opt_noLazyCreate) { return /** @type {!jspb.Map} */ ( jspb.Message.getMapField(this, 10, opt_noLazyCreate, null)); @@ -9304,7 +9257,7 @@ proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapBoolStringMap = function(o * Clears values from the map. The map will be non-null. * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this */ -proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapBoolStringMap = function() { +TestMapFieldsNoBinary.prototype.clearMapBoolStringMap = function() { this.getMapBoolStringMap().clear(); return this; }; @@ -9314,9 +9267,9 @@ proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapBoolStringMap = function * optional TestMapFieldsNoBinary test_map_fields = 11; * @return {?proto.jspb.test.TestMapFieldsNoBinary} */ -proto.jspb.test.TestMapFieldsNoBinary.prototype.getTestMapFields = function() { +TestMapFieldsNoBinary.prototype.getTestMapFields = function() { return /** @type{?proto.jspb.test.TestMapFieldsNoBinary} */ ( - jspb.Message.getWrapperField(this, proto.jspb.test.TestMapFieldsNoBinary, 11)); + jspb.Message.getWrapperField(this, TestMapFieldsNoBinary, 11)); }; @@ -9324,7 +9277,7 @@ proto.jspb.test.TestMapFieldsNoBinary.prototype.getTestMapFields = function() { * @param {?proto.jspb.test.TestMapFieldsNoBinary|undefined} value * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this */ -proto.jspb.test.TestMapFieldsNoBinary.prototype.setTestMapFields = function(value) { +TestMapFieldsNoBinary.prototype.setTestMapFields = function(value) { return jspb.Message.setWrapperField(this, 11, value); }; @@ -9333,7 +9286,7 @@ proto.jspb.test.TestMapFieldsNoBinary.prototype.setTestMapFields = function(valu * Clears the message field making it undefined. * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this */ -proto.jspb.test.TestMapFieldsNoBinary.prototype.clearTestMapFields = function() { +TestMapFieldsNoBinary.prototype.clearTestMapFields = function() { return this.setTestMapFields(undefined); }; @@ -9342,7 +9295,7 @@ proto.jspb.test.TestMapFieldsNoBinary.prototype.clearTestMapFields = function() * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.TestMapFieldsNoBinary.prototype.hasTestMapFields = function() { +TestMapFieldsNoBinary.prototype.hasTestMapFields = function() { return jspb.Message.getField(this, 11) != null; }; @@ -9353,10 +9306,10 @@ proto.jspb.test.TestMapFieldsNoBinary.prototype.hasTestMapFields = function() { * empty, instead returning `undefined` * @return {!jspb.Map} */ -proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapStringTestmapfieldsMap = function(opt_noLazyCreate) { +TestMapFieldsNoBinary.prototype.getMapStringTestmapfieldsMap = function(opt_noLazyCreate) { return /** @type {!jspb.Map} */ ( jspb.Message.getMapField(this, 12, opt_noLazyCreate, - proto.jspb.test.TestMapFieldsNoBinary)); + TestMapFieldsNoBinary)); }; @@ -9364,7 +9317,7 @@ proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapStringTestmapfieldsMap = f * Clears values from the map. The map will be non-null. * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this */ -proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapStringTestmapfieldsMap = function() { +TestMapFieldsNoBinary.prototype.clearMapStringTestmapfieldsMap = function() { this.getMapStringTestmapfieldsMap().clear(); return this; }; @@ -9386,8 +9339,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.jspb.test.MapValueMessageNoBinary.prototype.toObject = function(opt_includeInstance) { - return proto.jspb.test.MapValueMessageNoBinary.toObject(opt_includeInstance, this); +MapValueMessageNoBinary.prototype.toObject = function(opt_includeInstance) { + return MapValueMessageNoBinary.toObject(opt_includeInstance, this); }; @@ -9400,7 +9353,7 @@ proto.jspb.test.MapValueMessageNoBinary.prototype.toObject = function(opt_includ * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.MapValueMessageNoBinary.toObject = function(includeInstance, msg) { +MapValueMessageNoBinary.toObject = function(includeInstance, msg) { var f, obj = { foo: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f }; @@ -9418,10 +9371,10 @@ foo: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.jspb.test.MapValueMessageNoBinary} */ -proto.jspb.test.MapValueMessageNoBinary.deserializeBinary = function(bytes) { +MapValueMessageNoBinary.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.jspb.test.MapValueMessageNoBinary; - return proto.jspb.test.MapValueMessageNoBinary.deserializeBinaryFromReader(msg, reader); + var msg = new MapValueMessageNoBinary; + return MapValueMessageNoBinary.deserializeBinaryFromReader(msg, reader); }; @@ -9432,7 +9385,7 @@ proto.jspb.test.MapValueMessageNoBinary.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.jspb.test.MapValueMessageNoBinary} */ -proto.jspb.test.MapValueMessageNoBinary.deserializeBinaryFromReader = function(msg, reader) { +MapValueMessageNoBinary.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -9456,9 +9409,9 @@ proto.jspb.test.MapValueMessageNoBinary.deserializeBinaryFromReader = function(m * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.jspb.test.MapValueMessageNoBinary.prototype.serializeBinary = function() { +MapValueMessageNoBinary.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.jspb.test.MapValueMessageNoBinary.serializeBinaryToWriter(this, writer); + MapValueMessageNoBinary.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -9470,7 +9423,7 @@ proto.jspb.test.MapValueMessageNoBinary.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.MapValueMessageNoBinary.serializeBinaryToWriter = function(message, writer) { +MapValueMessageNoBinary.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = /** @type {number} */ (jspb.Message.getField(message, 1)); if (f != null) { @@ -9486,7 +9439,7 @@ proto.jspb.test.MapValueMessageNoBinary.serializeBinaryToWriter = function(messa * optional int32 foo = 1; * @return {number} */ -proto.jspb.test.MapValueMessageNoBinary.prototype.getFoo = function() { +MapValueMessageNoBinary.prototype.getFoo = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; @@ -9495,7 +9448,7 @@ proto.jspb.test.MapValueMessageNoBinary.prototype.getFoo = function() { * @param {number} value * @return {!proto.jspb.test.MapValueMessageNoBinary} returns this */ -proto.jspb.test.MapValueMessageNoBinary.prototype.setFoo = function(value) { +MapValueMessageNoBinary.prototype.setFoo = function(value) { return jspb.Message.setField(this, 1, value); }; @@ -9504,7 +9457,7 @@ proto.jspb.test.MapValueMessageNoBinary.prototype.setFoo = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.MapValueMessageNoBinary} returns this */ -proto.jspb.test.MapValueMessageNoBinary.prototype.clearFoo = function() { +MapValueMessageNoBinary.prototype.clearFoo = function() { return jspb.Message.setField(this, 1, undefined); }; @@ -9513,7 +9466,7 @@ proto.jspb.test.MapValueMessageNoBinary.prototype.clearFoo = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.MapValueMessageNoBinary.prototype.hasFoo = function() { +MapValueMessageNoBinary.prototype.hasFoo = function() { return jspb.Message.getField(this, 1) != null; }; @@ -9534,8 +9487,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.jspb.test.Deeply.prototype.toObject = function(opt_includeInstance) { - return proto.jspb.test.Deeply.toObject(opt_includeInstance, this); +Deeply.prototype.toObject = function(opt_includeInstance) { + return Deeply.toObject(opt_includeInstance, this); }; @@ -9548,7 +9501,7 @@ proto.jspb.test.Deeply.prototype.toObject = function(opt_includeInstance) { * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.Deeply.toObject = function(includeInstance, msg) { +Deeply.toObject = function(includeInstance, msg) { var f, obj = { }; @@ -9566,10 +9519,10 @@ proto.jspb.test.Deeply.toObject = function(includeInstance, msg) { * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.jspb.test.Deeply} */ -proto.jspb.test.Deeply.deserializeBinary = function(bytes) { +Deeply.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.jspb.test.Deeply; - return proto.jspb.test.Deeply.deserializeBinaryFromReader(msg, reader); + var msg = new Deeply; + return Deeply.deserializeBinaryFromReader(msg, reader); }; @@ -9580,7 +9533,7 @@ proto.jspb.test.Deeply.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.jspb.test.Deeply} */ -proto.jspb.test.Deeply.deserializeBinaryFromReader = function(msg, reader) { +Deeply.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -9600,9 +9553,9 @@ proto.jspb.test.Deeply.deserializeBinaryFromReader = function(msg, reader) { * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.jspb.test.Deeply.prototype.serializeBinary = function() { +Deeply.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.jspb.test.Deeply.serializeBinaryToWriter(this, writer); + Deeply.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -9614,7 +9567,7 @@ proto.jspb.test.Deeply.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.Deeply.serializeBinaryToWriter = function(message, writer) { +Deeply.serializeBinaryToWriter = function(message, writer) { var f = undefined; }; @@ -9635,8 +9588,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.jspb.test.Deeply.Nested.prototype.toObject = function(opt_includeInstance) { - return proto.jspb.test.Deeply.Nested.toObject(opt_includeInstance, this); +Deeply.Nested.prototype.toObject = function(opt_includeInstance) { + return Deeply.Nested.toObject(opt_includeInstance, this); }; @@ -9649,7 +9602,7 @@ proto.jspb.test.Deeply.Nested.prototype.toObject = function(opt_includeInstance) * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.Deeply.Nested.toObject = function(includeInstance, msg) { +Deeply.Nested.toObject = function(includeInstance, msg) { var f, obj = { }; @@ -9667,10 +9620,10 @@ proto.jspb.test.Deeply.Nested.toObject = function(includeInstance, msg) { * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.jspb.test.Deeply.Nested} */ -proto.jspb.test.Deeply.Nested.deserializeBinary = function(bytes) { +Deeply.Nested.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.jspb.test.Deeply.Nested; - return proto.jspb.test.Deeply.Nested.deserializeBinaryFromReader(msg, reader); + var msg = new Deeply.Nested; + return Deeply.Nested.deserializeBinaryFromReader(msg, reader); }; @@ -9681,7 +9634,7 @@ proto.jspb.test.Deeply.Nested.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.jspb.test.Deeply.Nested} */ -proto.jspb.test.Deeply.Nested.deserializeBinaryFromReader = function(msg, reader) { +Deeply.Nested.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -9701,9 +9654,9 @@ proto.jspb.test.Deeply.Nested.deserializeBinaryFromReader = function(msg, reader * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.jspb.test.Deeply.Nested.prototype.serializeBinary = function() { +Deeply.Nested.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.jspb.test.Deeply.Nested.serializeBinaryToWriter(this, writer); + Deeply.Nested.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -9715,7 +9668,7 @@ proto.jspb.test.Deeply.Nested.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.Deeply.Nested.serializeBinaryToWriter = function(message, writer) { +Deeply.Nested.serializeBinaryToWriter = function(message, writer) { var f = undefined; }; @@ -9736,8 +9689,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.jspb.test.Deeply.Nested.Message.prototype.toObject = function(opt_includeInstance) { - return proto.jspb.test.Deeply.Nested.Message.toObject(opt_includeInstance, this); +Deeply.Nested.Message.prototype.toObject = function(opt_includeInstance) { + return Deeply.Nested.Message.toObject(opt_includeInstance, this); }; @@ -9750,7 +9703,7 @@ proto.jspb.test.Deeply.Nested.Message.prototype.toObject = function(opt_includeI * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.Deeply.Nested.Message.toObject = function(includeInstance, msg) { +Deeply.Nested.Message.toObject = function(includeInstance, msg) { var f, obj = { count: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f }; @@ -9768,10 +9721,10 @@ count: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.jspb.test.Deeply.Nested.Message} */ -proto.jspb.test.Deeply.Nested.Message.deserializeBinary = function(bytes) { +Deeply.Nested.Message.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.jspb.test.Deeply.Nested.Message; - return proto.jspb.test.Deeply.Nested.Message.deserializeBinaryFromReader(msg, reader); + var msg = new Deeply.Nested.Message; + return Deeply.Nested.Message.deserializeBinaryFromReader(msg, reader); }; @@ -9782,7 +9735,7 @@ proto.jspb.test.Deeply.Nested.Message.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.jspb.test.Deeply.Nested.Message} */ -proto.jspb.test.Deeply.Nested.Message.deserializeBinaryFromReader = function(msg, reader) { +Deeply.Nested.Message.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -9806,9 +9759,9 @@ proto.jspb.test.Deeply.Nested.Message.deserializeBinaryFromReader = function(msg * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.jspb.test.Deeply.Nested.Message.prototype.serializeBinary = function() { +Deeply.Nested.Message.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.jspb.test.Deeply.Nested.Message.serializeBinaryToWriter(this, writer); + Deeply.Nested.Message.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -9820,7 +9773,7 @@ proto.jspb.test.Deeply.Nested.Message.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.jspb.test.Deeply.Nested.Message.serializeBinaryToWriter = function(message, writer) { +Deeply.Nested.Message.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = /** @type {number} */ (jspb.Message.getField(message, 1)); if (f != null) { @@ -9836,7 +9789,7 @@ proto.jspb.test.Deeply.Nested.Message.serializeBinaryToWriter = function(message * optional int32 count = 1; * @return {number} */ -proto.jspb.test.Deeply.Nested.Message.prototype.getCount = function() { +Deeply.Nested.Message.prototype.getCount = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; @@ -9845,7 +9798,7 @@ proto.jspb.test.Deeply.Nested.Message.prototype.getCount = function() { * @param {number} value * @return {!proto.jspb.test.Deeply.Nested.Message} returns this */ -proto.jspb.test.Deeply.Nested.Message.prototype.setCount = function(value) { +Deeply.Nested.Message.prototype.setCount = function(value) { return jspb.Message.setField(this, 1, value); }; @@ -9854,7 +9807,7 @@ proto.jspb.test.Deeply.Nested.Message.prototype.setCount = function(value) { * Clears the field making it undefined. * @return {!proto.jspb.test.Deeply.Nested.Message} returns this */ -proto.jspb.test.Deeply.Nested.Message.prototype.clearCount = function() { +Deeply.Nested.Message.prototype.clearCount = function() { return jspb.Message.setField(this, 1, undefined); }; @@ -9863,7 +9816,7 @@ proto.jspb.test.Deeply.Nested.Message.prototype.clearCount = function() { * Returns whether this field is set. * @return {boolean} */ -proto.jspb.test.Deeply.Nested.Message.prototype.hasCount = function() { +Deeply.Nested.Message.prototype.hasCount = function() { return jspb.Message.getField(this, 1) != null; }; @@ -9871,7 +9824,7 @@ proto.jspb.test.Deeply.Nested.Message.prototype.hasCount = function() { /** * @enum {number} */ -proto.jspb.test.OuterEnum = { +export const OuterEnum = { FOO: 1, BAR: 2 }; @@ -9879,7 +9832,7 @@ proto.jspb.test.OuterEnum = { /** * @enum {number} */ -proto.jspb.test.MapValueEnumNoBinary = { +export const MapValueEnumNoBinary = { MAP_VALUE_FOO_NOBINARY: 0, MAP_VALUE_BAR_NOBINARY: 1, MAP_VALUE_BAZ_NOBINARY: 2 @@ -9888,7 +9841,7 @@ proto.jspb.test.MapValueEnumNoBinary = { /** * @enum {number} */ -proto.jspb.test.TestAllowAliasEnum = { +export const TestAllowAliasEnum = { TEST_ALLOW_ALIAS_DEFAULT: 0, VALUE1: 1 }; @@ -9899,24 +9852,24 @@ proto.jspb.test.TestAllowAliasEnum = { * field named `simple1`. * @type {!jspb.ExtensionFieldInfo} */ -proto.jspb.test.simple1 = new jspb.ExtensionFieldInfo( +export const simple1 = new jspb.ExtensionFieldInfo( 105, {simple1: 0}, - proto.jspb.test.Simple1, + Simple1, /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( - proto.jspb.test.Simple1.toObject), + Simple1.toObject), 0); -proto.jspb.test.HasExtensions.extensionsBinary[105] = new jspb.ExtensionFieldBinaryInfo( - proto.jspb.test.simple1, +HasExtensions.extensionsBinary[105] = new jspb.ExtensionFieldBinaryInfo( + simple1, jspb.BinaryReader.prototype.readMessage, jspb.BinaryWriter.prototype.writeMessage, - proto.jspb.test.Simple1.serializeBinaryToWriter, - proto.jspb.test.Simple1.deserializeBinaryFromReader, + Simple1.serializeBinaryToWriter, + Simple1.deserializeBinaryFromReader, false); // This registers the extension field with the extended class, so that // toObject() will function correctly. -proto.jspb.test.HasExtensions.extensions[105] = proto.jspb.test.simple1; +HasExtensions.extensions[105] = simple1; /** @@ -9924,7 +9877,7 @@ proto.jspb.test.HasExtensions.extensions[105] = proto.jspb.test.simple1; * field named `extendTestLastFieldBeforePivotField`. * @type {!jspb.ExtensionFieldInfo} */ -proto.jspb.test.extendTestLastFieldBeforePivotField = new jspb.ExtensionFieldInfo( +export const extendTestLastFieldBeforePivotField = new jspb.ExtensionFieldInfo( 101, {extendTestLastFieldBeforePivotField: 0}, null, @@ -9932,8 +9885,8 @@ proto.jspb.test.extendTestLastFieldBeforePivotField = new jspb.ExtensionFieldInf null), 0); -proto.jspb.test.TestLastFieldBeforePivot.extensionsBinary[101] = new jspb.ExtensionFieldBinaryInfo( - proto.jspb.test.extendTestLastFieldBeforePivotField, +TestLastFieldBeforePivot.extensionsBinary[101] = new jspb.ExtensionFieldBinaryInfo( + extendTestLastFieldBeforePivotField, jspb.BinaryReader.prototype.readInt32, jspb.BinaryWriter.prototype.writeInt32, undefined, @@ -9941,52 +9894,18 @@ proto.jspb.test.TestLastFieldBeforePivot.extensionsBinary[101] = new jspb.Extens false); // This registers the extension field with the extended class, so that // toObject() will function correctly. -proto.jspb.test.TestLastFieldBeforePivot.extensions[101] = proto.jspb.test.extendTestLastFieldBeforePivotField; - -export const BooleanFields = proto.jspb.test.BooleanFields; -export const CloneExtension = proto.jspb.test.CloneExtension; -export const Complex = proto.jspb.test.Complex; -export const ComplexNested = proto.jspb.test.Complex.Nested; -export const Deeply = proto.jspb.test.Deeply; -export const DeeplyNested = proto.jspb.test.Deeply.Nested; -export const DeeplyNestedMessage = proto.jspb.test.Deeply.Nested.Message; -export const DefaultValues = proto.jspb.test.DefaultValues; -export const DefaultValuesEnum = proto.jspb.test.DefaultValues.Enum; -export const Empty = proto.jspb.test.Empty; -export const EnumContainer = proto.jspb.test.EnumContainer; -export const FloatingPointFields = proto.jspb.test.FloatingPointFields; -export const HasExtensions = proto.jspb.test.HasExtensions; -export const IndirectExtension = proto.jspb.test.IndirectExtension; -export const Int64Types = proto.jspb.test.Int64Types; -export const IsExtension = proto.jspb.test.IsExtension; -export const MapValueEnumNoBinary = proto.jspb.test.MapValueEnumNoBinary; -export const MapValueMessageNoBinary = proto.jspb.test.MapValueMessageNoBinary; -export const MineField = proto.jspb.test.MineField; -export const OptionalFields = proto.jspb.test.OptionalFields; -export const OptionalFieldsNested = proto.jspb.test.OptionalFields.Nested; -export const OuterEnum = proto.jspb.test.OuterEnum; -export const OuterMessage = proto.jspb.test.OuterMessage; -export const OuterMessageComplex = proto.jspb.test.OuterMessage.Complex; -export const Simple1 = proto.jspb.test.Simple1; -export const Simple2 = proto.jspb.test.Simple2; -export const SpecialCases = proto.jspb.test.SpecialCases; -export const TestAllowAliasEnum = proto.jspb.test.TestAllowAliasEnum; -export const TestClone = proto.jspb.test.TestClone; -export const TestCloneExtension = proto.jspb.test.TestCloneExtension; -export const TestEndsWithBytes = proto.jspb.test.TestEndsWithBytes; -export const TestGroup = proto.jspb.test.TestGroup; -export const TestGroupOptionalGroup = proto.jspb.test.TestGroup.OptionalGroup; -export const TestGroupRepeatedGroup = proto.jspb.test.TestGroup.RepeatedGroup; -export const TestGroupRequiredGroup = proto.jspb.test.TestGroup.RequiredGroup; -export const TestGroup1 = proto.jspb.test.TestGroup1; -export const TestLastFieldBeforePivot = proto.jspb.test.TestLastFieldBeforePivot; -export const TestMapFieldsNoBinary = proto.jspb.test.TestMapFieldsNoBinary; -export const TestMessageWithOneof = proto.jspb.test.TestMessageWithOneof; -export const TestMessageWithOneofDefaultOneofACase = proto.jspb.test.TestMessageWithOneof.DefaultOneofACase; -export const TestMessageWithOneofDefaultOneofBCase = proto.jspb.test.TestMessageWithOneof.DefaultOneofBCase; -export const TestMessageWithOneofPartialOneofCase = proto.jspb.test.TestMessageWithOneof.PartialOneofCase; -export const TestMessageWithOneofRecursiveOneofCase = proto.jspb.test.TestMessageWithOneof.RecursiveOneofCase; -export const TestReservedNames = proto.jspb.test.TestReservedNames; -export const TestReservedNamesExtension = proto.jspb.test.TestReservedNamesExtension; -export const extendTestLastFieldBeforePivotField = proto.jspb.test.extendTestLastFieldBeforePivotField; -export const simple1 = proto.jspb.test.simple1; +TestLastFieldBeforePivot.extensions[101] = extendTestLastFieldBeforePivotField; + +export const ComplexNested = Complex.Nested; +export const DeeplyNested = Deeply.Nested; +export const DeeplyNestedMessage = Deeply.Nested.Message; +export const DefaultValuesEnum = DefaultValues.Enum; +export const OptionalFieldsNested = OptionalFields.Nested; +export const OuterMessageComplex = OuterMessage.Complex; +export const TestGroupOptionalGroup = TestGroup.OptionalGroup; +export const TestGroupRepeatedGroup = TestGroup.RepeatedGroup; +export const TestGroupRequiredGroup = TestGroup.RequiredGroup; +export const TestMessageWithOneofDefaultOneofACase = TestMessageWithOneof.DefaultOneofACase; +export const TestMessageWithOneofDefaultOneofBCase = TestMessageWithOneof.DefaultOneofBCase; +export const TestMessageWithOneofPartialOneofCase = TestMessageWithOneof.PartialOneofCase; +export const TestMessageWithOneofRecursiveOneofCase = TestMessageWithOneof.RecursiveOneofCase; diff --git a/generator/js_generator.cc b/generator/js_generator.cc index fcbd3bb..3a77518 100644 --- a/generator/js_generator.cc +++ b/generator/js_generator.cc @@ -180,11 +180,12 @@ std::string GetNestedMessageName(const Descriptor* descriptor) { return result; } -// Returns the path prefix for a message or enumeration that -// lives under the given file and containing type. -std::string GetPrefix(const GeneratorOptions& options, - const FileDescriptor* file_descriptor, - const Descriptor* containing_type) { +// Returns the fully-qualified path prefix for a message or enumeration that +// lives under the given file and containing type. Used for everything non-ES6, +// as well as specific ES6 uses where fully-qualified is needed. +std::string GetQualifiedPrefix(const GeneratorOptions& options, + const FileDescriptor* file_descriptor, + const Descriptor* containing_type) { std::string prefix = GetNamespace(options, file_descriptor) + GetNestedMessageName(containing_type); if (!prefix.empty()) { @@ -193,57 +194,157 @@ std::string GetPrefix(const GeneratorOptions& options, return prefix; } -// Returns the fully normalized JavaScript path prefix for the given +// Returns the import-relative path prefix for a message or enumeration that +// lives under the given file and containing type. Used for ES6 in most cases. +std::string GetRelativePrefix(const GeneratorOptions& options, + const FileDescriptor* file_descriptor, + const Descriptor* containing_type) { + std::string prefix = GetNestedMessageName(containing_type); + if (!prefix.empty()) { + prefix = prefix.substr(1, prefix.length() - 1); + prefix += "."; + } + return prefix; +} + +// Returns the normalized fully-qualified JavaScript path prefix for the given +// message descriptor. +std::string GetQualifiedMessagePathPrefix(const GeneratorOptions& options, + const Descriptor* descriptor) { + return GetQualifiedPrefix(options, descriptor->file(), + descriptor->containing_type()); +} + +// Returns the normalized import-relative JavaScript path prefix for the given // message descriptor. -std::string GetMessagePathPrefix(const GeneratorOptions& options, - const Descriptor* descriptor) { - return GetPrefix(options, descriptor->file(), descriptor->containing_type()); +std::string GetRelativeMessagePathPrefix(const GeneratorOptions& options, + const Descriptor* descriptor) { + return GetRelativePrefix(options, descriptor->file(), + descriptor->containing_type()); } -// Returns the fully normalized JavaScript path for the given +// Returns the normalized fully-qualified JavaScript path for the given // message descriptor. -std::string GetMessagePath(const GeneratorOptions& options, - const Descriptor* descriptor) { - return GetMessagePathPrefix(options, descriptor) + descriptor->name(); +std::string GetQualifiedMessagePath(const GeneratorOptions& options, + const Descriptor* descriptor) { + return GetQualifiedMessagePathPrefix(options, descriptor) + + descriptor->name(); +} + +// Returns the normalized import-relative JavaScript path for the given +// message descriptor. +std::string GetRelativeMessagePath(const GeneratorOptions& options, + const Descriptor* descriptor) { + return GetRelativeMessagePathPrefix(options, descriptor) + descriptor->name(); +} + +// Returns the normalized fully-qualified JavaScript path prefix for the given +// enumeration descriptor. +std::string GetQualifiedEnumPathPrefix(const GeneratorOptions& options, + const EnumDescriptor* enum_descriptor) { + return GetQualifiedPrefix(options, enum_descriptor->file(), + enum_descriptor->containing_type()); +} + +// Returns the normalized import-relative JavaScript path prefix for the given +// enumeration descriptor. +std::string GetRelativeEnumPathPrefix(const GeneratorOptions& options, + const EnumDescriptor* enum_descriptor) { + return GetRelativePrefix(options, enum_descriptor->file(), + enum_descriptor->containing_type()); } -// Returns the fully normalized JavaScript path prefix for the given +// Returns the normalized fully-qualified JavaScript path for the given // enumeration descriptor. -std::string GetEnumPathPrefix(const GeneratorOptions& options, - const EnumDescriptor* enum_descriptor) { - return GetPrefix(options, enum_descriptor->file(), - enum_descriptor->containing_type()); +std::string GetQualifiedEnumPath(const GeneratorOptions& options, + const EnumDescriptor* enum_descriptor) { + return GetQualifiedEnumPathPrefix(options, enum_descriptor) + + enum_descriptor->name(); } -// Returns the fully normalized JavaScript path for the given +// Returns the normalized import-relative JavaScript path for the given // enumeration descriptor. -std::string GetEnumPath(const GeneratorOptions& options, - const EnumDescriptor* enum_descriptor) { - return GetEnumPathPrefix(options, enum_descriptor) + enum_descriptor->name(); +std::string GetRelativeEnumPath(const GeneratorOptions& options, + const EnumDescriptor* enum_descriptor) { + return GetRelativeEnumPathPrefix(options, enum_descriptor) + + enum_descriptor->name(); } -std::string MaybeCrossFileRef(const GeneratorOptions& options, - const FileDescriptor* from_file, - const Descriptor* to_message) { +bool IsExportedMessage(const GeneratorOptions& options, + const Descriptor* desc) { + return options.import_style == GeneratorOptions::kImportEs6 && + GetNestedMessageName(desc->containing_type()).empty(); +} + +std::string LocalMessageRef(const GeneratorOptions& options, + const Descriptor* to_message) { + if (options.import_style == GeneratorOptions::kImportEs6) { + // in the same file for ES6, use the relative name directly + return GetRelativeMessagePath(options, to_message); + } else { + // Within a single file we use a full name. + return GetQualifiedMessagePath(options, to_message); + } +} + +std::string MaybeCrossFileMessageRef(const GeneratorOptions& options, + const FileDescriptor* from_file, + const Descriptor* to_message) { if ((options.import_style == GeneratorOptions::kImportCommonJs || options.import_style == GeneratorOptions::kImportCommonJsStrict || options.import_style == GeneratorOptions::kImportEs6) && from_file != to_message->file()) { - // Cross-file ref in CommonJS needs to use the module alias instead of - // the global name. - return ModuleAlias(to_message->file()->name()) + - GetNestedMessageName(to_message->containing_type()) + "." + - to_message->name(); + // Cross-file ref in CommonJS or ES6 needs to use the module alias instead + // of the global name. + return ModuleAlias(to_message->file()->name()) + "." + + GetRelativeMessagePath(options, to_message); + } else { + return LocalMessageRef(options, to_message); + } +} + +std::string LocalEnumRef(const GeneratorOptions& options, + const EnumDescriptor* to_enum) { + if (options.import_style == GeneratorOptions::kImportEs6) { + // in the same file for ES6, use the relative name directly + return GetRelativeEnumPath(options, to_enum); } else { // Within a single file we use a full name. - return GetMessagePath(options, to_message); + return GetQualifiedEnumPath(options, to_enum); + } +} + +bool IsExportedEnum(const GeneratorOptions& options, + const EnumDescriptor* desc) { + return options.import_style == GeneratorOptions::kImportEs6 && + GetNestedMessageName(desc->containing_type()).empty(); +} + +std::string MaybeCrossFileEnumRef(const GeneratorOptions& options, + const FileDescriptor* from_file, + const EnumDescriptor* to_enum) { + if ((options.import_style == GeneratorOptions::kImportCommonJs || + options.import_style == GeneratorOptions::kImportCommonJsStrict || + options.import_style == GeneratorOptions::kImportEs6) && + from_file != to_enum->file()) { + // Cross-file ref in CommonJS or ES6 needs to use the module alias instead + // of the global name. + return ModuleAlias(to_enum->file()->name()) + "." + + GetRelativeEnumPath(options, to_enum); + } else if (options.import_style == GeneratorOptions::kImportEs6) { + // in the same file for ES6, use the relative name directly + return GetRelativeEnumPath(options, to_enum); + } else { + // Within a single file we use a full name. + return GetQualifiedEnumPath(options, to_enum); } } std::string SubmessageTypeRef(const GeneratorOptions& options, const FieldDescriptor* field) { ABSL_CHECK(field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE); - return MaybeCrossFileRef(options, field->file(), field->message_type()); + return MaybeCrossFileMessageRef(options, field->file(), + field->message_type()); } // - Object field name: LOWER_UNDERSCORE -> LOWER_CAMEL, except for group fields @@ -893,11 +994,11 @@ std::string ProtoTypeName(const GeneratorOptions& options, case FieldDescriptor::TYPE_BYTES: return "bytes"; case FieldDescriptor::TYPE_GROUP: - return GetMessagePath(options, field->message_type()); + return GetQualifiedMessagePath(options, field->message_type()); case FieldDescriptor::TYPE_ENUM: - return GetEnumPath(options, field->enum_type()); + return GetQualifiedEnumPath(options, field->enum_type()); case FieldDescriptor::TYPE_MESSAGE: - return GetMessagePath(options, field->message_type()); + return GetQualifiedMessagePath(options, field->message_type()); default: return ""; } @@ -945,9 +1046,9 @@ std::string JSTypeName(const GeneratorOptions& options, case FieldDescriptor::CPPTYPE_STRING: return JSStringTypeName(options, field, bytes_mode); case FieldDescriptor::CPPTYPE_ENUM: - return GetEnumPath(options, field->enum_type()); + return GetQualifiedEnumPath(options, field->enum_type()); case FieldDescriptor::CPPTYPE_MESSAGE: - return GetMessagePath(options, field->message_type()); + return GetQualifiedMessagePath(options, field->message_type()); default: return ""; } @@ -1162,7 +1263,7 @@ static const char* kRepeatedFieldArrayName = ".repeatedFields_"; std::string RepeatedFieldsArrayName(const GeneratorOptions& options, const Descriptor* desc) { return HasRepeatedFields(options, desc) - ? (GetMessagePath(options, desc) + kRepeatedFieldArrayName) + ? (LocalMessageRef(options, desc) + kRepeatedFieldArrayName) : "null"; } @@ -1180,7 +1281,7 @@ static const char* kOneofGroupArrayName = ".oneofGroups_"; std::string OneofFieldsArrayName(const GeneratorOptions& options, const Descriptor* desc) { return HasOneofFields(desc) - ? (GetMessagePath(options, desc) + kOneofGroupArrayName) + ? (LocalMessageRef(options, desc) + kOneofGroupArrayName) : "null"; } @@ -1256,7 +1357,7 @@ std::string JSExtensionsObjectName(const GeneratorOptions& options, // TODO(haberman): fix this for the kImportCommonJs case. return "jspb.Message.messageSetExtensions"; } else { - return MaybeCrossFileRef(options, from_file, desc) + ".extensions"; + return MaybeCrossFileMessageRef(options, from_file, desc) + ".extensions"; } } @@ -1665,8 +1766,9 @@ void Generator::FindProvides(const GeneratorOptions& options, void FindProvidesForOneOfEnum(const GeneratorOptions& options, const OneofDescriptor* oneof, std::set* provided) { - std::string name = GetMessagePath(options, oneof->containing_type()) + "." + - JSOneofName(oneof) + "Case"; + std::string name = + GetQualifiedMessagePath(options, oneof->containing_type()) + "." + + JSOneofName(oneof) + "Case"; provided->insert(name); } @@ -1691,7 +1793,7 @@ void Generator::FindProvidesForMessage(const GeneratorOptions& options, return; } - std::string name = GetMessagePath(options, desc); + std::string name = GetQualifiedMessagePath(options, desc); provided->insert(name); for (int i = 0; i < desc->enum_type_count(); i++) { @@ -1708,7 +1810,7 @@ void Generator::FindProvidesForEnum(const GeneratorOptions& options, io::Printer* printer, const EnumDescriptor* enumdesc, std::set* provided) const { - std::string name = GetEnumPath(options, enumdesc); + std::string name = GetQualifiedEnumPath(options, enumdesc); provided->insert(name); } @@ -1751,6 +1853,9 @@ void Generator::GenerateProvides(const GeneratorOptions& options, namespaceObject.erase(0, 6); printer->Print("goog.exportSymbol('$name$', null, proto);\n", "name", namespaceObject); + } else if (options.import_style == GeneratorOptions::kImportEs6) { + // do nothing. we don't need `goog.*` behavior for ES6, and instead + // we'll `export ` things when we generate them. } else { printer->Print("goog.exportSymbol('$name$', null, global);\n", "name", *it); @@ -1818,7 +1923,8 @@ void Generator::GenerateRequiresForLibrary( } if (extension->containing_type()->full_name() != "google.protobuf.bridge.MessageSet") { - required.insert(GetMessagePath(options, extension->containing_type())); + required.insert( + GetQualifiedMessagePath(options, extension->containing_type())); } FindRequiresForField(options, extension, &required, &forwards); have_extensions = true; @@ -1929,13 +2035,13 @@ void Generator::FindRequiresForField(const GeneratorOptions& options, // dependencies, as per original codegen. !(field->is_extension() && field->extension_scope() == nullptr)) { if (options.add_require_for_enums) { - required->insert(GetEnumPath(options, field->enum_type())); + required->insert(GetQualifiedEnumPath(options, field->enum_type())); } else { - forwards->insert(GetEnumPath(options, field->enum_type())); + forwards->insert(GetQualifiedEnumPath(options, field->enum_type())); } } else if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) { if (!IgnoreMessage(field->message_type())) { - required->insert(GetMessagePath(options, field->message_type())); + required->insert(GetQualifiedMessagePath(options, field->message_type())); } } } @@ -1945,7 +2051,8 @@ void Generator::FindRequiresForExtension( std::set* required, std::set* forwards) const { if (field->containing_type()->full_name() != "google.protobuf.bridge.MessageSet") { - required->insert(GetMessagePath(options, field->containing_type())); + required->insert( + GetQualifiedMessagePath(options, field->containing_type())); } FindRequiresForField(options, field, required, forwards); } @@ -2032,10 +2139,14 @@ void Generator::GenerateClassConstructor(const GeneratorOptions& options, " * valid.\n" " * @extends {jspb.Message}\n" " * @constructor\n" - " */\n" - "$classprefix$$classname$ = function(opt_data) {\n", - "classprefix", GetMessagePathPrefix(options, desc), "classname", - desc->name()); + " */\n"); + if (IsExportedMessage(options, desc)) { + printer->Print("export function $classname$(opt_data) {\n", "classname", + LocalMessageRef(options, desc)); + } else { + printer->Print("$classname$ = function(opt_data) {\n", "classname", + LocalMessageRef(options, desc)); + } printer->Annotate("classname", desc); std::string message_id = GetMessageId(desc); printer->Print( @@ -2057,9 +2168,10 @@ void Generator::GenerateClassConstructor(const GeneratorOptions& options, " * @public\n" " * @override\n" " */\n" - " $classname$.displayName = '$classname$';\n" + " $classname$.displayName = '$displayname$';\n" "}\n", - "classname", GetMessagePath(options, desc)); + "classname", LocalMessageRef(options, desc), "displayname", + GetQualifiedMessagePath(options, desc)); } void Generator::GenerateClassConstructorAndDeclareExtensionFieldInfo( @@ -2092,7 +2204,7 @@ void Generator::GenerateClassFieldInfo(const GeneratorOptions& options, " */\n" "$classname$$rptfieldarray$ = $rptfields$;\n" "\n", - "classname", GetMessagePath(options, desc), "rptfieldarray", + "classname", LocalMessageRef(options, desc), "rptfieldarray", kRepeatedFieldArrayName, "rptfields", RepeatedFieldNumberList(options, desc)); } @@ -2113,7 +2225,7 @@ void Generator::GenerateClassFieldInfo(const GeneratorOptions& options, " */\n" "$classname$$oneofgrouparray$ = $oneofgroups$;\n" "\n", - "classname", GetMessagePath(options, desc), "oneofgrouparray", + "classname", LocalMessageRef(options, desc), "oneofgrouparray", kOneofGroupArrayName, "oneofgroups", OneofGroupList(desc)); for (int i = 0; i < desc->oneof_decl_count(); i++) { @@ -2131,8 +2243,9 @@ void Generator::GenerateClassXid(const GeneratorOptions& options, printer->Print( "\n" "\n" - "$class$.prototype.messageXid = xid('$class$');\n", - "class", GetMessagePath(options, desc)); + "$class$.prototype.messageXid = xid('$xid$');\n", + "class", LocalMessageRef(options, desc), "xid", + GetQualifiedMessagePath(options, desc)); } void Generator::GenerateOneofCaseDefinition( @@ -2144,7 +2257,7 @@ void Generator::GenerateOneofCaseDefinition( " */\n" "$classname$.$oneof$Case = {\n" " $upcase$_NOT_SET: 0", - "classname", GetMessagePath(options, oneof->containing_type()), "oneof", + "classname", LocalMessageRef(options, oneof->containing_type()), "oneof", JSOneofName(oneof), "upcase", ToEnumCase(oneof->name())); for (int i = 0; i < oneof->field_count(); i++) { @@ -2165,14 +2278,15 @@ void Generator::GenerateOneofCaseDefinition( "};\n" "\n" "/**\n" - " * @return {$class$.$oneof$Case}\n" + " * @return {$type$.$oneof$Case}\n" " */\n" "$class$.prototype.get$oneof$Case = function() {\n" - " return /** @type {$class$.$oneof$Case} */(jspb.Message." + " return /** @type {$type$.$oneof$Case} */(jspb.Message." "computeOneofCase(this, $class$.oneofGroups_[$oneofindex$]));\n" "};\n" "\n", - "class", GetMessagePath(options, oneof->containing_type()), "oneof", + "type", GetQualifiedMessagePath(options, oneof->containing_type()), + "class", LocalMessageRef(options, oneof->containing_type()), "oneof", JSOneofName(oneof), "oneofindex", JSOneofIndex(oneof)); } @@ -2208,13 +2322,14 @@ void Generator::GenerateClassToObject(const GeneratorOptions& options, "include\n" " * the JSPB instance for transitional soy proto support:\n" " * http://goto/soy-param-migration\n" - " * @param {!$classname$} msg The msg instance to transform.\n" + " * @param {!$typename$} msg The msg instance to transform.\n" " * @return {!Object}\n" " * @suppress {unusedLocalVariables} f is only used for nested messages\n" " */\n" "$classname$.toObject = function(includeInstance, msg) {\n" " var f, obj = {", - "classname", GetMessagePath(options, desc)); + "classname", LocalMessageRef(options, desc), "typename", + GetQualifiedMessagePath(options, desc)); bool first = true; for (int i = 0; i < desc->field_count(); i++) { @@ -2246,7 +2361,7 @@ void Generator::GenerateClassToObject(const GeneratorOptions& options, " $extObject$, $class$.prototype.getExtension,\n" " includeInstance);\n", "extObject", JSExtensionsObjectName(options, desc->file(), desc), - "class", GetMessagePath(options, desc)); + "class", LocalMessageRef(options, desc)); } printer->Print( @@ -2257,8 +2372,7 @@ void Generator::GenerateClassToObject(const GeneratorOptions& options, "};\n" "}\n" "\n" - "\n", - "classname", GetMessagePath(options, desc)); + "\n"); } void Generator::GenerateFieldValueExpression(io::Printer* printer, @@ -2322,7 +2436,7 @@ void Generator::GenerateClassFieldToObject(const GeneratorOptions& options, std::string value_to_object; if (value_field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) { value_to_object = - GetMessagePath(options, value_field->message_type()) + ".toObject"; + LocalMessageRef(options, value_field->message_type()) + ".toObject"; } else { value_to_object = "undefined"; } @@ -2382,7 +2496,8 @@ void Generator::GenerateObjectTypedef(const GeneratorOptions& options, const Descriptor* desc) const { // TODO(b/122687752): Consider renaming nested messages called ObjectFormat // to prevent collisions. - const std::string type_name = GetMessagePath(options, desc) + ".ObjectFormat"; + const std::string type_name = + LocalMessageRef(options, desc) + ".ObjectFormat"; printer->Print( "/**\n" @@ -2418,13 +2533,14 @@ void Generator::GenerateClassFromObject(const GeneratorOptions& options, printer->Print( "/**\n" " * Loads data from an object into a new instance of this proto.\n" - " * @param {!$classname$.ObjectFormat} obj\n" + " * @param {!$typename$.ObjectFormat} obj\n" " * The object representation of this proto to load the data from.\n" - " * @return {!$classname$}\n" + " * @return {!$typename$}\n" " */\n" "$classname$.fromObject = function(obj) {\n" " var msg = new $classname$();\n", - "classname", GetMessagePath(options, desc)); + "classname", LocalMessageRef(options, desc), "typename", + GetQualifiedMessagePath(options, desc)); for (int i = 0; i < desc->field_count(); i++) { const FieldDescriptor* field = desc->field(i); @@ -2453,7 +2569,7 @@ void Generator::GenerateClassFieldFromObject( "$fieldclass$.fromObject));\n", "name", JSObjectFieldName(options, field), "index", JSFieldIndex(field), "fieldclass", - GetMessagePath(options, value_field->message_type())); + LocalMessageRef(options, value_field->message_type())); } else { // `msg` is a newly-constructed message object that has not yet built any // map containers wrapping underlying arrays, so we can simply directly @@ -2538,7 +2654,7 @@ void GenerateBytesWrapper(const GeneratorOptions& options, io::Printer* printer, "\n", "fielddef", FieldDefinition(options, field), "comment", FieldComments(field, bytes_mode), "type", type, "class", - GetMessagePath(options, field->containing_type()), "name", + LocalMessageRef(options, field->containing_type()), "name", JSGetterName(options, field, bytes_mode), "list", field->is_repeated() ? "List" : "", "suffix", JSByteGetterSuffix(bytes_mode), "defname", @@ -2575,7 +2691,7 @@ void Generator::GenerateClassField(const GeneratorOptions& options, printer->Print( "$class$.prototype.$gettername$ = function(opt_noLazyCreate) {\n" " return /** @type {!jspb.Map<$keytype$,$valuetype$>} */ (\n", - "class", GetMessagePath(options, field->containing_type()), + "class", LocalMessageRef(options, field->containing_type()), "gettername", "get" + JSGetterName(options, field), "keytype", key_type, "valuetype", value_type); printer->Annotate("gettername", field); @@ -2587,7 +2703,7 @@ void Generator::GenerateClassField(const GeneratorOptions& options, printer->Print( ",\n" " $messageType$", - "messageType", GetMessagePath(options, value_field->message_type())); + "messageType", LocalMessageRef(options, value_field->message_type())); } else { printer->Print( ",\n" @@ -2624,7 +2740,7 @@ void Generator::GenerateClassField(const GeneratorOptions& options, "};\n" "\n" "\n", - "class", GetMessagePath(options, field->containing_type()), + "class", LocalMessageRef(options, field->containing_type()), "gettername", "get" + JSGetterName(options, field), "type", JSFieldTypeAnnotation(options, field, /* is_setter_argument = */ false, @@ -2638,7 +2754,7 @@ void Generator::GenerateClassField(const GeneratorOptions& options, printer->Print( "/**\n" " * @param {$optionaltype$} value\n" - " * @return {!$class$} returns this\n" + " * @return {!$returntype$} returns this\n" "*/\n" "$class$.prototype.$settername$ = function(value) {\n" " return jspb.Message.set$oneoftag$$repeatedtag$WrapperField(", @@ -2647,7 +2763,9 @@ void Generator::GenerateClassField(const GeneratorOptions& options, /* is_setter_argument = */ true, /* force_present = */ false, /* singular_if_not_packed = */ false), - "class", GetMessagePath(options, field->containing_type()), + "class", LocalMessageRef(options, field->containing_type()), + "returntype", + GetQualifiedMessagePath(options, field->containing_type()), "settername", "set" + JSGetterName(options, field), "oneoftag", (InRealOneof(field) ? "Oneof" : ""), "repeatedtag", (field->is_repeated() ? "Repeated" : "")); @@ -2700,7 +2818,7 @@ void Generator::GenerateClassField(const GeneratorOptions& options, } printer->Print("$class$.prototype.$gettername$ = function() {\n", "class", - GetMessagePath(options, field->containing_type()), + LocalMessageRef(options, field->containing_type()), "gettername", "get" + JSGetterName(options, field)); printer->Annotate("gettername", field); @@ -2750,7 +2868,7 @@ void Generator::GenerateClassField(const GeneratorOptions& options, " * @param {$optionaltype$} value\n" " * @return {!$class$} returns this\n" " */\n", - "class", GetMessagePath(options, field->containing_type()), + "class", GetQualifiedMessagePath(options, field->containing_type()), "optionaltype", untyped ? "*" : JSFieldTypeAnnotation(options, field, @@ -2769,7 +2887,7 @@ void Generator::GenerateClassField(const GeneratorOptions& options, "};\n" "\n" "\n", - "class", GetMessagePath(options, field->containing_type()), + "class", LocalMessageRef(options, field->containing_type()), "settername", "set" + JSGetterName(options, field), "typetag", JSTypeTag(field), "index", JSFieldIndex(field)); printer->Annotate("settername", field); @@ -2778,7 +2896,7 @@ void Generator::GenerateClassField(const GeneratorOptions& options, printer->Print( "$class$.prototype.$settername$ = function(value) {\n" " return jspb.Message.set$oneoftag$Field(this, $index$", - "class", GetMessagePath(options, field->containing_type()), + "class", LocalMessageRef(options, field->containing_type()), "settername", "set" + JSGetterName(options, field), "oneoftag", (InRealOneof(field) ? "Oneof" : ""), "index", JSFieldIndex(field)); printer->Annotate("settername", field); @@ -2800,7 +2918,7 @@ void Generator::GenerateClassField(const GeneratorOptions& options, " * Clears the value.\n" " * @return {!$class$} returns this\n" " */\n", - "class", GetMessagePath(options, field->containing_type())); + "class", GetQualifiedMessagePath(options, field->containing_type())); } if (field->is_repeated()) { @@ -2815,7 +2933,7 @@ void Generator::GenerateClassField(const GeneratorOptions& options, printer->Print( "/**\n" " * Clears values from the map. The map will be non-null.\n" - " * @return {!$class$} returns this\n" + " * @return {!$returntype$} returns this\n" " */\n" "$class$.prototype.$clearername$ = function() {\n" " this.$gettername$().clear();\n" @@ -2823,7 +2941,8 @@ void Generator::GenerateClassField(const GeneratorOptions& options, "};\n" "\n" "\n", - "class", GetMessagePath(options, field->containing_type()), + "class", LocalMessageRef(options, field->containing_type()), + "returntype", GetQualifiedMessagePath(options, field->containing_type()), "clearername", "clear" + JSGetterName(options, field), "gettername", "get" + JSGetterName(options, field)); // clang-format on @@ -2836,7 +2955,7 @@ void Generator::GenerateClassField(const GeneratorOptions& options, printer->Print( "/**\n" " * $jsdoc$\n" - " * @return {!$class$} returns this\n" + " * @return {!$returntype$} returns this\n" " */\n" "$class$.prototype.$clearername$ = function() {\n" " return this.$settername$($clearedvalue$);\n" @@ -2846,7 +2965,8 @@ void Generator::GenerateClassField(const GeneratorOptions& options, "jsdoc", field->is_repeated() ? "Clears the list making it empty but non-null." : "Clears the message field making it undefined.", - "class", GetMessagePath(options, field->containing_type()), + "class", LocalMessageRef(options, field->containing_type()), + "returntype", GetQualifiedMessagePath(options, field->containing_type()), "clearername", "clear" + JSGetterName(options, field), "settername", "set" + JSGetterName(options, field), "clearedvalue", (field->is_repeated() ? "[]" : "undefined")); @@ -2859,12 +2979,13 @@ void Generator::GenerateClassField(const GeneratorOptions& options, printer->Print( "/**\n" " * Clears the field making it undefined.\n" - " * @return {!$class$} returns this\n" + " * @return {!$returntype$} returns this\n" " */\n" "$class$.prototype.$clearername$ = function() {\n" " return jspb.Message.set$maybeoneof$Field(this, " "$index$$maybeoneofgroup$, ", - "class", GetMessagePath(options, field->containing_type()), + "class", LocalMessageRef(options, field->containing_type()), + "returntype", GetQualifiedMessagePath(options, field->containing_type()), "clearername", "clear" + JSGetterName(options, field), "maybeoneof", (InRealOneof(field) ? "Oneof" : ""), "maybeoneofgroup", (InRealOneof(field) @@ -2892,8 +3013,9 @@ void Generator::GenerateClassField(const GeneratorOptions& options, "};\n" "\n" "\n", - "class", GetMessagePath(options, field->containing_type()), "hasername", - "has" + JSGetterName(options, field), "index", JSFieldIndex(field)); + "class", LocalMessageRef(options, field->containing_type()), + "hasername", "has" + JSGetterName(options, field), "index", + JSFieldIndex(field)); printer->Annotate("hasername", field); } } @@ -2906,12 +3028,13 @@ void Generator::GenerateRepeatedPrimitiveHelperMethods( "/**\n" " * @param {$optionaltype$} value\n" " * @param {number=} opt_index\n" - " * @return {!$class$} returns this\n" + " * @return {!$returntype$} returns this\n" " */\n" "$class$.prototype.$addername$ = function(value, opt_index) {\n" " return jspb.Message.addToRepeatedField(this, " "$index$", - "class", GetMessagePath(options, field->containing_type()), "addername", + "class", LocalMessageRef(options, field->containing_type()), + "returntype", GetQualifiedMessagePath(options, field->containing_type()), "addername", "add" + JSGetterName(options, field, BYTES_DEFAULT, /* drop_list = */ true), "optionaltype", @@ -2942,14 +3065,16 @@ void Generator::GenerateRepeatedMessageHelperMethods( const FieldDescriptor* field) const { printer->Print( "/**\n" - " * @param {!$optionaltype$=} opt_value\n" + " * @param {$optionaltype$=} opt_value\n" " * @param {number=} opt_index\n" - " * @return {!$optionaltype$}\n" + " * @return {$optionaltype$}\n" " */\n" "$class$.prototype.$addername$ = function(opt_value, opt_index) {\n" " return jspb.Message.addTo$repeatedtag$WrapperField(", - "optionaltype", JSTypeName(options, field, BYTES_DEFAULT), "class", - GetMessagePath(options, field->containing_type()), "addername", + "optionaltype", + JSFieldTypeAnnotation(options, field, false, true, false, BYTES_DEFAULT, + true), + "class", LocalMessageRef(options, field->containing_type()), "addername", "add" + JSGetterName(options, field, BYTES_DEFAULT, /* drop_list = */ true), "repeatedtag", (field->is_repeated() ? "Repeated" : "")); @@ -2962,7 +3087,7 @@ void Generator::GenerateRepeatedMessageHelperMethods( "\n", "index", JSFieldIndex(field), "oneofgroup", (InRealOneof(field) ? (", " + JSOneofArray(options, field)) : ""), "ctor", - GetMessagePath(options, field->message_type())); + LocalMessageRef(options, field->message_type())); } void Generator::GenerateClassExtensionFieldInfo(const GeneratorOptions& options, @@ -2988,7 +3113,7 @@ void Generator::GenerateClassExtensionFieldInfo(const GeneratorOptions& options, " */\n" "$class$.extensions = {};\n" "\n", - "class", GetMessagePath(options, desc)); + "class", LocalMessageRef(options, desc)); printer->Print( "\n" @@ -3009,7 +3134,7 @@ void Generator::GenerateClassExtensionFieldInfo(const GeneratorOptions& options, " */\n" "$class$.extensionsBinary = {};\n" "\n", - "class", GetMessagePath(options, desc)); + "class", LocalMessageRef(options, desc)); } } @@ -3023,25 +3148,26 @@ void Generator::GenerateClassDeserializeBinary(const GeneratorOptions& options, "/**\n" " * Deserializes binary data (in protobuf wire format).\n" " * @param {jspb.ByteSource} bytes The bytes to deserialize.\n" - " * @return {!$class$}\n" + " * @return {!$classtype$}\n" " */\n" - "$class$.deserializeBinary = function(bytes) {\n" + "$classname$.deserializeBinary = function(bytes) {\n" " var reader = new jspb.BinaryReader(bytes);\n" - " var msg = new $class$;\n" - " return $class$.deserializeBinaryFromReader(msg, reader);\n" + " var msg = new $classname$;\n" + " return $classname$.deserializeBinaryFromReader(msg, reader);\n" "};\n" "\n" "\n" "/**\n" " * Deserializes binary data (in protobuf wire format) from the\n" " * given reader into the given message object.\n" - " * @param {!$class$} msg The message object to deserialize into.\n" + " * @param {!$classtype$} msg The message object to deserialize into.\n" " * @param {!jspb.BinaryReader} reader The BinaryReader to use.\n" - " * @return {!$class$}\n" + " * @return {!$classtype$}\n" " */\n" - "$class$.deserializeBinaryFromReader = function(msg, reader) {\n" + "$classname$.deserializeBinaryFromReader = function(msg, reader) {\n" " while (reader.nextField()) {\n", - "class", GetMessagePath(options, desc)); + "classname", LocalMessageRef(options, desc), "classtype", + GetQualifiedMessagePath(options, desc)); printer->Print( " if (reader.isEndGroup()) {\n" " break;\n" @@ -3065,7 +3191,7 @@ void Generator::GenerateClassDeserializeBinary(const GeneratorOptions& options, " break;\n" " }\n", "extobj", JSExtensionsObjectName(options, desc->file(), desc), "class", - GetMessagePath(options, desc)); + LocalMessageRef(options, desc)); } else { printer->Print( " reader.skipField();\n" @@ -3103,14 +3229,14 @@ void Generator::GenerateClassDeserializeBinaryField( if (value_field->type() == FieldDescriptor::TYPE_MESSAGE) { printer->Print(", $messageType$.deserializeBinaryFromReader", "messageType", - GetMessagePath(options, value_field->message_type())); + LocalMessageRef(options, value_field->message_type())); } else { printer->Print(", null"); } printer->Print(", $defaultKey$", "defaultKey", JSFieldDefault(key_field)); if (value_field->type() == FieldDescriptor::TYPE_MESSAGE) { printer->Print(", new $messageType$()", "messageType", - GetMessagePath(options, value_field->message_type())); + LocalMessageRef(options, value_field->message_type())); } else { printer->Print(", $defaultValue$", "defaultValue", JSFieldDefault(value_field)); @@ -3180,9 +3306,9 @@ void Generator::GenerateClassSerializeBinary(const GeneratorOptions& options, " * Serializes the message to binary data (in protobuf wire format).\n" " * @return {!Uint8Array}\n" " */\n" - "$class$.prototype.serializeBinary = function() {\n" + "$classname$.prototype.serializeBinary = function() {\n" " var writer = new jspb.BinaryWriter();\n" - " $class$.serializeBinaryToWriter(this, writer);\n" + " $classname$.serializeBinaryToWriter(this, writer);\n" " return writer.getResultBuffer();\n" "};\n" "\n" @@ -3190,14 +3316,15 @@ void Generator::GenerateClassSerializeBinary(const GeneratorOptions& options, "/**\n" " * Serializes the given message to binary data (in protobuf wire\n" " * format), writing to the given BinaryWriter.\n" - " * @param {!$class$} message\n" + " * @param {!$classtype$} message\n" " * @param {!jspb.BinaryWriter} writer\n" " * @suppress {unusedLocalVariables} f is only used for nested messages\n" " */\n" - "$class$.serializeBinaryToWriter = function(message, " + "$classname$.serializeBinaryToWriter = function(message, " "writer) {\n" " var f = undefined;\n", - "class", GetMessagePath(options, desc)); + "classname", LocalMessageRef(options, desc), "classtype", + GetQualifiedMessagePath(options, desc)); for (int i = 0; i < desc->field_count(); i++) { if (!IgnoreField(desc->field(i))) { @@ -3210,7 +3337,7 @@ void Generator::GenerateClassSerializeBinary(const GeneratorOptions& options, " jspb.Message.serializeBinaryExtensions(message, writer,\n" " $extobj$Binary, $class$.prototype.getExtension);\n", "extobj", JSExtensionsObjectName(options, desc->file(), desc), "class", - GetMessagePath(options, desc)); + LocalMessageRef(options, desc)); } printer->Print( @@ -3303,7 +3430,7 @@ void Generator::GenerateClassSerializeBinaryField( if (value_field->type() == FieldDescriptor::TYPE_MESSAGE) { printer->Print(", $messageType$.serializeBinaryToWriter", "messageType", - GetMessagePath(options, value_field->message_type())); + LocalMessageRef(options, value_field->message_type())); } printer->Print(");\n"); @@ -3338,11 +3465,15 @@ void Generator::GenerateEnum(const GeneratorOptions& options, printer->Print( "/**\n" " * @enum {number}\n" - " */\n" - "$enumprefix$$name$ = {\n", - "enumprefix", GetEnumPathPrefix(options, enumdesc), "name", - enumdesc->name()); - printer->Annotate("name", enumdesc); + " */\n"); + if (IsExportedEnum(options, enumdesc)) { + printer->Print("export const $enumname$ = {\n", "enumname", + LocalEnumRef(options, enumdesc)); + } else { + printer->Print("$enumname$ = {\n", "enumname", + LocalEnumRef(options, enumdesc)); + } + printer->Annotate("enumname", enumdesc); std::set used_name; std::vector valid_index; @@ -3369,11 +3500,6 @@ void Generator::GenerateEnum(const GeneratorOptions& options, void Generator::GenerateExtension(const GeneratorOptions& options, io::Printer* printer, const FieldDescriptor* field) const { - std::string extension_scope = - (field->extension_scope() - ? GetMessagePath(options, field->extension_scope()) - : GetNamespace(options, field->file())); - const std::string extension_object_name = JSObjectFieldName(options, field); printer->Print( "\n" @@ -3381,14 +3507,26 @@ void Generator::GenerateExtension(const GeneratorOptions& options, " * A tuple of {field number, class constructor} for the extension\n" " * field named `$nameInComment$`.\n" " * @type {!jspb.ExtensionFieldInfo<$extensionType$>}\n" - " */\n" - "$class$.$name$ = new jspb.ExtensionFieldInfo(\n", - "nameInComment", extension_object_name, "name", extension_object_name, - "class", extension_scope, "extensionType", + " */\n", + "nameInComment", extension_object_name, "extensionType", JSFieldTypeAnnotation(options, field, /* is_setter_argument = */ false, /* force_present = */ true, /* singular_if_not_packed = */ false)); + + const Descriptor* scope_desc = field->extension_scope(); + std::string extension_scope = + (scope_desc ? MaybeCrossFileMessageRef(options, field->file(), scope_desc) + : GetNamespace(options, field->file())); + if (!scope_desc && options.import_style == GeneratorOptions::kImportEs6) { + extension_scope = ""; + printer->Print("export const $name$ = new jspb.ExtensionFieldInfo(\n", + "name", extension_object_name); + } else { + extension_scope += "."; + printer->Print("$class$$name$ = new jspb.ExtensionFieldInfo(\n", "class", + extension_scope, "name", extension_object_name); + } printer->Annotate("name", field); printer->Print( " $index$,\n" @@ -3398,7 +3536,8 @@ void Generator::GenerateExtension(const GeneratorOptions& options, "!Object} */ (\n" " $toObject$),\n" " $repeated$);\n", - "index", absl::StrCat(field->number()), "name", extension_object_name, "ctor", + "index", absl::StrCat(field->number()), "name", extension_object_name, + "ctor", (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE ? SubmessageTypeRef(options, field) : std::string("null")), @@ -3411,7 +3550,7 @@ void Generator::GenerateExtension(const GeneratorOptions& options, printer->Print( "\n" "$extendName$Binary[$index$] = new jspb.ExtensionFieldBinaryInfo(\n" - " $class$.$name$,\n" + " $class$$name$,\n" " $binaryReaderFn$,\n" " $binaryWriterFn$,\n" " $binaryMessageSerializeFn$,\n" @@ -3436,7 +3575,7 @@ void Generator::GenerateExtension(const GeneratorOptions& options, printer->Print( "// This registers the extension field with the extended class, so that\n" "// toObject() will function correctly.\n" - "$extendName$[$index$] = $class$.$name$;\n" + "$extendName$[$index$] = $class$$name$;\n" "\n", "extendName", JSExtensionsObjectName(options, field->file(), field->containing_type()), @@ -3469,7 +3608,7 @@ bool GeneratorOptions::ParseFromOptions( } else if (option.first == "error_on_name_conflict") { ABSL_LOG(WARNING) << "Ignoring error_on_name_conflict option, this " - "will be removed in a future release"; + "will be removed in a future release"; } else if (option.first == "output_dir") { output_dir = option.second; } else if (option.first == "namespace_prefix") { @@ -3642,7 +3781,6 @@ void Generator::GenerateFile(const GeneratorOptions& options, if ((options.import_style == GeneratorOptions::kImportCommonJs || options.import_style == GeneratorOptions::kImportCommonJsStrict || options.import_style == GeneratorOptions::kImportEs6)) { - if (options.import_style == GeneratorOptions::kImportEs6) { printer->Print("import * as jspb from 'google-protobuf';\n"); } else { @@ -3688,10 +3826,11 @@ void Generator::GenerateFile(const GeneratorOptions& options, } else { for (int i = 0; i < file->dependency_count(); i++) { const std::string& name = file->dependency(i)->name(); - printer->Print("var $alias$ = require('$file$');\n" - "goog.object.extend(proto, $alias$);\n", - "alias", ModuleAlias(name), "file", - GetRootPath(file->name(), name) + GetJSFilename(options, name)); + printer->Print( + "var $alias$ = require('$file$');\n" + "goog.object.extend(proto, $alias$);\n", + "alias", ModuleAlias(name), "file", + GetRootPath(file->name(), name) + GetJSFilename(options, name)); } } } @@ -3741,14 +3880,17 @@ void Generator::GenerateFile(const GeneratorOptions& options, for (std::set::iterator it = provided.begin(); it != provided.end(); ++it) { std::string fullname = *it; - std::string name = fullname.substr(package.length()); - - std::string::iterator iend = std::remove(name.begin(), name.end(), '.'); - name.resize(name.length()-(name.end()-iend)); - name.shrink_to_fit(); - - printer->Print("export const $name$ = $fullname$;\n", - "name", name, "fullname", fullname); + std::string localname = fullname.substr(package.length() + 1); + std::string exportedname = localname; + std::string::iterator iend = + std::remove(exportedname.begin(), exportedname.end(), '.'); + exportedname.resize(exportedname.length() - (exportedname.end() - iend)); + exportedname.shrink_to_fit(); + // when exported name == local name, it's top level and already exported + if (exportedname != localname) { + printer->Print("export const $exportedname$ = $localname$;\n", + "exportedname", exportedname, "localname", localname); + } } } @@ -3788,47 +3930,18 @@ const std::string DTS_INDENT = " "; void Generator::GenerateDTS(const GeneratorOptions& options, io::Printer* printer, const FileDescriptor* file) const { - std::string ns = GetNamespace(options, file); - printer->Print("declare namespace $ns$ {\n", "ns", ns); + printer->Print("import * as jspb from 'google-protobuf';\n\n"); + + // determine other imports - const std::string& indent = DTS_INDENT; - std::set exported; for (int i = 0; i < file->message_type_count(); i++) { auto desc = file->message_type(i); - GenerateMessageDTS(options, printer, desc, indent); - exported.insert(desc->name()); + GenerateMessageDTS(options, printer, desc, ""); } + for (int i = 0; i < file->enum_type_count(); i++) { auto enumdesc = file->enum_type(i); - GenerateEnumDTS(options, printer, enumdesc, indent); - exported.insert(enumdesc->name()); - } - - printer->Print("}\n"); - - if (!exported.empty()) { - for (auto name : exported) { - std::string fullname = ns + "." + name; - printer->Print( - "\ndeclare module \"goog:$fullname$ \" {\n" - "$indent$import $name$ = $fullname$;\n" - "$indent$export default $name$;\n" - "}\n", - "name", name, "fullname", fullname, "indent", indent); - } - - printer->Print("\n"); - for (auto name : exported) { - std::string fullname = ns + "." + name; - printer->Print("import $name$ = $fullname$;\n", "name", name, "fullname", - fullname); - } - printer->Print("\n"); - printer->Print("export {\n"); - for (auto name : exported) { - printer->Print("$indent$$name$,\n", "name", name, "indent", indent); - } - printer->Print("};\n"); + GenerateEnumDTS(options, printer, enumdesc, ""); } // Emit well-known type methods. @@ -3847,8 +3960,13 @@ void Generator::GenerateMessageDTS(const GeneratorOptions& options, return; } - printer->Print("$indent$export class $classname$ extends jspb.Message {\n", - "classname", desc->name(), "indent", indent); + std::string prefix = indent; + if (indent == "") { + prefix = "export "; + } + + printer->Print("$prefix$class $classname$ extends jspb.Message {\n", + "classname", desc->name(), "prefix", prefix); const std::string nested_indent = indent + DTS_INDENT; printer->Print("$indent$constructor(data?: any[] | null);\n", "indent", @@ -3856,28 +3974,23 @@ void Generator::GenerateMessageDTS(const GeneratorOptions& options, if (HasOneofFields(desc)) { for (int i = 0; i < desc->oneof_decl_count(); i++) { - GenerateOneofDTS(options, printer, desc->oneof_decl(i), nested_indent); + GenerateOneofMethodDTS(options, printer, desc->oneof_decl(i), + nested_indent); } } printer->Print( - "$indent$toObject(includeInstance?: boolean): GlobalObject;\n" + "$indent$toObject(includeInstance?: boolean): { [key: string]: unknown " + "};\n" "$indent$static toObject(includeInstance: boolean | undefined, msg: " - "$class$): GlobalObject;\n" + "$class$): { [key: string]: unknown };\n" "$indent$static deserializeBinary(bytes: jspb.ByteSource): $class$;\n" "$indent$static deserializeBinaryFromReader(msg: $class$, reader: " "jspb.BinaryReader): $class$;\n" "$indent$serializeBinary(): Uint8Array;\n" "$indent$static serializeBinaryToWriter(message: $class$, writer: " "jspb.BinaryWriter): void;\n", - "class", GetMessagePath(options, desc), "indent", nested_indent); - - for (int i = 0; i < desc->nested_type_count(); i++) { - GenerateMessageDTS(options, printer, desc->nested_type(i), nested_indent); - } - for (int i = 0; i < desc->enum_type_count(); i++) { - GenerateEnumDTS(options, printer, desc->enum_type(i), nested_indent); - } + "class", LocalMessageRef(options, desc), "indent", nested_indent); for (int i = 0; i < desc->field_count(); i++) { if (!IgnoreField(desc->field(i))) { @@ -3886,20 +3999,53 @@ void Generator::GenerateMessageDTS(const GeneratorOptions& options, } printer->Print("$indent$}\n\n", "indent", indent); + + bool has_subtypes = false; + if (HasOneofFields(desc)) { + for (int i = 0; i < desc->oneof_decl_count(); i++) { + has_subtypes = has_subtypes || !IgnoreOneof(desc->oneof_decl(i)); + } + } + for (int i = 0; i < desc->nested_type_count(); i++) { + has_subtypes = has_subtypes || !IgnoreMessage(desc->nested_type(i)); + } + for (int i = 0; i < desc->enum_type_count(); i++) { + has_subtypes = true; + } + + if (has_subtypes) { + printer->Print("$prefix$namespace $classname$ {\n", "prefix", prefix, + "classname", desc->name()); + if (HasOneofFields(desc)) { + for (int i = 0; i < desc->oneof_decl_count(); i++) { + GenerateOneofEnumDTS(options, printer, desc->oneof_decl(i), + nested_indent); + } + } + + for (int i = 0; i < desc->nested_type_count(); i++) { + GenerateMessageDTS(options, printer, desc->nested_type(i), nested_indent); + } + for (int i = 0; i < desc->enum_type_count(); i++) { + GenerateEnumDTS(options, printer, desc->enum_type(i), nested_indent); + } + printer->Print("$indent$}\n\n", "indent", indent); + } } -void Generator::GenerateOneofDTS(const GeneratorOptions& options, - io::Printer* printer, - const OneofDescriptor* oneof, - const std::string& indent) const { +void Generator::GenerateOneofEnumDTS(const GeneratorOptions& options, + io::Printer* printer, + const OneofDescriptor* oneof, + const std::string& indent) const { if (IgnoreOneof(oneof)) { return; } - printer->Print("$indent$enum $oneof$Case = {\n", "oneof", JSOneofName(oneof), + + printer->Print("$indent$enum $oneof$Case {\n", "oneof", JSOneofName(oneof), "indent", indent); const std::string nested_indent = indent + DTS_INDENT; - printer->Print("$indent$$upcase$_NOT_SET: 0,\n", "upcase", + printer->Print("$indent$$upcase$_NOT_SET = 0,\n", "upcase", ToEnumCase(oneof->name()), "indent", nested_indent); for (int i = 0; i < oneof->field_count(); i++) { @@ -3907,31 +4053,66 @@ void Generator::GenerateOneofDTS(const GeneratorOptions& options, if (IgnoreField(field)) { continue; } - printer->Print("$indent$$upcase$: $number$,\n", "upcase", + printer->Print("$indent$$upcase$ = $number$,\n", "upcase", ToEnumCase(field->name()), "number", JSFieldIndex(field), "indent", nested_indent); } - printer->Print("$indent$};\n", "indent", indent); + printer->Print("$indent$}\n", "indent", indent); +} + +void Generator::GenerateOneofMethodDTS(const GeneratorOptions& options, + io::Printer* printer, + const OneofDescriptor* oneof, + const std::string& indent) const { + if (IgnoreOneof(oneof)) { + return; + } + printer->Print("$indent$get$oneof$Case(): $class$.$oneof$Case;\n", "class", - GetMessagePath(options, oneof->containing_type()), "oneof", + LocalMessageRef(options, oneof->containing_type()), "oneof", JSOneofName(oneof), "indent", indent); } +std::string DTSTypeName(const GeneratorOptions& options, + const FieldDescriptor* field, BytesMode bytes_mode) { + switch (field->cpp_type()) { + case FieldDescriptor::CPPTYPE_BOOL: + return "boolean"; + case FieldDescriptor::CPPTYPE_INT32: + case FieldDescriptor::CPPTYPE_INT64: + case FieldDescriptor::CPPTYPE_UINT32: + case FieldDescriptor::CPPTYPE_UINT64: + return JSIntegerTypeName(field); + case FieldDescriptor::CPPTYPE_FLOAT: + case FieldDescriptor::CPPTYPE_DOUBLE: + return "number"; + case FieldDescriptor::CPPTYPE_STRING: + return JSStringTypeName(options, field, bytes_mode); + case FieldDescriptor::CPPTYPE_ENUM: + return MaybeCrossFileEnumRef(options, field->file(), field->enum_type()); + case FieldDescriptor::CPPTYPE_MESSAGE: + return MaybeCrossFileMessageRef(options, field->file(), + field->message_type()); + default: + return ""; + } +} + std::string DTSFieldType(const GeneratorOptions& options, const FieldDescriptor* field, BytesMode bytes_mode = BYTES_DEFAULT, bool force_singular = false) { - std::string jstype = JSTypeName(options, field, bytes_mode); + std::string dtstype = DTSTypeName(options, field, bytes_mode); if (!force_singular && field->is_repeated()) { if (field->type() == FieldDescriptor::TYPE_BYTES && bytes_mode == BYTES_DEFAULT) { - jstype = "Uint8Array[] | string[]"; + dtstype = "Uint8Array[] | string[]"; } else { - jstype += "[]"; + dtstype += "[]"; } } - return jstype; + return dtstype; } std::string DTSFieldReturnType(const GeneratorOptions& options, @@ -3965,7 +4146,6 @@ void Generator::GenerateFieldDTS(const GeneratorOptions& options, "$indent$$gettername$(noLazyCreate?: boolean): " "jspb.Map<$keytype$,$valuetype$> " "| undefined;\n", - "class", GetMessagePath(options, field->containing_type()), "gettername", "get" + JSGetterName(options, field), "keytype", DTSFieldType(options, MapFieldKey(field)), "valuetype", DTSFieldType(options, MapFieldValue(field)), "indent", indent); @@ -3976,7 +4156,7 @@ void Generator::GenerateFieldDTS(const GeneratorOptions& options, printer->Print("$indent$$settername$(value: $optionaltype$): $class$;\n", "settername", "set" + JSGetterName(options, field), "optionaltype", DTSFieldSetterType(options, field), "class", - GetMessagePath(options, field->containing_type()), "indent", + LocalMessageRef(options, field->containing_type()), "indent", indent); if (field->is_repeated()) { printer->Print( @@ -3985,8 +4165,10 @@ void Generator::GenerateFieldDTS(const GeneratorOptions& options, "addername", "add" + JSGetterName(options, field, BYTES_DEFAULT, /* drop_list */ true), - "optionaltype", JSTypeName(options, field, BYTES_DEFAULT), "indent", - indent); + "optionaltype", + DTSFieldType(options, field, BYTES_DEFAULT, + /* force_singular */ true), + "indent", indent); } } else { BytesMode bytes_mode = @@ -4010,7 +4192,7 @@ void Generator::GenerateFieldDTS(const GeneratorOptions& options, printer->Print("$indent$$settername$(value: $optionaltype$): $class$;\n", "settername", "set" + JSGetterName(options, field), "optionaltype", DTSFieldSetterType(options, field), "class", - GetMessagePath(options, field->containing_type()), "indent", + LocalMessageRef(options, field->containing_type()), "indent", indent); if (field->is_repeated()) { @@ -4021,7 +4203,7 @@ void Generator::GenerateFieldDTS(const GeneratorOptions& options, "add" + JSGetterName(options, field, BYTES_DEFAULT, /* drop_list = */ true), "optionaltype", DTSFieldType(options, field, BYTES_DEFAULT, true), - "class", GetMessagePath(options, field->containing_type()), "indent", + "class", LocalMessageRef(options, field->containing_type()), "indent", indent); } } @@ -4032,7 +4214,7 @@ void Generator::GenerateFieldDTS(const GeneratorOptions& options, HasFieldPresence(options, field)) { printer->Print("$indent$$clearername$(): $class$;\n", "clearername", "clear" + JSGetterName(options, field), "class", - GetMessagePath(options, field->containing_type()), "indent", + LocalMessageRef(options, field->containing_type()), "indent", indent); } @@ -4046,7 +4228,12 @@ void Generator::GenerateEnumDTS(const GeneratorOptions& options, io::Printer* printer, const EnumDescriptor* enumdesc, const std::string& indent) const { - printer->Print("$indent$enum $name$ {\n", "indent", indent, "name", + std::string prefix = indent; + if (indent == "") { + prefix = "export "; + } + + printer->Print("$prefix$enum $name$ {\n", "prefix", prefix, "name", enumdesc->name()); std::set used_name; diff --git a/generator/js_generator.h b/generator/js_generator.h index 588d7e0..49231b4 100644 --- a/generator/js_generator.h +++ b/generator/js_generator.h @@ -243,9 +243,13 @@ class Generator : public CodeGenerator { void GenerateMessageDTS(const GeneratorOptions& options, io::Printer* printer, const Descriptor* desc, const std::string& indent) const; - void GenerateOneofDTS(const GeneratorOptions& options, io::Printer* printer, - const OneofDescriptor* oneof, - const std::string& indent) const; + void GenerateOneofMethodDTS(const GeneratorOptions& options, + io::Printer* printer, + const OneofDescriptor* oneof, + const std::string& indent) const; + void GenerateOneofEnumDTS(const GeneratorOptions& options, + io::Printer* printer, const OneofDescriptor* oneof, + const std::string& indent) const; void GenerateFieldDTS(const GeneratorOptions& options, io::Printer* printer, const FieldDescriptor* field, const std::string& indent) const; diff --git a/generator/well_known_types_embed.cc b/generator/well_known_types_embed.cc index 5d433dd..6feabcf 100644 --- a/generator/well_known_types_embed.cc +++ b/generator/well_known_types_embed.cc @@ -87,14 +87,66 @@ struct FileToc well_known_types_js[] = { " return null;\n" " }\n" "};\n", - "declare namespace proto.google.protobuf {\n" - " export class Any {\n" - " getTypeName(): string;\n" - " pack(serialized: Uint8Array, name: string, typeUrlPrefix?: string): " - "void;\n" - " unpack(deserialize: (Uint8Array) => T, name: string): T | null;\n" + "/* This code will be inserted into generated ES6 code for\n" + " * google/protobuf/any.proto. */\n" + "\n" + "/**\n" + " * Returns the type name contained in this instance, if any.\n" + " * @return {string|undefined}\n" + " */\n" + "Any.prototype.getTypeName = function() {\n" + " return this.getTypeUrl().split('/').pop();\n" + "};\n" + "\n" + "\n" + "/**\n" + " * Packs the given message instance into this Any.\n" + " * For binary format usage only.\n" + " * @param {!Uint8Array} serialized The serialized data to pack.\n" + " * @param {string} name The type name of this message object.\n" + " * @param {string=} opt_typeUrlPrefix the type URL prefix.\n" + " */\n" + "Any.prototype.pack = function(serialized, name, opt_typeUrlPrefix) " + "{\n" + " if (!opt_typeUrlPrefix) {\n" + " opt_typeUrlPrefix = 'type.googleapis.com/';\n" + " }\n" + "\n" + " if (opt_typeUrlPrefix.substr(-1) != '/') {\n" + " this.setTypeUrl(opt_typeUrlPrefix + '/' + name);\n" + " } else {\n" + " this.setTypeUrl(opt_typeUrlPrefix + name);\n" + " }\n" + "\n" + " this.setValue(serialized);\n" + "};\n" + "\n" + "\n" + "/**\n" + " * @template T\n" + " * Unpacks this Any into the given message object.\n" + " * @param {function(Uint8Array):T} deserialize Function that will " + "deserialize\n" + " * the binary data properly.\n" + " * @param {string} name The expected type name of this message object.\n" + " * @return {?T} If the name matched the expected name, returns the " + "deserialized\n" + " * object, otherwise returns null.\n" + " */\n" + "Any.prototype.unpack = function(deserialize, name) " + "{\n" + " if (this.getTypeName() == name) {\n" + " return deserialize(this.getValue_asU8());\n" + " } else {\n" + " return null;\n" " }\n" - "};\n"}, + "};\n", + "export class Any {\n" + " getTypeName(): string;\n" + " pack(serialized: Uint8Array, name: string, typeUrlPrefix?: string): " + "void;\n" + " unpack(deserialize: (Uint8Array) => T, name: string): T | null;\n" + "}\n"}, {"timestamp.js", "/* This code will be inserted into generated code for\n" " * google/protobuf/timestamp.proto. */\n" @@ -132,13 +184,47 @@ struct FileToc well_known_types_js[] = { " timestamp.fromDate(value);\n" " return timestamp;\n" "};\n", - "declare namespace proto.google.protobuf {\n" - " export class Timestamp {\n" - " toDate(): Date;\n" - " fromDate(value: Date): void;\n" - " static fromDate(value: Date): proto.google.protobuf.Timestamp;\n" - " }\n" - "};\n"}, + "/* This code will be inserted into generated ES6 code for\n" + " * google/protobuf/timestamp.proto. */\n" + "\n" + "/**\n" + " * Returns a JavaScript 'Date' object corresponding to this Timestamp.\n" + " * @return {!Date}\n" + " */\n" + "Timestamp.prototype.toDate = function() {\n" + " var seconds = this.getSeconds();\n" + " var nanos = this.getNanos();\n" + "\n" + " return new Date((seconds * 1000) + (nanos / 1000000));\n" + "};\n" + "\n" + "\n" + "/**\n" + " * Sets the value of this Timestamp object to be the given Date.\n" + " * @param {!Date} value The value to set.\n" + " */\n" + "Timestamp.prototype.fromDate = function(value) {\n" + " this.setSeconds(Math.floor(value.getTime() / 1000));\n" + " this.setNanos(value.getMilliseconds() * 1000000);\n" + "};\n" + "\n" + "\n" + "/**\n" + " * Factory method that returns a Timestamp object with value equal to\n" + " * the given Date.\n" + " * @param {!Date} value The value to set.\n" + " * @return {!proto.google.protobuf.Timestamp}\n" + " */\n" + "Timestamp.fromDate = function(value) {\n" + " var timestamp = new Timestamp();\n" + " timestamp.fromDate(value);\n" + " return timestamp;\n" + "};\n", + "export class Timestamp {\n" + " toDate(): Date;\n" + " fromDate(value: Date): void;\n" + " static fromDate(value: Date): Timestamp;\n" + "}"}, {"struct.js", "/* This code will be inserted into generated code for\n" " * google/protobuf/struct.proto. */\n" @@ -280,27 +366,161 @@ struct FileToc well_known_types_js[] = { "\n" " return ret;\n" "};\n", - "declare namespace proto.google.protobuf {\n" - " export type JavaScriptValue = " - "null|number|string|boolean|JavaScriptValue[]|{ [field: string]: " - "JavaScriptValue }};\n" - " export class Value {\n" - " toJavaScript(): proto.google.protobuf.JavaScriptValue;\n" - " static fromJavaScript(value: proto.google.protobuf.JavaScriptValue): " - "proto.google.protobuf.Value;\n" + "/* This code will be inserted into generated ES6 code for\n" + " * google/protobuf/struct.proto. */\n" + "\n" + "/**\n" + " * Typedef representing plain JavaScript values that can go into a\n" + " * Struct.\n" + " * @typedef {null|number|string|boolean|Array|Object}\n" + " */\n" + "JavaScriptValue;\n" + "\n" + "\n" + "/**\n" + " * Converts this Value object to a plain JavaScript value.\n" + " * @return {?proto.google.protobuf.JavaScriptValue} a plain JavaScript\n" + " * value representing this Struct.\n" + " */\n" + "Value.prototype.toJavaScript = function() {\n" + " var kindCase = Value.KindCase;\n" + " switch (this.getKindCase()) {\n" + " case kindCase.NULL_VALUE:\n" + " return null;\n" + " case kindCase.NUMBER_VALUE:\n" + " return this.getNumberValue();\n" + " case kindCase.STRING_VALUE:\n" + " return this.getStringValue();\n" + " case kindCase.BOOL_VALUE:\n" + " return this.getBoolValue();\n" + " case kindCase.STRUCT_VALUE:\n" + " return this.getStructValue().toJavaScript();\n" + " case kindCase.LIST_VALUE:\n" + " return this.getListValue().toJavaScript();\n" + " default:\n" + " throw new Error('Unexpected struct type');\n" " }\n" - " export class ListValue {\n" - " toJavaScript(): proto.google.protobuf.JavaScriptValue[];\n" - " static fromJavaScript(value: " - "proto.google.protobuf.JavaScriptValue[]): " - "proto.google.protobuf.ListValue;\n" + "};\n" + "\n" + "\n" + "/**\n" + " * Converts this JavaScript value to a new Value proto.\n" + " * @param {!JavaScriptValue} value The value to\n" + " * convert.\n" + " * @return {!proto.google.protobuf.Value} The newly constructed value.\n" + " */\n" + "Value.fromJavaScript = function(value) {\n" + " var ret = new Value();\n" + " switch (goog.typeOf(value)) {\n" + " case 'string':\n" + " ret.setStringValue(/** @type {string} */ (value));\n" + " break;\n" + " case 'number':\n" + " ret.setNumberValue(/** @type {number} */ (value));\n" + " break;\n" + " case 'boolean':\n" + " ret.setBoolValue(/** @type {boolean} */ (value));\n" + " break;\n" + " case 'null':\n" + " ret.setNullValue(NullValue.NULL_VALUE);\n" + " break;\n" + " case 'array':\n" + " ret.setListValue(ListValue.fromJavaScript(\n" + " /** @type{!Array} */ (value)));\n" + " break;\n" + " case 'object':\n" + " ret.setStructValue(Struct.fromJavaScript(\n" + " /** @type{!Object} */ (value)));\n" + " break;\n" + " default:\n" + " throw new Error('Unexpected struct type.');\n" " }\n" - " export class Struct {\n" - " toJavaScript(): { [field: string]: " - "proto.google.protobuf.JavaScriptValue };\n" - " static fromJavaScript(value: { [field: string]: " - "proto.google.protobuf.JavaScriptValue }): proto.google.protobuf.Struct;\n" + "\n" + " return ret;\n" + "};\n" + "\n" + "\n" + "/**\n" + " * Converts this ListValue object to a plain JavaScript array.\n" + " * @return {!Array} a plain JavaScript array representing this List.\n" + " */\n" + "ListValue.prototype.toJavaScript = function() {\n" + " var ret = [];\n" + " var values = this.getValuesList();\n" + "\n" + " for (var i = 0; i < values.length; i++) {\n" + " ret[i] = values[i].toJavaScript();\n" + " }\n" + "\n" + " return ret;\n" + "};\n" + "\n" + "\n" + "/**\n" + " * Constructs a ListValue protobuf from this plain JavaScript array.\n" + " * @param {!Array} array a plain JavaScript array\n" + " * @return {proto.google.protobuf.ListValue} a new ListValue object\n" + " */\n" + "ListValue.fromJavaScript = function(array) {\n" + " var ret = new ListValue();\n" + "\n" + " for (var i = 0; i < array.length; i++) {\n" + " " + "ret.addValues(Value.fromJavaScript(array[i]));\n" " }\n" - "};\n"}, - {NULL, NULL} // Terminate the list. + "\n" + " return ret;\n" + "};\n" + "\n" + "\n" + "/**\n" + " * Converts this Struct object to a plain JavaScript object.\n" + " * @return {!Object} a " + "plain\n" + " * JavaScript object representing this Struct.\n" + " */\n" + "Struct.prototype.toJavaScript = function() {\n" + " var ret = {};\n" + "\n" + " this.getFieldsMap().forEach(function(value, key) {\n" + " ret[key] = value.toJavaScript();\n" + " });\n" + "\n" + " return ret;\n" + "};\n" + "\n" + "\n" + "/**\n" + " * Constructs a Struct protobuf from this plain JavaScript object.\n" + " * @param {!Object} obj a plain JavaScript object\n" + " * @return {proto.google.protobuf.Struct} a new Struct object\n" + " */\n" + "Struct.fromJavaScript = function(obj) {\n" + " var ret = new Struct();\n" + " var map = ret.getFieldsMap();\n" + "\n" + " for (var property in obj) {\n" + " var val = obj[property];\n" + " map.set(property, Value.fromJavaScript(val));\n" + " }\n" + "\n" + " return ret;\n" + "};\n", + "export type JavaScriptValue = " + "null|number|string|boolean|JavaScriptValue[]|{ [field: string]: " + "JavaScriptValue }};\n" + "export class Value {\n" + " toJavaScript(): JavaScriptValue;\n" + " static fromJavaScript(value: JavaScriptValue): Value;\n" + "}\n" + "export class ListValue {\n" + " toJavaScript(): JavaScriptValue[];\n" + " static fromJavaScript(value: JavaScriptValue[]): ListValue;\n" + "}\n" + "export class Struct {\n" + " toJavaScript(): { [field: string]: JavaScriptValue };\n" + " static fromJavaScript(value: { [field: string]: JavaScriptValue }): " + "Struct;\n" + "}\n"}, + {NULL, NULL, NULL, NULL} // Terminate the list. }; diff --git a/generator/well_known_types_embed.h b/generator/well_known_types_embed.h index 08e494f..f9e2355 100644 --- a/generator/well_known_types_embed.h +++ b/generator/well_known_types_embed.h @@ -36,6 +36,7 @@ struct FileToc { const char* name; const char* data; + const char* es6_data; const char* dts_data; }; From e347898f2a0ad55db10db73e2932723fbd785444 Mon Sep 17 00:00:00 2001 From: Jacob Fugal Date: Wed, 15 Jan 2025 14:11:47 -0700 Subject: [PATCH 6/6] add regression testing of closure output to example --- example/README.md | 10 + example/test.closure-new.js | 9724 +++++++++++++++++++++++++++++++++++ example/test.closure-old.js | 9724 +++++++++++++++++++++++++++++++++++ example/test.closure.diff | 0 4 files changed, 19458 insertions(+) create mode 100644 example/test.closure-new.js create mode 100644 example/test.closure-old.js create mode 100644 example/test.closure.diff diff --git a/example/README.md b/example/README.md index dcd9d5f..78fa76a 100644 --- a/example/README.md +++ b/example/README.md @@ -9,3 +9,13 @@ then: `protoc --plugin=protoc-gen-js=bazel-bin/generator/protoc-gen-js --proto_path=protos --js_out=library=example/test,import_style=es6,generate_dts,binary:. protos/test.proto` Generated both `example/test.js` with ES6-style imports/exports and `example/test.d.ts` with TypeScript definitions. + +To regression test Closure output: + +``` +git checkout origin/main +protoc --plugin=protoc-gen-js=bazel-bin/generator/protoc-gen-js --proto_path=protos --js_out=library=example/test,import_style=closure,binary:. protos/test.proto && mv example/test.js example/test.closure-old.js +git checkout lukfugl/es6 +protoc --plugin=protoc-gen-js=bazel-bin/generator/protoc-gen-js --proto_path=protos --js_out=library=example/test,import_style=closure,binary:. protos/test.proto && mv example/test.js example/test.closure-new.js +diff example/test.closure-* > example/test.closure.diff # empty +``` \ No newline at end of file diff --git a/example/test.closure-new.js b/example/test.closure-new.js new file mode 100644 index 0000000..d1f8d94 --- /dev/null +++ b/example/test.closure-new.js @@ -0,0 +1,9724 @@ +// source: test.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + + +goog.provide('proto.jspb.test.BooleanFields'); +goog.provide('proto.jspb.test.CloneExtension'); +goog.provide('proto.jspb.test.Complex'); +goog.provide('proto.jspb.test.Complex.Nested'); +goog.provide('proto.jspb.test.Deeply'); +goog.provide('proto.jspb.test.Deeply.Nested'); +goog.provide('proto.jspb.test.Deeply.Nested.Message'); +goog.provide('proto.jspb.test.DefaultValues'); +goog.provide('proto.jspb.test.DefaultValues.Enum'); +goog.provide('proto.jspb.test.Empty'); +goog.provide('proto.jspb.test.EnumContainer'); +goog.provide('proto.jspb.test.FloatingPointFields'); +goog.provide('proto.jspb.test.HasExtensions'); +goog.provide('proto.jspb.test.IndirectExtension'); +goog.provide('proto.jspb.test.Int64Types'); +goog.provide('proto.jspb.test.IsExtension'); +goog.provide('proto.jspb.test.MapValueEnumNoBinary'); +goog.provide('proto.jspb.test.MapValueMessageNoBinary'); +goog.provide('proto.jspb.test.MineField'); +goog.provide('proto.jspb.test.OptionalFields'); +goog.provide('proto.jspb.test.OptionalFields.Nested'); +goog.provide('proto.jspb.test.OuterEnum'); +goog.provide('proto.jspb.test.OuterMessage'); +goog.provide('proto.jspb.test.OuterMessage.Complex'); +goog.provide('proto.jspb.test.Simple1'); +goog.provide('proto.jspb.test.Simple2'); +goog.provide('proto.jspb.test.SpecialCases'); +goog.provide('proto.jspb.test.TestAllowAliasEnum'); +goog.provide('proto.jspb.test.TestClone'); +goog.provide('proto.jspb.test.TestCloneExtension'); +goog.provide('proto.jspb.test.TestEndsWithBytes'); +goog.provide('proto.jspb.test.TestGroup'); +goog.provide('proto.jspb.test.TestGroup.OptionalGroup'); +goog.provide('proto.jspb.test.TestGroup.RepeatedGroup'); +goog.provide('proto.jspb.test.TestGroup.RequiredGroup'); +goog.provide('proto.jspb.test.TestGroup1'); +goog.provide('proto.jspb.test.TestLastFieldBeforePivot'); +goog.provide('proto.jspb.test.TestMapFieldsNoBinary'); +goog.provide('proto.jspb.test.TestMessageWithOneof'); +goog.provide('proto.jspb.test.TestMessageWithOneof.DefaultOneofACase'); +goog.provide('proto.jspb.test.TestMessageWithOneof.DefaultOneofBCase'); +goog.provide('proto.jspb.test.TestMessageWithOneof.PartialOneofCase'); +goog.provide('proto.jspb.test.TestMessageWithOneof.RecursiveOneofCase'); +goog.provide('proto.jspb.test.TestReservedNames'); +goog.provide('proto.jspb.test.TestReservedNamesExtension'); +goog.provide('proto.jspb.test.extendTestLastFieldBeforePivotField'); +goog.provide('proto.jspb.test.simple1'); + +goog.require('jspb.BinaryReader'); +goog.require('jspb.BinaryWriter'); +goog.require('jspb.ExtensionFieldBinaryInfo'); +goog.require('jspb.ExtensionFieldInfo'); +goog.require('jspb.Map'); +goog.require('jspb.Message'); + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.Empty = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.Empty, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.Empty.displayName = 'proto.jspb.test.Empty'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.EnumContainer = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.EnumContainer, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.EnumContainer.displayName = 'proto.jspb.test.EnumContainer'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.Simple1 = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.jspb.test.Simple1.repeatedFields_, null); +}; +goog.inherits(proto.jspb.test.Simple1, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.Simple1.displayName = 'proto.jspb.test.Simple1'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.Simple2 = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.jspb.test.Simple2.repeatedFields_, null); +}; +goog.inherits(proto.jspb.test.Simple2, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.Simple2.displayName = 'proto.jspb.test.Simple2'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.SpecialCases = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.SpecialCases, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.SpecialCases.displayName = 'proto.jspb.test.SpecialCases'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.OptionalFields = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.jspb.test.OptionalFields.repeatedFields_, null); +}; +goog.inherits(proto.jspb.test.OptionalFields, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.OptionalFields.displayName = 'proto.jspb.test.OptionalFields'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.OptionalFields.Nested = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.OptionalFields.Nested, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.OptionalFields.Nested.displayName = 'proto.jspb.test.OptionalFields.Nested'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.HasExtensions = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, 4, null, null); +}; +goog.inherits(proto.jspb.test.HasExtensions, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.HasExtensions.displayName = 'proto.jspb.test.HasExtensions'; +} + +/** + * The extensions registered with this message class. This is a map of + * extension field number to fieldInfo object. + * + * For example: + * { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, ctor: proto.example.MyMessage} } + * + * fieldName contains the JsCompiler renamed field name property so that it + * works in OPTIMIZED mode. + * + * @type {!Object} + */ +proto.jspb.test.HasExtensions.extensions = {}; + + +/** + * The extensions registered with this message class. This is a map of + * extension field number to fieldInfo object. + * + * For example: + * { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, ctor: proto.example.MyMessage} } + * + * fieldName contains the JsCompiler renamed field name property so that it + * works in OPTIMIZED mode. + * + * @type {!Object} + */ +proto.jspb.test.HasExtensions.extensionsBinary = {}; + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.Complex = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.jspb.test.Complex.repeatedFields_, null); +}; +goog.inherits(proto.jspb.test.Complex, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.Complex.displayName = 'proto.jspb.test.Complex'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.Complex.Nested = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.Complex.Nested, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.Complex.Nested.displayName = 'proto.jspb.test.Complex.Nested'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.OuterMessage = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.OuterMessage, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.OuterMessage.displayName = 'proto.jspb.test.OuterMessage'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.OuterMessage.Complex = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.OuterMessage.Complex, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.OuterMessage.Complex.displayName = 'proto.jspb.test.OuterMessage.Complex'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.MineField = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.MineField, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.MineField.displayName = 'proto.jspb.test.MineField'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.IsExtension = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.IsExtension, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.IsExtension.displayName = 'proto.jspb.test.IsExtension'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.IndirectExtension = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.IndirectExtension, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.IndirectExtension.displayName = 'proto.jspb.test.IndirectExtension'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.DefaultValues = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.DefaultValues, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.DefaultValues.displayName = 'proto.jspb.test.DefaultValues'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.FloatingPointFields = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.jspb.test.FloatingPointFields.repeatedFields_, null); +}; +goog.inherits(proto.jspb.test.FloatingPointFields, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.FloatingPointFields.displayName = 'proto.jspb.test.FloatingPointFields'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.BooleanFields = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.jspb.test.BooleanFields.repeatedFields_, null); +}; +goog.inherits(proto.jspb.test.BooleanFields, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.BooleanFields.displayName = 'proto.jspb.test.BooleanFields'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.TestClone = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, 8, proto.jspb.test.TestClone.repeatedFields_, null); +}; +goog.inherits(proto.jspb.test.TestClone, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.TestClone.displayName = 'proto.jspb.test.TestClone'; +} + +/** + * The extensions registered with this message class. This is a map of + * extension field number to fieldInfo object. + * + * For example: + * { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, ctor: proto.example.MyMessage} } + * + * fieldName contains the JsCompiler renamed field name property so that it + * works in OPTIMIZED mode. + * + * @type {!Object} + */ +proto.jspb.test.TestClone.extensions = {}; + + +/** + * The extensions registered with this message class. This is a map of + * extension field number to fieldInfo object. + * + * For example: + * { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, ctor: proto.example.MyMessage} } + * + * fieldName contains the JsCompiler renamed field name property so that it + * works in OPTIMIZED mode. + * + * @type {!Object} + */ +proto.jspb.test.TestClone.extensionsBinary = {}; + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.TestCloneExtension = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.TestCloneExtension, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.TestCloneExtension.displayName = 'proto.jspb.test.TestCloneExtension'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.CloneExtension = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.CloneExtension, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.CloneExtension.displayName = 'proto.jspb.test.CloneExtension'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.TestGroup = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.jspb.test.TestGroup.repeatedFields_, null); +}; +goog.inherits(proto.jspb.test.TestGroup, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.TestGroup.displayName = 'proto.jspb.test.TestGroup'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.TestGroup.RepeatedGroup = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.jspb.test.TestGroup.RepeatedGroup.repeatedFields_, null); +}; +goog.inherits(proto.jspb.test.TestGroup.RepeatedGroup, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.TestGroup.RepeatedGroup.displayName = 'proto.jspb.test.TestGroup.RepeatedGroup'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.TestGroup.RequiredGroup = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.TestGroup.RequiredGroup, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.TestGroup.RequiredGroup.displayName = 'proto.jspb.test.TestGroup.RequiredGroup'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.TestGroup.OptionalGroup = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.TestGroup.OptionalGroup, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.TestGroup.OptionalGroup.displayName = 'proto.jspb.test.TestGroup.OptionalGroup'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.TestGroup1 = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.TestGroup1, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.TestGroup1.displayName = 'proto.jspb.test.TestGroup1'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.TestReservedNames = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, 2, null, null); +}; +goog.inherits(proto.jspb.test.TestReservedNames, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.TestReservedNames.displayName = 'proto.jspb.test.TestReservedNames'; +} + +/** + * The extensions registered with this message class. This is a map of + * extension field number to fieldInfo object. + * + * For example: + * { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, ctor: proto.example.MyMessage} } + * + * fieldName contains the JsCompiler renamed field name property so that it + * works in OPTIMIZED mode. + * + * @type {!Object} + */ +proto.jspb.test.TestReservedNames.extensions = {}; + + +/** + * The extensions registered with this message class. This is a map of + * extension field number to fieldInfo object. + * + * For example: + * { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, ctor: proto.example.MyMessage} } + * + * fieldName contains the JsCompiler renamed field name property so that it + * works in OPTIMIZED mode. + * + * @type {!Object} + */ +proto.jspb.test.TestReservedNames.extensionsBinary = {}; + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.TestReservedNamesExtension = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.TestReservedNamesExtension, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.TestReservedNamesExtension.displayName = 'proto.jspb.test.TestReservedNamesExtension'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.TestMessageWithOneof = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.jspb.test.TestMessageWithOneof.repeatedFields_, proto.jspb.test.TestMessageWithOneof.oneofGroups_); +}; +goog.inherits(proto.jspb.test.TestMessageWithOneof, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.TestMessageWithOneof.displayName = 'proto.jspb.test.TestMessageWithOneof'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.TestEndsWithBytes = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.TestEndsWithBytes, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.TestEndsWithBytes.displayName = 'proto.jspb.test.TestEndsWithBytes'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.TestLastFieldBeforePivot = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, 2, null, null); +}; +goog.inherits(proto.jspb.test.TestLastFieldBeforePivot, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.TestLastFieldBeforePivot.displayName = 'proto.jspb.test.TestLastFieldBeforePivot'; +} + +/** + * The extensions registered with this message class. This is a map of + * extension field number to fieldInfo object. + * + * For example: + * { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, ctor: proto.example.MyMessage} } + * + * fieldName contains the JsCompiler renamed field name property so that it + * works in OPTIMIZED mode. + * + * @type {!Object} + */ +proto.jspb.test.TestLastFieldBeforePivot.extensions = {}; + + +/** + * The extensions registered with this message class. This is a map of + * extension field number to fieldInfo object. + * + * For example: + * { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, ctor: proto.example.MyMessage} } + * + * fieldName contains the JsCompiler renamed field name property so that it + * works in OPTIMIZED mode. + * + * @type {!Object} + */ +proto.jspb.test.TestLastFieldBeforePivot.extensionsBinary = {}; + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.Int64Types = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.Int64Types, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.Int64Types.displayName = 'proto.jspb.test.Int64Types'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.TestMapFieldsNoBinary = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.TestMapFieldsNoBinary, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.TestMapFieldsNoBinary.displayName = 'proto.jspb.test.TestMapFieldsNoBinary'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.MapValueMessageNoBinary = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.MapValueMessageNoBinary, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.MapValueMessageNoBinary.displayName = 'proto.jspb.test.MapValueMessageNoBinary'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.Deeply = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.Deeply, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.Deeply.displayName = 'proto.jspb.test.Deeply'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.Deeply.Nested = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.Deeply.Nested, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.Deeply.Nested.displayName = 'proto.jspb.test.Deeply.Nested'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.Deeply.Nested.Message = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.Deeply.Nested.Message, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.Deeply.Nested.Message.displayName = 'proto.jspb.test.Deeply.Nested.Message'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.Empty.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.Empty.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.Empty} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Empty.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.Empty} + */ +proto.jspb.test.Empty.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.Empty; + return proto.jspb.test.Empty.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.Empty} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.Empty} + */ +proto.jspb.test.Empty.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.Empty.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.Empty.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.Empty} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Empty.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.EnumContainer.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.EnumContainer.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.EnumContainer} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.EnumContainer.toObject = function(includeInstance, msg) { + var f, obj = { +outerEnum: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.EnumContainer} + */ +proto.jspb.test.EnumContainer.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.EnumContainer; + return proto.jspb.test.EnumContainer.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.EnumContainer} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.EnumContainer} + */ +proto.jspb.test.EnumContainer.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.jspb.test.OuterEnum} */ (reader.readEnum()); + msg.setOuterEnum(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.EnumContainer.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.EnumContainer.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.EnumContainer} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.EnumContainer.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {!proto.jspb.test.OuterEnum} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeEnum( + 1, + f + ); + } +}; + + +/** + * optional OuterEnum outer_enum = 1; + * @return {!proto.jspb.test.OuterEnum} + */ +proto.jspb.test.EnumContainer.prototype.getOuterEnum = function() { + return /** @type {!proto.jspb.test.OuterEnum} */ (jspb.Message.getFieldWithDefault(this, 1, 1)); +}; + + +/** + * @param {!proto.jspb.test.OuterEnum} value + * @return {!proto.jspb.test.EnumContainer} returns this + */ +proto.jspb.test.EnumContainer.prototype.setOuterEnum = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.EnumContainer} returns this + */ +proto.jspb.test.EnumContainer.prototype.clearOuterEnum = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.EnumContainer.prototype.hasOuterEnum = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.jspb.test.Simple1.repeatedFields_ = [2]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.Simple1.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.Simple1.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.Simple1} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Simple1.toObject = function(includeInstance, msg) { + var f, obj = { +aString: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, +aRepeatedStringList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? undefined : f, +aBoolean: (f = jspb.Message.getBooleanField(msg, 3)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.Simple1} + */ +proto.jspb.test.Simple1.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.Simple1; + return proto.jspb.test.Simple1.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.Simple1} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.Simple1} + */ +proto.jspb.test.Simple1.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setAString(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.addARepeatedString(value); + break; + case 3: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setABoolean(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.Simple1.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.Simple1.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.Simple1} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Simple1.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } + f = message.getARepeatedStringList(); + if (f.length > 0) { + writer.writeRepeatedString( + 2, + f + ); + } + f = /** @type {boolean} */ (jspb.Message.getField(message, 3)); + if (f != null) { + writer.writeBool( + 3, + f + ); + } +}; + + +/** + * required string a_string = 1; + * @return {string} + */ +proto.jspb.test.Simple1.prototype.getAString = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.Simple1} returns this + */ +proto.jspb.test.Simple1.prototype.setAString = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.Simple1} returns this + */ +proto.jspb.test.Simple1.prototype.clearAString = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.Simple1.prototype.hasAString = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * repeated string a_repeated_string = 2; + * @return {!Array} + */ +proto.jspb.test.Simple1.prototype.getARepeatedStringList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.jspb.test.Simple1} returns this + */ +proto.jspb.test.Simple1.prototype.setARepeatedStringList = function(value) { + return jspb.Message.setField(this, 2, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.jspb.test.Simple1} returns this + */ +proto.jspb.test.Simple1.prototype.addARepeatedString = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 2, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.jspb.test.Simple1} returns this + */ +proto.jspb.test.Simple1.prototype.clearARepeatedStringList = function() { + return this.setARepeatedStringList([]); +}; + + +/** + * optional bool a_boolean = 3; + * @return {boolean} + */ +proto.jspb.test.Simple1.prototype.getABoolean = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.jspb.test.Simple1} returns this + */ +proto.jspb.test.Simple1.prototype.setABoolean = function(value) { + return jspb.Message.setField(this, 3, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.Simple1} returns this + */ +proto.jspb.test.Simple1.prototype.clearABoolean = function() { + return jspb.Message.setField(this, 3, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.Simple1.prototype.hasABoolean = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.jspb.test.Simple2.repeatedFields_ = [2]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.Simple2.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.Simple2.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.Simple2} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Simple2.toObject = function(includeInstance, msg) { + var f, obj = { +aString: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, +aRepeatedStringList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.Simple2} + */ +proto.jspb.test.Simple2.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.Simple2; + return proto.jspb.test.Simple2.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.Simple2} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.Simple2} + */ +proto.jspb.test.Simple2.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setAString(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.addARepeatedString(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.Simple2.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.Simple2.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.Simple2} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Simple2.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } + f = message.getARepeatedStringList(); + if (f.length > 0) { + writer.writeRepeatedString( + 2, + f + ); + } +}; + + +/** + * required string a_string = 1; + * @return {string} + */ +proto.jspb.test.Simple2.prototype.getAString = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.Simple2} returns this + */ +proto.jspb.test.Simple2.prototype.setAString = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.Simple2} returns this + */ +proto.jspb.test.Simple2.prototype.clearAString = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.Simple2.prototype.hasAString = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * repeated string a_repeated_string = 2; + * @return {!Array} + */ +proto.jspb.test.Simple2.prototype.getARepeatedStringList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.jspb.test.Simple2} returns this + */ +proto.jspb.test.Simple2.prototype.setARepeatedStringList = function(value) { + return jspb.Message.setField(this, 2, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.jspb.test.Simple2} returns this + */ +proto.jspb.test.Simple2.prototype.addARepeatedString = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 2, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.jspb.test.Simple2} returns this + */ +proto.jspb.test.Simple2.prototype.clearARepeatedStringList = function() { + return this.setARepeatedStringList([]); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.SpecialCases.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.SpecialCases.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.SpecialCases} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.SpecialCases.toObject = function(includeInstance, msg) { + var f, obj = { +normal: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, +pb_default: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f, +pb_function: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f, +pb_var: (f = jspb.Message.getField(msg, 4)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.SpecialCases} + */ +proto.jspb.test.SpecialCases.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.SpecialCases; + return proto.jspb.test.SpecialCases.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.SpecialCases} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.SpecialCases} + */ +proto.jspb.test.SpecialCases.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setNormal(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setDefault(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setFunction(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setVar(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.SpecialCases.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.SpecialCases.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.SpecialCases} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.SpecialCases.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeString( + 2, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 3)); + if (f != null) { + writer.writeString( + 3, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 4)); + if (f != null) { + writer.writeString( + 4, + f + ); + } +}; + + +/** + * required string normal = 1; + * @return {string} + */ +proto.jspb.test.SpecialCases.prototype.getNormal = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.SpecialCases} returns this + */ +proto.jspb.test.SpecialCases.prototype.setNormal = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.SpecialCases} returns this + */ +proto.jspb.test.SpecialCases.prototype.clearNormal = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.SpecialCases.prototype.hasNormal = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * required string default = 2; + * @return {string} + */ +proto.jspb.test.SpecialCases.prototype.getDefault = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.SpecialCases} returns this + */ +proto.jspb.test.SpecialCases.prototype.setDefault = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.SpecialCases} returns this + */ +proto.jspb.test.SpecialCases.prototype.clearDefault = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.SpecialCases.prototype.hasDefault = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * required string function = 3; + * @return {string} + */ +proto.jspb.test.SpecialCases.prototype.getFunction = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.SpecialCases} returns this + */ +proto.jspb.test.SpecialCases.prototype.setFunction = function(value) { + return jspb.Message.setField(this, 3, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.SpecialCases} returns this + */ +proto.jspb.test.SpecialCases.prototype.clearFunction = function() { + return jspb.Message.setField(this, 3, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.SpecialCases.prototype.hasFunction = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * required string var = 4; + * @return {string} + */ +proto.jspb.test.SpecialCases.prototype.getVar = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.SpecialCases} returns this + */ +proto.jspb.test.SpecialCases.prototype.setVar = function(value) { + return jspb.Message.setField(this, 4, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.SpecialCases} returns this + */ +proto.jspb.test.SpecialCases.prototype.clearVar = function() { + return jspb.Message.setField(this, 4, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.SpecialCases.prototype.hasVar = function() { + return jspb.Message.getField(this, 4) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.jspb.test.OptionalFields.repeatedFields_ = [4,5]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.OptionalFields.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.OptionalFields.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.OptionalFields} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.OptionalFields.toObject = function(includeInstance, msg) { + var f, obj = { +aString: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, +aBool: (f = jspb.Message.getBooleanField(msg, 2)) == null ? undefined : f, +aNestedMessage: (f = msg.getANestedMessage()) && proto.jspb.test.OptionalFields.Nested.toObject(includeInstance, f), +aRepeatedMessageList: jspb.Message.toObjectList(msg.getARepeatedMessageList(), + proto.jspb.test.OptionalFields.Nested.toObject, includeInstance), +aRepeatedStringList: (f = jspb.Message.getRepeatedField(msg, 5)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.OptionalFields} + */ +proto.jspb.test.OptionalFields.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.OptionalFields; + return proto.jspb.test.OptionalFields.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.OptionalFields} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.OptionalFields} + */ +proto.jspb.test.OptionalFields.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setAString(value); + break; + case 2: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setABool(value); + break; + case 3: + var value = new proto.jspb.test.OptionalFields.Nested; + reader.readMessage(value,proto.jspb.test.OptionalFields.Nested.deserializeBinaryFromReader); + msg.setANestedMessage(value); + break; + case 4: + var value = new proto.jspb.test.OptionalFields.Nested; + reader.readMessage(value,proto.jspb.test.OptionalFields.Nested.deserializeBinaryFromReader); + msg.addARepeatedMessage(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.addARepeatedString(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.OptionalFields.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.OptionalFields.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.OptionalFields} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.OptionalFields.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } + f = /** @type {boolean} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeBool( + 2, + f + ); + } + f = message.getANestedMessage(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.jspb.test.OptionalFields.Nested.serializeBinaryToWriter + ); + } + f = message.getARepeatedMessageList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 4, + f, + proto.jspb.test.OptionalFields.Nested.serializeBinaryToWriter + ); + } + f = message.getARepeatedStringList(); + if (f.length > 0) { + writer.writeRepeatedString( + 5, + f + ); + } +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.OptionalFields.Nested.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.OptionalFields.Nested.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.OptionalFields.Nested} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.OptionalFields.Nested.toObject = function(includeInstance, msg) { + var f, obj = { +anInt: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.OptionalFields.Nested} + */ +proto.jspb.test.OptionalFields.Nested.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.OptionalFields.Nested; + return proto.jspb.test.OptionalFields.Nested.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.OptionalFields.Nested} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.OptionalFields.Nested} + */ +proto.jspb.test.OptionalFields.Nested.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt32()); + msg.setAnInt(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.OptionalFields.Nested.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.OptionalFields.Nested.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.OptionalFields.Nested} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.OptionalFields.Nested.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {number} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeInt32( + 1, + f + ); + } +}; + + +/** + * optional int32 an_int = 1; + * @return {number} + */ +proto.jspb.test.OptionalFields.Nested.prototype.getAnInt = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.OptionalFields.Nested} returns this + */ +proto.jspb.test.OptionalFields.Nested.prototype.setAnInt = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.OptionalFields.Nested} returns this + */ +proto.jspb.test.OptionalFields.Nested.prototype.clearAnInt = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.OptionalFields.Nested.prototype.hasAnInt = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional string a_string = 1; + * @return {string} + */ +proto.jspb.test.OptionalFields.prototype.getAString = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.OptionalFields} returns this + */ +proto.jspb.test.OptionalFields.prototype.setAString = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.OptionalFields} returns this + */ +proto.jspb.test.OptionalFields.prototype.clearAString = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.OptionalFields.prototype.hasAString = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * required bool a_bool = 2; + * @return {boolean} + */ +proto.jspb.test.OptionalFields.prototype.getABool = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.jspb.test.OptionalFields} returns this + */ +proto.jspb.test.OptionalFields.prototype.setABool = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.OptionalFields} returns this + */ +proto.jspb.test.OptionalFields.prototype.clearABool = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.OptionalFields.prototype.hasABool = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional Nested a_nested_message = 3; + * @return {?proto.jspb.test.OptionalFields.Nested} + */ +proto.jspb.test.OptionalFields.prototype.getANestedMessage = function() { + return /** @type{?proto.jspb.test.OptionalFields.Nested} */ ( + jspb.Message.getWrapperField(this, proto.jspb.test.OptionalFields.Nested, 3)); +}; + + +/** + * @param {?proto.jspb.test.OptionalFields.Nested|undefined} value + * @return {!proto.jspb.test.OptionalFields} returns this +*/ +proto.jspb.test.OptionalFields.prototype.setANestedMessage = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.jspb.test.OptionalFields} returns this + */ +proto.jspb.test.OptionalFields.prototype.clearANestedMessage = function() { + return this.setANestedMessage(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.OptionalFields.prototype.hasANestedMessage = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * repeated Nested a_repeated_message = 4; + * @return {!Array} + */ +proto.jspb.test.OptionalFields.prototype.getARepeatedMessageList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.jspb.test.OptionalFields.Nested, 4)); +}; + + +/** + * @param {!Array} value + * @return {!proto.jspb.test.OptionalFields} returns this +*/ +proto.jspb.test.OptionalFields.prototype.setARepeatedMessageList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 4, value); +}; + + +/** + * @param {!proto.jspb.test.OptionalFields.Nested=} opt_value + * @param {number=} opt_index + * @return {!proto.jspb.test.OptionalFields.Nested} + */ +proto.jspb.test.OptionalFields.prototype.addARepeatedMessage = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.jspb.test.OptionalFields.Nested, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.jspb.test.OptionalFields} returns this + */ +proto.jspb.test.OptionalFields.prototype.clearARepeatedMessageList = function() { + return this.setARepeatedMessageList([]); +}; + + +/** + * repeated string a_repeated_string = 5; + * @return {!Array} + */ +proto.jspb.test.OptionalFields.prototype.getARepeatedStringList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 5)); +}; + + +/** + * @param {!Array} value + * @return {!proto.jspb.test.OptionalFields} returns this + */ +proto.jspb.test.OptionalFields.prototype.setARepeatedStringList = function(value) { + return jspb.Message.setField(this, 5, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.jspb.test.OptionalFields} returns this + */ +proto.jspb.test.OptionalFields.prototype.addARepeatedString = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 5, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.jspb.test.OptionalFields} returns this + */ +proto.jspb.test.OptionalFields.prototype.clearARepeatedStringList = function() { + return this.setARepeatedStringList([]); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.HasExtensions.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.HasExtensions.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.HasExtensions} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.HasExtensions.toObject = function(includeInstance, msg) { + var f, obj = { +str1: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, +str2: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f, +str3: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f + }; + + jspb.Message.toObjectExtension(/** @type {!jspb.Message} */ (msg), obj, + proto.jspb.test.HasExtensions.extensions, proto.jspb.test.HasExtensions.prototype.getExtension, + includeInstance); + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.HasExtensions} + */ +proto.jspb.test.HasExtensions.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.HasExtensions; + return proto.jspb.test.HasExtensions.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.HasExtensions} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.HasExtensions} + */ +proto.jspb.test.HasExtensions.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setStr1(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setStr2(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setStr3(value); + break; + default: + jspb.Message.readBinaryExtension(msg, reader, + proto.jspb.test.HasExtensions.extensionsBinary, + proto.jspb.test.HasExtensions.prototype.getExtension, + proto.jspb.test.HasExtensions.prototype.setExtension); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.HasExtensions.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.HasExtensions.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.HasExtensions} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.HasExtensions.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeString( + 2, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 3)); + if (f != null) { + writer.writeString( + 3, + f + ); + } + jspb.Message.serializeBinaryExtensions(message, writer, + proto.jspb.test.HasExtensions.extensionsBinary, proto.jspb.test.HasExtensions.prototype.getExtension); +}; + + +/** + * optional string str1 = 1; + * @return {string} + */ +proto.jspb.test.HasExtensions.prototype.getStr1 = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.HasExtensions} returns this + */ +proto.jspb.test.HasExtensions.prototype.setStr1 = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.HasExtensions} returns this + */ +proto.jspb.test.HasExtensions.prototype.clearStr1 = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.HasExtensions.prototype.hasStr1 = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional string str2 = 2; + * @return {string} + */ +proto.jspb.test.HasExtensions.prototype.getStr2 = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.HasExtensions} returns this + */ +proto.jspb.test.HasExtensions.prototype.setStr2 = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.HasExtensions} returns this + */ +proto.jspb.test.HasExtensions.prototype.clearStr2 = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.HasExtensions.prototype.hasStr2 = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional string str3 = 3; + * @return {string} + */ +proto.jspb.test.HasExtensions.prototype.getStr3 = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.HasExtensions} returns this + */ +proto.jspb.test.HasExtensions.prototype.setStr3 = function(value) { + return jspb.Message.setField(this, 3, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.HasExtensions} returns this + */ +proto.jspb.test.HasExtensions.prototype.clearStr3 = function() { + return jspb.Message.setField(this, 3, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.HasExtensions.prototype.hasStr3 = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.jspb.test.Complex.repeatedFields_ = [5,7]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.Complex.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.Complex.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.Complex} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Complex.toObject = function(includeInstance, msg) { + var f, obj = { +aString: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, +anOutOfOrderBool: (f = jspb.Message.getBooleanField(msg, 9)) == null ? undefined : f, +aNestedMessage: (f = msg.getANestedMessage()) && proto.jspb.test.Complex.Nested.toObject(includeInstance, f), +aRepeatedMessageList: jspb.Message.toObjectList(msg.getARepeatedMessageList(), + proto.jspb.test.Complex.Nested.toObject, includeInstance), +aRepeatedStringList: (f = jspb.Message.getRepeatedField(msg, 7)) == null ? undefined : f, +aFloatingPointField: (f = jspb.Message.getOptionalFloatingPointField(msg, 10)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.Complex} + */ +proto.jspb.test.Complex.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.Complex; + return proto.jspb.test.Complex.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.Complex} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.Complex} + */ +proto.jspb.test.Complex.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setAString(value); + break; + case 9: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setAnOutOfOrderBool(value); + break; + case 4: + var value = new proto.jspb.test.Complex.Nested; + reader.readMessage(value,proto.jspb.test.Complex.Nested.deserializeBinaryFromReader); + msg.setANestedMessage(value); + break; + case 5: + var value = new proto.jspb.test.Complex.Nested; + reader.readMessage(value,proto.jspb.test.Complex.Nested.deserializeBinaryFromReader); + msg.addARepeatedMessage(value); + break; + case 7: + var value = /** @type {string} */ (reader.readString()); + msg.addARepeatedString(value); + break; + case 10: + var value = /** @type {number} */ (reader.readDouble()); + msg.setAFloatingPointField(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.Complex.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.Complex.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.Complex} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Complex.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } + f = /** @type {boolean} */ (jspb.Message.getField(message, 9)); + if (f != null) { + writer.writeBool( + 9, + f + ); + } + f = message.getANestedMessage(); + if (f != null) { + writer.writeMessage( + 4, + f, + proto.jspb.test.Complex.Nested.serializeBinaryToWriter + ); + } + f = message.getARepeatedMessageList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 5, + f, + proto.jspb.test.Complex.Nested.serializeBinaryToWriter + ); + } + f = message.getARepeatedStringList(); + if (f.length > 0) { + writer.writeRepeatedString( + 7, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 10)); + if (f != null) { + writer.writeDouble( + 10, + f + ); + } +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.Complex.Nested.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.Complex.Nested.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.Complex.Nested} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Complex.Nested.toObject = function(includeInstance, msg) { + var f, obj = { +anInt: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.Complex.Nested} + */ +proto.jspb.test.Complex.Nested.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.Complex.Nested; + return proto.jspb.test.Complex.Nested.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.Complex.Nested} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.Complex.Nested} + */ +proto.jspb.test.Complex.Nested.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 2: + var value = /** @type {number} */ (reader.readInt32()); + msg.setAnInt(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.Complex.Nested.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.Complex.Nested.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.Complex.Nested} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Complex.Nested.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {number} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeInt32( + 2, + f + ); + } +}; + + +/** + * required int32 an_int = 2; + * @return {number} + */ +proto.jspb.test.Complex.Nested.prototype.getAnInt = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.Complex.Nested} returns this + */ +proto.jspb.test.Complex.Nested.prototype.setAnInt = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.Complex.Nested} returns this + */ +proto.jspb.test.Complex.Nested.prototype.clearAnInt = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.Complex.Nested.prototype.hasAnInt = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * required string a_string = 1; + * @return {string} + */ +proto.jspb.test.Complex.prototype.getAString = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.Complex} returns this + */ +proto.jspb.test.Complex.prototype.setAString = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.Complex} returns this + */ +proto.jspb.test.Complex.prototype.clearAString = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.Complex.prototype.hasAString = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional bool an_out_of_order_bool = 9; + * @return {boolean} + */ +proto.jspb.test.Complex.prototype.getAnOutOfOrderBool = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 9, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.jspb.test.Complex} returns this + */ +proto.jspb.test.Complex.prototype.setAnOutOfOrderBool = function(value) { + return jspb.Message.setField(this, 9, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.Complex} returns this + */ +proto.jspb.test.Complex.prototype.clearAnOutOfOrderBool = function() { + return jspb.Message.setField(this, 9, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.Complex.prototype.hasAnOutOfOrderBool = function() { + return jspb.Message.getField(this, 9) != null; +}; + + +/** + * optional Nested a_nested_message = 4; + * @return {?proto.jspb.test.Complex.Nested} + */ +proto.jspb.test.Complex.prototype.getANestedMessage = function() { + return /** @type{?proto.jspb.test.Complex.Nested} */ ( + jspb.Message.getWrapperField(this, proto.jspb.test.Complex.Nested, 4)); +}; + + +/** + * @param {?proto.jspb.test.Complex.Nested|undefined} value + * @return {!proto.jspb.test.Complex} returns this +*/ +proto.jspb.test.Complex.prototype.setANestedMessage = function(value) { + return jspb.Message.setWrapperField(this, 4, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.jspb.test.Complex} returns this + */ +proto.jspb.test.Complex.prototype.clearANestedMessage = function() { + return this.setANestedMessage(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.Complex.prototype.hasANestedMessage = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * repeated Nested a_repeated_message = 5; + * @return {!Array} + */ +proto.jspb.test.Complex.prototype.getARepeatedMessageList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.jspb.test.Complex.Nested, 5)); +}; + + +/** + * @param {!Array} value + * @return {!proto.jspb.test.Complex} returns this +*/ +proto.jspb.test.Complex.prototype.setARepeatedMessageList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 5, value); +}; + + +/** + * @param {!proto.jspb.test.Complex.Nested=} opt_value + * @param {number=} opt_index + * @return {!proto.jspb.test.Complex.Nested} + */ +proto.jspb.test.Complex.prototype.addARepeatedMessage = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, proto.jspb.test.Complex.Nested, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.jspb.test.Complex} returns this + */ +proto.jspb.test.Complex.prototype.clearARepeatedMessageList = function() { + return this.setARepeatedMessageList([]); +}; + + +/** + * repeated string a_repeated_string = 7; + * @return {!Array} + */ +proto.jspb.test.Complex.prototype.getARepeatedStringList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 7)); +}; + + +/** + * @param {!Array} value + * @return {!proto.jspb.test.Complex} returns this + */ +proto.jspb.test.Complex.prototype.setARepeatedStringList = function(value) { + return jspb.Message.setField(this, 7, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.jspb.test.Complex} returns this + */ +proto.jspb.test.Complex.prototype.addARepeatedString = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 7, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.jspb.test.Complex} returns this + */ +proto.jspb.test.Complex.prototype.clearARepeatedStringList = function() { + return this.setARepeatedStringList([]); +}; + + +/** + * optional double a_floating_point_field = 10; + * @return {number} + */ +proto.jspb.test.Complex.prototype.getAFloatingPointField = function() { + return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 10, 0.0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.Complex} returns this + */ +proto.jspb.test.Complex.prototype.setAFloatingPointField = function(value) { + return jspb.Message.setField(this, 10, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.Complex} returns this + */ +proto.jspb.test.Complex.prototype.clearAFloatingPointField = function() { + return jspb.Message.setField(this, 10, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.Complex.prototype.hasAFloatingPointField = function() { + return jspb.Message.getField(this, 10) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.OuterMessage.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.OuterMessage.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.OuterMessage} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.OuterMessage.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.OuterMessage} + */ +proto.jspb.test.OuterMessage.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.OuterMessage; + return proto.jspb.test.OuterMessage.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.OuterMessage} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.OuterMessage} + */ +proto.jspb.test.OuterMessage.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.OuterMessage.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.OuterMessage.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.OuterMessage} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.OuterMessage.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.OuterMessage.Complex.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.OuterMessage.Complex.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.OuterMessage.Complex} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.OuterMessage.Complex.toObject = function(includeInstance, msg) { + var f, obj = { +innerComplexField: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.OuterMessage.Complex} + */ +proto.jspb.test.OuterMessage.Complex.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.OuterMessage.Complex; + return proto.jspb.test.OuterMessage.Complex.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.OuterMessage.Complex} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.OuterMessage.Complex} + */ +proto.jspb.test.OuterMessage.Complex.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt32()); + msg.setInnerComplexField(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.OuterMessage.Complex.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.OuterMessage.Complex.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.OuterMessage.Complex} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.OuterMessage.Complex.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {number} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeInt32( + 1, + f + ); + } +}; + + +/** + * optional int32 inner_complex_field = 1; + * @return {number} + */ +proto.jspb.test.OuterMessage.Complex.prototype.getInnerComplexField = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.OuterMessage.Complex} returns this + */ +proto.jspb.test.OuterMessage.Complex.prototype.setInnerComplexField = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.OuterMessage.Complex} returns this + */ +proto.jspb.test.OuterMessage.Complex.prototype.clearInnerComplexField = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.OuterMessage.Complex.prototype.hasInnerComplexField = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.MineField.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.MineField.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.MineField} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.MineField.toObject = function(includeInstance, msg) { + var f, obj = { +cookie: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.MineField} + */ +proto.jspb.test.MineField.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.MineField; + return proto.jspb.test.MineField.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.MineField} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.MineField} + */ +proto.jspb.test.MineField.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setCookie(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.MineField.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.MineField.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.MineField} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.MineField.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string cookie = 1; + * @return {string} + */ +proto.jspb.test.MineField.prototype.getCookie = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.MineField} returns this + */ +proto.jspb.test.MineField.prototype.setCookie = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.MineField} returns this + */ +proto.jspb.test.MineField.prototype.clearCookie = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.MineField.prototype.hasCookie = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.IsExtension.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.IsExtension.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.IsExtension} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.IsExtension.toObject = function(includeInstance, msg) { + var f, obj = { +ext1: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.IsExtension} + */ +proto.jspb.test.IsExtension.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.IsExtension; + return proto.jspb.test.IsExtension.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.IsExtension} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.IsExtension} + */ +proto.jspb.test.IsExtension.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setExt1(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.IsExtension.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.IsExtension.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.IsExtension} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.IsExtension.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } +}; + + + +/** + * A tuple of {field number, class constructor} for the extension + * field named `extField`. + * @type {!jspb.ExtensionFieldInfo} + */ +proto.jspb.test.IsExtension.extField = new jspb.ExtensionFieldInfo( + 100, + {extField: 0}, + proto.jspb.test.IsExtension, + /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( + proto.jspb.test.IsExtension.toObject), + 0); + +proto.jspb.test.HasExtensions.extensionsBinary[100] = new jspb.ExtensionFieldBinaryInfo( + proto.jspb.test.IsExtension.extField, + jspb.BinaryReader.prototype.readMessage, + jspb.BinaryWriter.prototype.writeMessage, + proto.jspb.test.IsExtension.serializeBinaryToWriter, + proto.jspb.test.IsExtension.deserializeBinaryFromReader, + false); +// This registers the extension field with the extended class, so that +// toObject() will function correctly. +proto.jspb.test.HasExtensions.extensions[100] = proto.jspb.test.IsExtension.extField; + +/** + * optional string ext1 = 1; + * @return {string} + */ +proto.jspb.test.IsExtension.prototype.getExt1 = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.IsExtension} returns this + */ +proto.jspb.test.IsExtension.prototype.setExt1 = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.IsExtension} returns this + */ +proto.jspb.test.IsExtension.prototype.clearExt1 = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.IsExtension.prototype.hasExt1 = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.IndirectExtension.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.IndirectExtension.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.IndirectExtension} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.IndirectExtension.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.IndirectExtension} + */ +proto.jspb.test.IndirectExtension.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.IndirectExtension; + return proto.jspb.test.IndirectExtension.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.IndirectExtension} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.IndirectExtension} + */ +proto.jspb.test.IndirectExtension.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.IndirectExtension.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.IndirectExtension.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.IndirectExtension} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.IndirectExtension.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + +/** + * A tuple of {field number, class constructor} for the extension + * field named `simple`. + * @type {!jspb.ExtensionFieldInfo} + */ +proto.jspb.test.IndirectExtension.simple = new jspb.ExtensionFieldInfo( + 101, + {simple: 0}, + proto.jspb.test.Simple1, + /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( + proto.jspb.test.Simple1.toObject), + 0); + +proto.jspb.test.HasExtensions.extensionsBinary[101] = new jspb.ExtensionFieldBinaryInfo( + proto.jspb.test.IndirectExtension.simple, + jspb.BinaryReader.prototype.readMessage, + jspb.BinaryWriter.prototype.writeMessage, + proto.jspb.test.Simple1.serializeBinaryToWriter, + proto.jspb.test.Simple1.deserializeBinaryFromReader, + false); +// This registers the extension field with the extended class, so that +// toObject() will function correctly. +proto.jspb.test.HasExtensions.extensions[101] = proto.jspb.test.IndirectExtension.simple; + + +/** + * A tuple of {field number, class constructor} for the extension + * field named `str`. + * @type {!jspb.ExtensionFieldInfo} + */ +proto.jspb.test.IndirectExtension.str = new jspb.ExtensionFieldInfo( + 102, + {str: 0}, + null, + /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( + null), + 0); + +proto.jspb.test.HasExtensions.extensionsBinary[102] = new jspb.ExtensionFieldBinaryInfo( + proto.jspb.test.IndirectExtension.str, + jspb.BinaryReader.prototype.readString, + jspb.BinaryWriter.prototype.writeString, + undefined, + undefined, + false); +// This registers the extension field with the extended class, so that +// toObject() will function correctly. +proto.jspb.test.HasExtensions.extensions[102] = proto.jspb.test.IndirectExtension.str; + + +/** + * A tuple of {field number, class constructor} for the extension + * field named `repeatedStrList`. + * @type {!jspb.ExtensionFieldInfo>} + */ +proto.jspb.test.IndirectExtension.repeatedStrList = new jspb.ExtensionFieldInfo( + 103, + {repeatedStrList: 0}, + null, + /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( + null), + 1); + +proto.jspb.test.HasExtensions.extensionsBinary[103] = new jspb.ExtensionFieldBinaryInfo( + proto.jspb.test.IndirectExtension.repeatedStrList, + jspb.BinaryReader.prototype.readString, + jspb.BinaryWriter.prototype.writeRepeatedString, + undefined, + undefined, + false); +// This registers the extension field with the extended class, so that +// toObject() will function correctly. +proto.jspb.test.HasExtensions.extensions[103] = proto.jspb.test.IndirectExtension.repeatedStrList; + + +/** + * A tuple of {field number, class constructor} for the extension + * field named `repeatedSimpleList`. + * @type {!jspb.ExtensionFieldInfo>} + */ +proto.jspb.test.IndirectExtension.repeatedSimpleList = new jspb.ExtensionFieldInfo( + 104, + {repeatedSimpleList: 0}, + proto.jspb.test.Simple1, + /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( + proto.jspb.test.Simple1.toObject), + 1); + +proto.jspb.test.HasExtensions.extensionsBinary[104] = new jspb.ExtensionFieldBinaryInfo( + proto.jspb.test.IndirectExtension.repeatedSimpleList, + jspb.BinaryReader.prototype.readMessage, + jspb.BinaryWriter.prototype.writeRepeatedMessage, + proto.jspb.test.Simple1.serializeBinaryToWriter, + proto.jspb.test.Simple1.deserializeBinaryFromReader, + false); +// This registers the extension field with the extended class, so that +// toObject() will function correctly. +proto.jspb.test.HasExtensions.extensions[104] = proto.jspb.test.IndirectExtension.repeatedSimpleList; + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.DefaultValues.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.DefaultValues.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.DefaultValues} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.DefaultValues.toObject = function(includeInstance, msg) { + var f, obj = { +stringField: jspb.Message.getFieldWithDefault(msg, 1, "default\x3c\x3e\x27\x22abc"), +boolField: jspb.Message.getBooleanFieldWithDefault(msg, 2, true), +intField: jspb.Message.getFieldWithDefault(msg, 3, 11), +enumField: jspb.Message.getFieldWithDefault(msg, 4, 13), +emptyField: jspb.Message.getFieldWithDefault(msg, 6, ""), +bytesField: msg.getBytesField_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.DefaultValues} + */ +proto.jspb.test.DefaultValues.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.DefaultValues; + return proto.jspb.test.DefaultValues.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.DefaultValues} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.DefaultValues} + */ +proto.jspb.test.DefaultValues.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setStringField(value); + break; + case 2: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setBoolField(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt64()); + msg.setIntField(value); + break; + case 4: + var value = /** @type {!proto.jspb.test.DefaultValues.Enum} */ (reader.readEnum()); + msg.setEnumField(value); + break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.setEmptyField(value); + break; + case 8: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setBytesField(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.DefaultValues.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.DefaultValues.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.DefaultValues} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.DefaultValues.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } + f = /** @type {boolean} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeBool( + 2, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 3)); + if (f != null) { + writer.writeInt64( + 3, + f + ); + } + f = /** @type {!proto.jspb.test.DefaultValues.Enum} */ (jspb.Message.getField(message, 4)); + if (f != null) { + writer.writeEnum( + 4, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 6)); + if (f != null) { + writer.writeString( + 6, + f + ); + } + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 8)); + if (f != null) { + writer.writeBytes( + 8, + f + ); + } +}; + + +/** + * @enum {number} + */ +proto.jspb.test.DefaultValues.Enum = { + E1: 13, + E2: 77 +}; + +/** + * optional string string_field = 1; + * @return {string} + */ +proto.jspb.test.DefaultValues.prototype.getStringField = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "default\x3c\x3e\x27\x22abc")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.DefaultValues} returns this + */ +proto.jspb.test.DefaultValues.prototype.setStringField = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.DefaultValues} returns this + */ +proto.jspb.test.DefaultValues.prototype.clearStringField = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.DefaultValues.prototype.hasStringField = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional bool bool_field = 2; + * @return {boolean} + */ +proto.jspb.test.DefaultValues.prototype.getBoolField = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, true)); +}; + + +/** + * @param {boolean} value + * @return {!proto.jspb.test.DefaultValues} returns this + */ +proto.jspb.test.DefaultValues.prototype.setBoolField = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.DefaultValues} returns this + */ +proto.jspb.test.DefaultValues.prototype.clearBoolField = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.DefaultValues.prototype.hasBoolField = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional int64 int_field = 3; + * @return {number} + */ +proto.jspb.test.DefaultValues.prototype.getIntField = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 11)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.DefaultValues} returns this + */ +proto.jspb.test.DefaultValues.prototype.setIntField = function(value) { + return jspb.Message.setField(this, 3, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.DefaultValues} returns this + */ +proto.jspb.test.DefaultValues.prototype.clearIntField = function() { + return jspb.Message.setField(this, 3, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.DefaultValues.prototype.hasIntField = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional Enum enum_field = 4; + * @return {!proto.jspb.test.DefaultValues.Enum} + */ +proto.jspb.test.DefaultValues.prototype.getEnumField = function() { + return /** @type {!proto.jspb.test.DefaultValues.Enum} */ (jspb.Message.getFieldWithDefault(this, 4, 13)); +}; + + +/** + * @param {!proto.jspb.test.DefaultValues.Enum} value + * @return {!proto.jspb.test.DefaultValues} returns this + */ +proto.jspb.test.DefaultValues.prototype.setEnumField = function(value) { + return jspb.Message.setField(this, 4, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.DefaultValues} returns this + */ +proto.jspb.test.DefaultValues.prototype.clearEnumField = function() { + return jspb.Message.setField(this, 4, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.DefaultValues.prototype.hasEnumField = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * optional string empty_field = 6; + * @return {string} + */ +proto.jspb.test.DefaultValues.prototype.getEmptyField = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.DefaultValues} returns this + */ +proto.jspb.test.DefaultValues.prototype.setEmptyField = function(value) { + return jspb.Message.setField(this, 6, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.DefaultValues} returns this + */ +proto.jspb.test.DefaultValues.prototype.clearEmptyField = function() { + return jspb.Message.setField(this, 6, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.DefaultValues.prototype.hasEmptyField = function() { + return jspb.Message.getField(this, 6) != null; +}; + + +/** + * optional bytes bytes_field = 8; + * @return {!(string|Uint8Array)} + */ +proto.jspb.test.DefaultValues.prototype.getBytesField = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 8, "bW9v")); +}; + + +/** + * optional bytes bytes_field = 8; + * This is a type-conversion wrapper around `getBytesField()` + * @return {string} + */ +proto.jspb.test.DefaultValues.prototype.getBytesField_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getBytesField())); +}; + + +/** + * optional bytes bytes_field = 8; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getBytesField()` + * @return {!Uint8Array} + */ +proto.jspb.test.DefaultValues.prototype.getBytesField_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getBytesField())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.jspb.test.DefaultValues} returns this + */ +proto.jspb.test.DefaultValues.prototype.setBytesField = function(value) { + return jspb.Message.setField(this, 8, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.DefaultValues} returns this + */ +proto.jspb.test.DefaultValues.prototype.clearBytesField = function() { + return jspb.Message.setField(this, 8, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.DefaultValues.prototype.hasBytesField = function() { + return jspb.Message.getField(this, 8) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.jspb.test.FloatingPointFields.repeatedFields_ = [3,7]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.FloatingPointFields.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.FloatingPointFields.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.FloatingPointFields} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.FloatingPointFields.toObject = function(includeInstance, msg) { + var f, obj = { +optionalFloatField: (f = jspb.Message.getOptionalFloatingPointField(msg, 1)) == null ? undefined : f, +requiredFloatField: (f = jspb.Message.getOptionalFloatingPointField(msg, 2)) == null ? undefined : f, +repeatedFloatFieldList: (f = jspb.Message.getRepeatedFloatingPointField(msg, 3)) == null ? undefined : f, +defaultFloatField: jspb.Message.getFloatingPointFieldWithDefault(msg, 4, 2.0), +optionalDoubleField: (f = jspb.Message.getOptionalFloatingPointField(msg, 5)) == null ? undefined : f, +requiredDoubleField: (f = jspb.Message.getOptionalFloatingPointField(msg, 6)) == null ? undefined : f, +repeatedDoubleFieldList: (f = jspb.Message.getRepeatedFloatingPointField(msg, 7)) == null ? undefined : f, +defaultDoubleField: jspb.Message.getFloatingPointFieldWithDefault(msg, 8, 2.0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.FloatingPointFields} + */ +proto.jspb.test.FloatingPointFields.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.FloatingPointFields; + return proto.jspb.test.FloatingPointFields.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.FloatingPointFields} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.FloatingPointFields} + */ +proto.jspb.test.FloatingPointFields.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readFloat()); + msg.setOptionalFloatField(value); + break; + case 2: + var value = /** @type {number} */ (reader.readFloat()); + msg.setRequiredFloatField(value); + break; + case 3: + var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readFloat() : [reader.readFloat()]); + for (var i = 0; i < values.length; i++) { + msg.addRepeatedFloatField(values[i]); + } + break; + case 4: + var value = /** @type {number} */ (reader.readFloat()); + msg.setDefaultFloatField(value); + break; + case 5: + var value = /** @type {number} */ (reader.readDouble()); + msg.setOptionalDoubleField(value); + break; + case 6: + var value = /** @type {number} */ (reader.readDouble()); + msg.setRequiredDoubleField(value); + break; + case 7: + var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readDouble() : [reader.readDouble()]); + for (var i = 0; i < values.length; i++) { + msg.addRepeatedDoubleField(values[i]); + } + break; + case 8: + var value = /** @type {number} */ (reader.readDouble()); + msg.setDefaultDoubleField(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.FloatingPointFields.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.FloatingPointFields.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.FloatingPointFields} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.FloatingPointFields.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {number} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeFloat( + 1, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeFloat( + 2, + f + ); + } + f = message.getRepeatedFloatFieldList(); + if (f.length > 0) { + writer.writeRepeatedFloat( + 3, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 4)); + if (f != null) { + writer.writeFloat( + 4, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 5)); + if (f != null) { + writer.writeDouble( + 5, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 6)); + if (f != null) { + writer.writeDouble( + 6, + f + ); + } + f = message.getRepeatedDoubleFieldList(); + if (f.length > 0) { + writer.writeRepeatedDouble( + 7, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 8)); + if (f != null) { + writer.writeDouble( + 8, + f + ); + } +}; + + +/** + * optional float optional_float_field = 1; + * @return {number} + */ +proto.jspb.test.FloatingPointFields.prototype.getOptionalFloatField = function() { + return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 1, 0.0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.setOptionalFloatField = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.clearOptionalFloatField = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.FloatingPointFields.prototype.hasOptionalFloatField = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * required float required_float_field = 2; + * @return {number} + */ +proto.jspb.test.FloatingPointFields.prototype.getRequiredFloatField = function() { + return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 2, 0.0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.setRequiredFloatField = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.clearRequiredFloatField = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.FloatingPointFields.prototype.hasRequiredFloatField = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * repeated float repeated_float_field = 3; + * @return {!Array} + */ +proto.jspb.test.FloatingPointFields.prototype.getRepeatedFloatFieldList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedFloatingPointField(this, 3)); +}; + + +/** + * @param {!Array} value + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.setRepeatedFloatFieldList = function(value) { + return jspb.Message.setField(this, 3, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.addRepeatedFloatField = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 3, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.clearRepeatedFloatFieldList = function() { + return this.setRepeatedFloatFieldList([]); +}; + + +/** + * optional float default_float_field = 4; + * @return {number} + */ +proto.jspb.test.FloatingPointFields.prototype.getDefaultFloatField = function() { + return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 4, 2.0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.setDefaultFloatField = function(value) { + return jspb.Message.setField(this, 4, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.clearDefaultFloatField = function() { + return jspb.Message.setField(this, 4, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.FloatingPointFields.prototype.hasDefaultFloatField = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * optional double optional_double_field = 5; + * @return {number} + */ +proto.jspb.test.FloatingPointFields.prototype.getOptionalDoubleField = function() { + return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 5, 0.0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.setOptionalDoubleField = function(value) { + return jspb.Message.setField(this, 5, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.clearOptionalDoubleField = function() { + return jspb.Message.setField(this, 5, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.FloatingPointFields.prototype.hasOptionalDoubleField = function() { + return jspb.Message.getField(this, 5) != null; +}; + + +/** + * required double required_double_field = 6; + * @return {number} + */ +proto.jspb.test.FloatingPointFields.prototype.getRequiredDoubleField = function() { + return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 6, 0.0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.setRequiredDoubleField = function(value) { + return jspb.Message.setField(this, 6, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.clearRequiredDoubleField = function() { + return jspb.Message.setField(this, 6, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.FloatingPointFields.prototype.hasRequiredDoubleField = function() { + return jspb.Message.getField(this, 6) != null; +}; + + +/** + * repeated double repeated_double_field = 7; + * @return {!Array} + */ +proto.jspb.test.FloatingPointFields.prototype.getRepeatedDoubleFieldList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedFloatingPointField(this, 7)); +}; + + +/** + * @param {!Array} value + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.setRepeatedDoubleFieldList = function(value) { + return jspb.Message.setField(this, 7, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.addRepeatedDoubleField = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 7, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.clearRepeatedDoubleFieldList = function() { + return this.setRepeatedDoubleFieldList([]); +}; + + +/** + * optional double default_double_field = 8; + * @return {number} + */ +proto.jspb.test.FloatingPointFields.prototype.getDefaultDoubleField = function() { + return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 8, 2.0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.setDefaultDoubleField = function(value) { + return jspb.Message.setField(this, 8, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.clearDefaultDoubleField = function() { + return jspb.Message.setField(this, 8, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.FloatingPointFields.prototype.hasDefaultDoubleField = function() { + return jspb.Message.getField(this, 8) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.jspb.test.BooleanFields.repeatedFields_ = [3]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.BooleanFields.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.BooleanFields.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.BooleanFields} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.BooleanFields.toObject = function(includeInstance, msg) { + var f, obj = { +optionalBooleanField: (f = jspb.Message.getBooleanField(msg, 1)) == null ? undefined : f, +requiredBooleanField: (f = jspb.Message.getBooleanField(msg, 2)) == null ? undefined : f, +repeatedBooleanFieldList: (f = jspb.Message.getRepeatedBooleanField(msg, 3)) == null ? undefined : f, +defaultBooleanField: jspb.Message.getBooleanFieldWithDefault(msg, 4, true) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.BooleanFields} + */ +proto.jspb.test.BooleanFields.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.BooleanFields; + return proto.jspb.test.BooleanFields.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.BooleanFields} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.BooleanFields} + */ +proto.jspb.test.BooleanFields.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setOptionalBooleanField(value); + break; + case 2: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setRequiredBooleanField(value); + break; + case 3: + var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readBool() : [reader.readBool()]); + for (var i = 0; i < values.length; i++) { + msg.addRepeatedBooleanField(values[i]); + } + break; + case 4: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setDefaultBooleanField(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.BooleanFields.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.BooleanFields.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.BooleanFields} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.BooleanFields.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {boolean} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeBool( + 1, + f + ); + } + f = /** @type {boolean} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeBool( + 2, + f + ); + } + f = message.getRepeatedBooleanFieldList(); + if (f.length > 0) { + writer.writeRepeatedBool( + 3, + f + ); + } + f = /** @type {boolean} */ (jspb.Message.getField(message, 4)); + if (f != null) { + writer.writeBool( + 4, + f + ); + } +}; + + +/** + * optional bool optional_boolean_field = 1; + * @return {boolean} + */ +proto.jspb.test.BooleanFields.prototype.getOptionalBooleanField = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.jspb.test.BooleanFields} returns this + */ +proto.jspb.test.BooleanFields.prototype.setOptionalBooleanField = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.BooleanFields} returns this + */ +proto.jspb.test.BooleanFields.prototype.clearOptionalBooleanField = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.BooleanFields.prototype.hasOptionalBooleanField = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * required bool required_boolean_field = 2; + * @return {boolean} + */ +proto.jspb.test.BooleanFields.prototype.getRequiredBooleanField = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.jspb.test.BooleanFields} returns this + */ +proto.jspb.test.BooleanFields.prototype.setRequiredBooleanField = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.BooleanFields} returns this + */ +proto.jspb.test.BooleanFields.prototype.clearRequiredBooleanField = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.BooleanFields.prototype.hasRequiredBooleanField = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * repeated bool repeated_boolean_field = 3; + * @return {!Array} + */ +proto.jspb.test.BooleanFields.prototype.getRepeatedBooleanFieldList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedBooleanField(this, 3)); +}; + + +/** + * @param {!Array} value + * @return {!proto.jspb.test.BooleanFields} returns this + */ +proto.jspb.test.BooleanFields.prototype.setRepeatedBooleanFieldList = function(value) { + return jspb.Message.setField(this, 3, value || []); +}; + + +/** + * @param {boolean} value + * @param {number=} opt_index + * @return {!proto.jspb.test.BooleanFields} returns this + */ +proto.jspb.test.BooleanFields.prototype.addRepeatedBooleanField = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 3, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.jspb.test.BooleanFields} returns this + */ +proto.jspb.test.BooleanFields.prototype.clearRepeatedBooleanFieldList = function() { + return this.setRepeatedBooleanFieldList([]); +}; + + +/** + * optional bool default_boolean_field = 4; + * @return {boolean} + */ +proto.jspb.test.BooleanFields.prototype.getDefaultBooleanField = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, true)); +}; + + +/** + * @param {boolean} value + * @return {!proto.jspb.test.BooleanFields} returns this + */ +proto.jspb.test.BooleanFields.prototype.setDefaultBooleanField = function(value) { + return jspb.Message.setField(this, 4, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.BooleanFields} returns this + */ +proto.jspb.test.BooleanFields.prototype.clearDefaultBooleanField = function() { + return jspb.Message.setField(this, 4, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.BooleanFields.prototype.hasDefaultBooleanField = function() { + return jspb.Message.getField(this, 4) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.jspb.test.TestClone.repeatedFields_ = [5]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.TestClone.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.TestClone.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.TestClone} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestClone.toObject = function(includeInstance, msg) { + var f, obj = { +str: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, +simple1: (f = msg.getSimple1()) && proto.jspb.test.Simple1.toObject(includeInstance, f), +simple2List: jspb.Message.toObjectList(msg.getSimple2List(), + proto.jspb.test.Simple1.toObject, includeInstance), +bytesField: msg.getBytesField_asB64(), +unused: (f = jspb.Message.getField(msg, 7)) == null ? undefined : f + }; + + jspb.Message.toObjectExtension(/** @type {!jspb.Message} */ (msg), obj, + proto.jspb.test.TestClone.extensions, proto.jspb.test.TestClone.prototype.getExtension, + includeInstance); + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.TestClone} + */ +proto.jspb.test.TestClone.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.TestClone; + return proto.jspb.test.TestClone.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.TestClone} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.TestClone} + */ +proto.jspb.test.TestClone.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setStr(value); + break; + case 3: + var value = new proto.jspb.test.Simple1; + reader.readMessage(value,proto.jspb.test.Simple1.deserializeBinaryFromReader); + msg.setSimple1(value); + break; + case 5: + var value = new proto.jspb.test.Simple1; + reader.readMessage(value,proto.jspb.test.Simple1.deserializeBinaryFromReader); + msg.addSimple2(value); + break; + case 6: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setBytesField(value); + break; + case 7: + var value = /** @type {string} */ (reader.readString()); + msg.setUnused(value); + break; + default: + jspb.Message.readBinaryExtension(msg, reader, + proto.jspb.test.TestClone.extensionsBinary, + proto.jspb.test.TestClone.prototype.getExtension, + proto.jspb.test.TestClone.prototype.setExtension); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.TestClone.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.TestClone.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.TestClone} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestClone.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } + f = message.getSimple1(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.jspb.test.Simple1.serializeBinaryToWriter + ); + } + f = message.getSimple2List(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 5, + f, + proto.jspb.test.Simple1.serializeBinaryToWriter + ); + } + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 6)); + if (f != null) { + writer.writeBytes( + 6, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 7)); + if (f != null) { + writer.writeString( + 7, + f + ); + } + jspb.Message.serializeBinaryExtensions(message, writer, + proto.jspb.test.TestClone.extensionsBinary, proto.jspb.test.TestClone.prototype.getExtension); +}; + + +/** + * optional string str = 1; + * @return {string} + */ +proto.jspb.test.TestClone.prototype.getStr = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.TestClone} returns this + */ +proto.jspb.test.TestClone.prototype.setStr = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestClone} returns this + */ +proto.jspb.test.TestClone.prototype.clearStr = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestClone.prototype.hasStr = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional Simple1 simple1 = 3; + * @return {?proto.jspb.test.Simple1} + */ +proto.jspb.test.TestClone.prototype.getSimple1 = function() { + return /** @type{?proto.jspb.test.Simple1} */ ( + jspb.Message.getWrapperField(this, proto.jspb.test.Simple1, 3)); +}; + + +/** + * @param {?proto.jspb.test.Simple1|undefined} value + * @return {!proto.jspb.test.TestClone} returns this +*/ +proto.jspb.test.TestClone.prototype.setSimple1 = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.jspb.test.TestClone} returns this + */ +proto.jspb.test.TestClone.prototype.clearSimple1 = function() { + return this.setSimple1(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestClone.prototype.hasSimple1 = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * repeated Simple1 simple2 = 5; + * @return {!Array} + */ +proto.jspb.test.TestClone.prototype.getSimple2List = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.jspb.test.Simple1, 5)); +}; + + +/** + * @param {!Array} value + * @return {!proto.jspb.test.TestClone} returns this +*/ +proto.jspb.test.TestClone.prototype.setSimple2List = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 5, value); +}; + + +/** + * @param {!proto.jspb.test.Simple1=} opt_value + * @param {number=} opt_index + * @return {!proto.jspb.test.Simple1} + */ +proto.jspb.test.TestClone.prototype.addSimple2 = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, proto.jspb.test.Simple1, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.jspb.test.TestClone} returns this + */ +proto.jspb.test.TestClone.prototype.clearSimple2List = function() { + return this.setSimple2List([]); +}; + + +/** + * optional bytes bytes_field = 6; + * @return {!(string|Uint8Array)} + */ +proto.jspb.test.TestClone.prototype.getBytesField = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** + * optional bytes bytes_field = 6; + * This is a type-conversion wrapper around `getBytesField()` + * @return {string} + */ +proto.jspb.test.TestClone.prototype.getBytesField_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getBytesField())); +}; + + +/** + * optional bytes bytes_field = 6; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getBytesField()` + * @return {!Uint8Array} + */ +proto.jspb.test.TestClone.prototype.getBytesField_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getBytesField())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.jspb.test.TestClone} returns this + */ +proto.jspb.test.TestClone.prototype.setBytesField = function(value) { + return jspb.Message.setField(this, 6, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestClone} returns this + */ +proto.jspb.test.TestClone.prototype.clearBytesField = function() { + return jspb.Message.setField(this, 6, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestClone.prototype.hasBytesField = function() { + return jspb.Message.getField(this, 6) != null; +}; + + +/** + * optional string unused = 7; + * @return {string} + */ +proto.jspb.test.TestClone.prototype.getUnused = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.TestClone} returns this + */ +proto.jspb.test.TestClone.prototype.setUnused = function(value) { + return jspb.Message.setField(this, 7, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestClone} returns this + */ +proto.jspb.test.TestClone.prototype.clearUnused = function() { + return jspb.Message.setField(this, 7, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestClone.prototype.hasUnused = function() { + return jspb.Message.getField(this, 7) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.TestCloneExtension.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.TestCloneExtension.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.TestCloneExtension} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestCloneExtension.toObject = function(includeInstance, msg) { + var f, obj = { +f: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.TestCloneExtension} + */ +proto.jspb.test.TestCloneExtension.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.TestCloneExtension; + return proto.jspb.test.TestCloneExtension.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.TestCloneExtension} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.TestCloneExtension} + */ +proto.jspb.test.TestCloneExtension.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt32()); + msg.setF(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.TestCloneExtension.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.TestCloneExtension.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.TestCloneExtension} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestCloneExtension.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {number} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeInt32( + 1, + f + ); + } +}; + + + +/** + * A tuple of {field number, class constructor} for the extension + * field named `lowExt`. + * @type {!jspb.ExtensionFieldInfo} + */ +proto.jspb.test.TestCloneExtension.lowExt = new jspb.ExtensionFieldInfo( + 11, + {lowExt: 0}, + proto.jspb.test.TestCloneExtension, + /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( + proto.jspb.test.TestCloneExtension.toObject), + 0); + +proto.jspb.test.TestClone.extensionsBinary[11] = new jspb.ExtensionFieldBinaryInfo( + proto.jspb.test.TestCloneExtension.lowExt, + jspb.BinaryReader.prototype.readMessage, + jspb.BinaryWriter.prototype.writeMessage, + proto.jspb.test.TestCloneExtension.serializeBinaryToWriter, + proto.jspb.test.TestCloneExtension.deserializeBinaryFromReader, + false); +// This registers the extension field with the extended class, so that +// toObject() will function correctly. +proto.jspb.test.TestClone.extensions[11] = proto.jspb.test.TestCloneExtension.lowExt; + +/** + * optional int32 f = 1; + * @return {number} + */ +proto.jspb.test.TestCloneExtension.prototype.getF = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.TestCloneExtension} returns this + */ +proto.jspb.test.TestCloneExtension.prototype.setF = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestCloneExtension} returns this + */ +proto.jspb.test.TestCloneExtension.prototype.clearF = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestCloneExtension.prototype.hasF = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.CloneExtension.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.CloneExtension.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.CloneExtension} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.CloneExtension.toObject = function(includeInstance, msg) { + var f, obj = { +ext: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.CloneExtension} + */ +proto.jspb.test.CloneExtension.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.CloneExtension; + return proto.jspb.test.CloneExtension.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.CloneExtension} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.CloneExtension} + */ +proto.jspb.test.CloneExtension.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setExt(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.CloneExtension.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.CloneExtension.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.CloneExtension} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.CloneExtension.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeString( + 2, + f + ); + } +}; + + + +/** + * A tuple of {field number, class constructor} for the extension + * field named `extField`. + * @type {!jspb.ExtensionFieldInfo} + */ +proto.jspb.test.CloneExtension.extField = new jspb.ExtensionFieldInfo( + 100, + {extField: 0}, + proto.jspb.test.CloneExtension, + /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( + proto.jspb.test.CloneExtension.toObject), + 0); + +proto.jspb.test.TestClone.extensionsBinary[100] = new jspb.ExtensionFieldBinaryInfo( + proto.jspb.test.CloneExtension.extField, + jspb.BinaryReader.prototype.readMessage, + jspb.BinaryWriter.prototype.writeMessage, + proto.jspb.test.CloneExtension.serializeBinaryToWriter, + proto.jspb.test.CloneExtension.deserializeBinaryFromReader, + false); +// This registers the extension field with the extended class, so that +// toObject() will function correctly. +proto.jspb.test.TestClone.extensions[100] = proto.jspb.test.CloneExtension.extField; + +/** + * optional string ext = 2; + * @return {string} + */ +proto.jspb.test.CloneExtension.prototype.getExt = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.CloneExtension} returns this + */ +proto.jspb.test.CloneExtension.prototype.setExt = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.CloneExtension} returns this + */ +proto.jspb.test.CloneExtension.prototype.clearExt = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.CloneExtension.prototype.hasExt = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.jspb.test.TestGroup.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.TestGroup.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.TestGroup.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.TestGroup} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestGroup.toObject = function(includeInstance, msg) { + var f, obj = { +repeatedGroupList: jspb.Message.toObjectList(msg.getRepeatedGroupList(), + proto.jspb.test.TestGroup.RepeatedGroup.toObject, includeInstance), +requiredGroup: (f = msg.getRequiredGroup()) && proto.jspb.test.TestGroup.RequiredGroup.toObject(includeInstance, f), +optionalGroup: (f = msg.getOptionalGroup()) && proto.jspb.test.TestGroup.OptionalGroup.toObject(includeInstance, f), +id: (f = jspb.Message.getField(msg, 4)) == null ? undefined : f, +requiredSimple: (f = msg.getRequiredSimple()) && proto.jspb.test.Simple2.toObject(includeInstance, f), +optionalSimple: (f = msg.getOptionalSimple()) && proto.jspb.test.Simple2.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.TestGroup} + */ +proto.jspb.test.TestGroup.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.TestGroup; + return proto.jspb.test.TestGroup.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.TestGroup} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.TestGroup} + */ +proto.jspb.test.TestGroup.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.jspb.test.TestGroup.RepeatedGroup; + reader.readGroup(1, value,proto.jspb.test.TestGroup.RepeatedGroup.deserializeBinaryFromReader); + msg.addRepeatedGroup(value); + break; + case 2: + var value = new proto.jspb.test.TestGroup.RequiredGroup; + reader.readGroup(2, value,proto.jspb.test.TestGroup.RequiredGroup.deserializeBinaryFromReader); + msg.setRequiredGroup(value); + break; + case 3: + var value = new proto.jspb.test.TestGroup.OptionalGroup; + reader.readGroup(3, value,proto.jspb.test.TestGroup.OptionalGroup.deserializeBinaryFromReader); + msg.setOptionalGroup(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setId(value); + break; + case 5: + var value = new proto.jspb.test.Simple2; + reader.readMessage(value,proto.jspb.test.Simple2.deserializeBinaryFromReader); + msg.setRequiredSimple(value); + break; + case 6: + var value = new proto.jspb.test.Simple2; + reader.readMessage(value,proto.jspb.test.Simple2.deserializeBinaryFromReader); + msg.setOptionalSimple(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.TestGroup.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.TestGroup.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.TestGroup} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestGroup.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getRepeatedGroupList(); + if (f.length > 0) { + writer.writeRepeatedGroup( + 1, + f, + proto.jspb.test.TestGroup.RepeatedGroup.serializeBinaryToWriter + ); + } + f = message.getRequiredGroup(); + if (f != null) { + writer.writeGroup( + 2, + f, + proto.jspb.test.TestGroup.RequiredGroup.serializeBinaryToWriter + ); + } + f = message.getOptionalGroup(); + if (f != null) { + writer.writeGroup( + 3, + f, + proto.jspb.test.TestGroup.OptionalGroup.serializeBinaryToWriter + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 4)); + if (f != null) { + writer.writeString( + 4, + f + ); + } + f = message.getRequiredSimple(); + if (f != null) { + writer.writeMessage( + 5, + f, + proto.jspb.test.Simple2.serializeBinaryToWriter + ); + } + f = message.getOptionalSimple(); + if (f != null) { + writer.writeMessage( + 6, + f, + proto.jspb.test.Simple2.serializeBinaryToWriter + ); + } +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.jspb.test.TestGroup.RepeatedGroup.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.TestGroup.RepeatedGroup.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.TestGroup.RepeatedGroup.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.TestGroup.RepeatedGroup} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestGroup.RepeatedGroup.toObject = function(includeInstance, msg) { + var f, obj = { +id: (f = jspb.Message.getField(msg, 0)) == null ? undefined : f, +someBoolList: (f = jspb.Message.getRepeatedBooleanField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.TestGroup.RepeatedGroup} + */ +proto.jspb.test.TestGroup.RepeatedGroup.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.TestGroup.RepeatedGroup; + return proto.jspb.test.TestGroup.RepeatedGroup.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.TestGroup.RepeatedGroup} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.TestGroup.RepeatedGroup} + */ +proto.jspb.test.TestGroup.RepeatedGroup.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setId(value); + break; + case 2: + var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readBool() : [reader.readBool()]); + for (var i = 0; i < values.length; i++) { + msg.addSomeBool(values[i]); + } + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.TestGroup.RepeatedGroup.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.TestGroup.RepeatedGroup.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.TestGroup.RepeatedGroup} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestGroup.RepeatedGroup.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 0)); + if (f != null) { + writer.writeString( + 1, + f + ); + } + f = message.getSomeBoolList(); + if (f.length > 0) { + writer.writeRepeatedBool( + 2, + f + ); + } +}; + + +/** + * required string id = 1; + * @return {string} + */ +proto.jspb.test.TestGroup.RepeatedGroup.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 0, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.TestGroup.RepeatedGroup} returns this + */ +proto.jspb.test.TestGroup.RepeatedGroup.prototype.setId = function(value) { + return jspb.Message.setField(this, 0, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestGroup.RepeatedGroup} returns this + */ +proto.jspb.test.TestGroup.RepeatedGroup.prototype.clearId = function() { + return jspb.Message.setField(this, 0, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestGroup.RepeatedGroup.prototype.hasId = function() { + return jspb.Message.getField(this, 0) != null; +}; + + +/** + * repeated bool some_bool = 2; + * @return {!Array} + */ +proto.jspb.test.TestGroup.RepeatedGroup.prototype.getSomeBoolList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedBooleanField(this, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.jspb.test.TestGroup.RepeatedGroup} returns this + */ +proto.jspb.test.TestGroup.RepeatedGroup.prototype.setSomeBoolList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {boolean} value + * @param {number=} opt_index + * @return {!proto.jspb.test.TestGroup.RepeatedGroup} returns this + */ +proto.jspb.test.TestGroup.RepeatedGroup.prototype.addSomeBool = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.jspb.test.TestGroup.RepeatedGroup} returns this + */ +proto.jspb.test.TestGroup.RepeatedGroup.prototype.clearSomeBoolList = function() { + return this.setSomeBoolList([]); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.TestGroup.RequiredGroup.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.TestGroup.RequiredGroup.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.TestGroup.RequiredGroup} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestGroup.RequiredGroup.toObject = function(includeInstance, msg) { + var f, obj = { +id: (f = jspb.Message.getField(msg, -1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.TestGroup.RequiredGroup} + */ +proto.jspb.test.TestGroup.RequiredGroup.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.TestGroup.RequiredGroup; + return proto.jspb.test.TestGroup.RequiredGroup.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.TestGroup.RequiredGroup} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.TestGroup.RequiredGroup} + */ +proto.jspb.test.TestGroup.RequiredGroup.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.TestGroup.RequiredGroup.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.TestGroup.RequiredGroup.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.TestGroup.RequiredGroup} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestGroup.RequiredGroup.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, -1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * required string id = 1; + * @return {string} + */ +proto.jspb.test.TestGroup.RequiredGroup.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, -1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.TestGroup.RequiredGroup} returns this + */ +proto.jspb.test.TestGroup.RequiredGroup.prototype.setId = function(value) { + return jspb.Message.setField(this, -1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestGroup.RequiredGroup} returns this + */ +proto.jspb.test.TestGroup.RequiredGroup.prototype.clearId = function() { + return jspb.Message.setField(this, -1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestGroup.RequiredGroup.prototype.hasId = function() { + return jspb.Message.getField(this, -1) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.TestGroup.OptionalGroup.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.TestGroup.OptionalGroup.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.TestGroup.OptionalGroup} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestGroup.OptionalGroup.toObject = function(includeInstance, msg) { + var f, obj = { +id: (f = jspb.Message.getField(msg, -2)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.TestGroup.OptionalGroup} + */ +proto.jspb.test.TestGroup.OptionalGroup.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.TestGroup.OptionalGroup; + return proto.jspb.test.TestGroup.OptionalGroup.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.TestGroup.OptionalGroup} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.TestGroup.OptionalGroup} + */ +proto.jspb.test.TestGroup.OptionalGroup.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.TestGroup.OptionalGroup.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.TestGroup.OptionalGroup.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.TestGroup.OptionalGroup} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestGroup.OptionalGroup.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, -2)); + if (f != null) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * required string id = 1; + * @return {string} + */ +proto.jspb.test.TestGroup.OptionalGroup.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, -2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.TestGroup.OptionalGroup} returns this + */ +proto.jspb.test.TestGroup.OptionalGroup.prototype.setId = function(value) { + return jspb.Message.setField(this, -2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestGroup.OptionalGroup} returns this + */ +proto.jspb.test.TestGroup.OptionalGroup.prototype.clearId = function() { + return jspb.Message.setField(this, -2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestGroup.OptionalGroup.prototype.hasId = function() { + return jspb.Message.getField(this, -2) != null; +}; + + +/** + * repeated group RepeatedGroup = 1; + * @return {!Array} + */ +proto.jspb.test.TestGroup.prototype.getRepeatedGroupList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.jspb.test.TestGroup.RepeatedGroup, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.jspb.test.TestGroup} returns this +*/ +proto.jspb.test.TestGroup.prototype.setRepeatedGroupList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.jspb.test.TestGroup.RepeatedGroup=} opt_value + * @param {number=} opt_index + * @return {!proto.jspb.test.TestGroup.RepeatedGroup} + */ +proto.jspb.test.TestGroup.prototype.addRepeatedGroup = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.jspb.test.TestGroup.RepeatedGroup, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.jspb.test.TestGroup} returns this + */ +proto.jspb.test.TestGroup.prototype.clearRepeatedGroupList = function() { + return this.setRepeatedGroupList([]); +}; + + +/** + * required group RequiredGroup = 2; + * @return {!proto.jspb.test.TestGroup.RequiredGroup} + */ +proto.jspb.test.TestGroup.prototype.getRequiredGroup = function() { + return /** @type{!proto.jspb.test.TestGroup.RequiredGroup} */ ( + jspb.Message.getWrapperField(this, proto.jspb.test.TestGroup.RequiredGroup, 2, 1)); +}; + + +/** + * @param {!proto.jspb.test.TestGroup.RequiredGroup} value + * @return {!proto.jspb.test.TestGroup} returns this +*/ +proto.jspb.test.TestGroup.prototype.setRequiredGroup = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestGroup} returns this + */ +proto.jspb.test.TestGroup.prototype.clearRequiredGroup = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestGroup.prototype.hasRequiredGroup = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional group OptionalGroup = 3; + * @return {?proto.jspb.test.TestGroup.OptionalGroup} + */ +proto.jspb.test.TestGroup.prototype.getOptionalGroup = function() { + return /** @type{?proto.jspb.test.TestGroup.OptionalGroup} */ ( + jspb.Message.getWrapperField(this, proto.jspb.test.TestGroup.OptionalGroup, 3)); +}; + + +/** + * @param {?proto.jspb.test.TestGroup.OptionalGroup|undefined} value + * @return {!proto.jspb.test.TestGroup} returns this +*/ +proto.jspb.test.TestGroup.prototype.setOptionalGroup = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.jspb.test.TestGroup} returns this + */ +proto.jspb.test.TestGroup.prototype.clearOptionalGroup = function() { + return this.setOptionalGroup(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestGroup.prototype.hasOptionalGroup = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional string id = 4; + * @return {string} + */ +proto.jspb.test.TestGroup.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.TestGroup} returns this + */ +proto.jspb.test.TestGroup.prototype.setId = function(value) { + return jspb.Message.setField(this, 4, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestGroup} returns this + */ +proto.jspb.test.TestGroup.prototype.clearId = function() { + return jspb.Message.setField(this, 4, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestGroup.prototype.hasId = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * required Simple2 required_simple = 5; + * @return {!proto.jspb.test.Simple2} + */ +proto.jspb.test.TestGroup.prototype.getRequiredSimple = function() { + return /** @type{!proto.jspb.test.Simple2} */ ( + jspb.Message.getWrapperField(this, proto.jspb.test.Simple2, 5, 1)); +}; + + +/** + * @param {!proto.jspb.test.Simple2} value + * @return {!proto.jspb.test.TestGroup} returns this +*/ +proto.jspb.test.TestGroup.prototype.setRequiredSimple = function(value) { + return jspb.Message.setWrapperField(this, 5, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestGroup} returns this + */ +proto.jspb.test.TestGroup.prototype.clearRequiredSimple = function() { + return jspb.Message.setField(this, 5, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestGroup.prototype.hasRequiredSimple = function() { + return jspb.Message.getField(this, 5) != null; +}; + + +/** + * optional Simple2 optional_simple = 6; + * @return {?proto.jspb.test.Simple2} + */ +proto.jspb.test.TestGroup.prototype.getOptionalSimple = function() { + return /** @type{?proto.jspb.test.Simple2} */ ( + jspb.Message.getWrapperField(this, proto.jspb.test.Simple2, 6)); +}; + + +/** + * @param {?proto.jspb.test.Simple2|undefined} value + * @return {!proto.jspb.test.TestGroup} returns this +*/ +proto.jspb.test.TestGroup.prototype.setOptionalSimple = function(value) { + return jspb.Message.setWrapperField(this, 6, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.jspb.test.TestGroup} returns this + */ +proto.jspb.test.TestGroup.prototype.clearOptionalSimple = function() { + return this.setOptionalSimple(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestGroup.prototype.hasOptionalSimple = function() { + return jspb.Message.getField(this, 6) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.TestGroup1.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.TestGroup1.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.TestGroup1} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestGroup1.toObject = function(includeInstance, msg) { + var f, obj = { +group: (f = msg.getGroup()) && proto.jspb.test.TestGroup.RepeatedGroup.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.TestGroup1} + */ +proto.jspb.test.TestGroup1.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.TestGroup1; + return proto.jspb.test.TestGroup1.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.TestGroup1} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.TestGroup1} + */ +proto.jspb.test.TestGroup1.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.jspb.test.TestGroup.RepeatedGroup; + reader.readMessage(value,proto.jspb.test.TestGroup.RepeatedGroup.deserializeBinaryFromReader); + msg.setGroup(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.TestGroup1.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.TestGroup1.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.TestGroup1} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestGroup1.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getGroup(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.jspb.test.TestGroup.RepeatedGroup.serializeBinaryToWriter + ); + } +}; + + +/** + * optional TestGroup.RepeatedGroup group = 1; + * @return {?proto.jspb.test.TestGroup.RepeatedGroup} + */ +proto.jspb.test.TestGroup1.prototype.getGroup = function() { + return /** @type{?proto.jspb.test.TestGroup.RepeatedGroup} */ ( + jspb.Message.getWrapperField(this, proto.jspb.test.TestGroup.RepeatedGroup, 1)); +}; + + +/** + * @param {?proto.jspb.test.TestGroup.RepeatedGroup|undefined} value + * @return {!proto.jspb.test.TestGroup1} returns this +*/ +proto.jspb.test.TestGroup1.prototype.setGroup = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.jspb.test.TestGroup1} returns this + */ +proto.jspb.test.TestGroup1.prototype.clearGroup = function() { + return this.setGroup(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestGroup1.prototype.hasGroup = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.TestReservedNames.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.TestReservedNames.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.TestReservedNames} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestReservedNames.toObject = function(includeInstance, msg) { + var f, obj = { +extension: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f + }; + + jspb.Message.toObjectExtension(/** @type {!jspb.Message} */ (msg), obj, + proto.jspb.test.TestReservedNames.extensions, proto.jspb.test.TestReservedNames.prototype.getExtension, + includeInstance); + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.TestReservedNames} + */ +proto.jspb.test.TestReservedNames.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.TestReservedNames; + return proto.jspb.test.TestReservedNames.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.TestReservedNames} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.TestReservedNames} + */ +proto.jspb.test.TestReservedNames.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt32()); + msg.setExtension$(value); + break; + default: + jspb.Message.readBinaryExtension(msg, reader, + proto.jspb.test.TestReservedNames.extensionsBinary, + proto.jspb.test.TestReservedNames.prototype.getExtension, + proto.jspb.test.TestReservedNames.prototype.setExtension); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.TestReservedNames.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.TestReservedNames.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.TestReservedNames} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestReservedNames.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {number} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeInt32( + 1, + f + ); + } + jspb.Message.serializeBinaryExtensions(message, writer, + proto.jspb.test.TestReservedNames.extensionsBinary, proto.jspb.test.TestReservedNames.prototype.getExtension); +}; + + +/** + * optional int32 extension = 1; + * @return {number} + */ +proto.jspb.test.TestReservedNames.prototype.getExtension$ = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.TestReservedNames} returns this + */ +proto.jspb.test.TestReservedNames.prototype.setExtension$ = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestReservedNames} returns this + */ +proto.jspb.test.TestReservedNames.prototype.clearExtension$ = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestReservedNames.prototype.hasExtension$ = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.TestReservedNamesExtension.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.TestReservedNamesExtension.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.TestReservedNamesExtension} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestReservedNamesExtension.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.TestReservedNamesExtension} + */ +proto.jspb.test.TestReservedNamesExtension.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.TestReservedNamesExtension; + return proto.jspb.test.TestReservedNamesExtension.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.TestReservedNamesExtension} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.TestReservedNamesExtension} + */ +proto.jspb.test.TestReservedNamesExtension.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.TestReservedNamesExtension.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.TestReservedNamesExtension.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.TestReservedNamesExtension} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestReservedNamesExtension.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + +/** + * A tuple of {field number, class constructor} for the extension + * field named `foo`. + * @type {!jspb.ExtensionFieldInfo} + */ +proto.jspb.test.TestReservedNamesExtension.foo = new jspb.ExtensionFieldInfo( + 10, + {foo: 0}, + null, + /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( + null), + 0); + +proto.jspb.test.TestReservedNames.extensionsBinary[10] = new jspb.ExtensionFieldBinaryInfo( + proto.jspb.test.TestReservedNamesExtension.foo, + jspb.BinaryReader.prototype.readInt32, + jspb.BinaryWriter.prototype.writeInt32, + undefined, + undefined, + false); +// This registers the extension field with the extended class, so that +// toObject() will function correctly. +proto.jspb.test.TestReservedNames.extensions[10] = proto.jspb.test.TestReservedNamesExtension.foo; + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.jspb.test.TestMessageWithOneof.repeatedFields_ = [9]; + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.jspb.test.TestMessageWithOneof.oneofGroups_ = [[3,5],[6,7],[10,11],[12,13]]; + +/** + * @enum {number} + */ +proto.jspb.test.TestMessageWithOneof.PartialOneofCase = { + PARTIAL_ONEOF_NOT_SET: 0, + PONE: 3, + PTHREE: 5 +}; + +/** + * @return {proto.jspb.test.TestMessageWithOneof.PartialOneofCase} + */ +proto.jspb.test.TestMessageWithOneof.prototype.getPartialOneofCase = function() { + return /** @type {proto.jspb.test.TestMessageWithOneof.PartialOneofCase} */(jspb.Message.computeOneofCase(this, proto.jspb.test.TestMessageWithOneof.oneofGroups_[0])); +}; + +/** + * @enum {number} + */ +proto.jspb.test.TestMessageWithOneof.RecursiveOneofCase = { + RECURSIVE_ONEOF_NOT_SET: 0, + RONE: 6, + RTWO: 7 +}; + +/** + * @return {proto.jspb.test.TestMessageWithOneof.RecursiveOneofCase} + */ +proto.jspb.test.TestMessageWithOneof.prototype.getRecursiveOneofCase = function() { + return /** @type {proto.jspb.test.TestMessageWithOneof.RecursiveOneofCase} */(jspb.Message.computeOneofCase(this, proto.jspb.test.TestMessageWithOneof.oneofGroups_[1])); +}; + +/** + * @enum {number} + */ +proto.jspb.test.TestMessageWithOneof.DefaultOneofACase = { + DEFAULT_ONEOF_A_NOT_SET: 0, + AONE: 10, + ATWO: 11 +}; + +/** + * @return {proto.jspb.test.TestMessageWithOneof.DefaultOneofACase} + */ +proto.jspb.test.TestMessageWithOneof.prototype.getDefaultOneofACase = function() { + return /** @type {proto.jspb.test.TestMessageWithOneof.DefaultOneofACase} */(jspb.Message.computeOneofCase(this, proto.jspb.test.TestMessageWithOneof.oneofGroups_[2])); +}; + +/** + * @enum {number} + */ +proto.jspb.test.TestMessageWithOneof.DefaultOneofBCase = { + DEFAULT_ONEOF_B_NOT_SET: 0, + BONE: 12, + BTWO: 13 +}; + +/** + * @return {proto.jspb.test.TestMessageWithOneof.DefaultOneofBCase} + */ +proto.jspb.test.TestMessageWithOneof.prototype.getDefaultOneofBCase = function() { + return /** @type {proto.jspb.test.TestMessageWithOneof.DefaultOneofBCase} */(jspb.Message.computeOneofCase(this, proto.jspb.test.TestMessageWithOneof.oneofGroups_[3])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.TestMessageWithOneof.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.TestMessageWithOneof.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.TestMessageWithOneof} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestMessageWithOneof.toObject = function(includeInstance, msg) { + var f, obj = { +pone: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f, +pthree: (f = jspb.Message.getField(msg, 5)) == null ? undefined : f, +rone: (f = msg.getRone()) && proto.jspb.test.TestMessageWithOneof.toObject(includeInstance, f), +rtwo: (f = jspb.Message.getField(msg, 7)) == null ? undefined : f, +normalField: (f = jspb.Message.getBooleanField(msg, 8)) == null ? undefined : f, +repeatedFieldList: (f = jspb.Message.getRepeatedField(msg, 9)) == null ? undefined : f, +aone: jspb.Message.getFieldWithDefault(msg, 10, 1234), +atwo: (f = jspb.Message.getField(msg, 11)) == null ? undefined : f, +bone: (f = jspb.Message.getField(msg, 12)) == null ? undefined : f, +btwo: jspb.Message.getFieldWithDefault(msg, 13, 1234) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.TestMessageWithOneof} + */ +proto.jspb.test.TestMessageWithOneof.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.TestMessageWithOneof; + return proto.jspb.test.TestMessageWithOneof.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.TestMessageWithOneof} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.TestMessageWithOneof} + */ +proto.jspb.test.TestMessageWithOneof.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setPone(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.setPthree(value); + break; + case 6: + var value = new proto.jspb.test.TestMessageWithOneof; + reader.readMessage(value,proto.jspb.test.TestMessageWithOneof.deserializeBinaryFromReader); + msg.setRone(value); + break; + case 7: + var value = /** @type {string} */ (reader.readString()); + msg.setRtwo(value); + break; + case 8: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setNormalField(value); + break; + case 9: + var value = /** @type {string} */ (reader.readString()); + msg.addRepeatedField(value); + break; + case 10: + var value = /** @type {number} */ (reader.readInt32()); + msg.setAone(value); + break; + case 11: + var value = /** @type {number} */ (reader.readInt32()); + msg.setAtwo(value); + break; + case 12: + var value = /** @type {number} */ (reader.readInt32()); + msg.setBone(value); + break; + case 13: + var value = /** @type {number} */ (reader.readInt32()); + msg.setBtwo(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.TestMessageWithOneof.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.TestMessageWithOneof.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.TestMessageWithOneof} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestMessageWithOneof.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 3)); + if (f != null) { + writer.writeString( + 3, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 5)); + if (f != null) { + writer.writeString( + 5, + f + ); + } + f = message.getRone(); + if (f != null) { + writer.writeMessage( + 6, + f, + proto.jspb.test.TestMessageWithOneof.serializeBinaryToWriter + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 7)); + if (f != null) { + writer.writeString( + 7, + f + ); + } + f = /** @type {boolean} */ (jspb.Message.getField(message, 8)); + if (f != null) { + writer.writeBool( + 8, + f + ); + } + f = message.getRepeatedFieldList(); + if (f.length > 0) { + writer.writeRepeatedString( + 9, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 10)); + if (f != null) { + writer.writeInt32( + 10, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 11)); + if (f != null) { + writer.writeInt32( + 11, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 12)); + if (f != null) { + writer.writeInt32( + 12, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 13)); + if (f != null) { + writer.writeInt32( + 13, + f + ); + } +}; + + +/** + * optional string pone = 3; + * @return {string} + */ +proto.jspb.test.TestMessageWithOneof.prototype.getPone = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.setPone = function(value) { + return jspb.Message.setOneofField(this, 3, proto.jspb.test.TestMessageWithOneof.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.clearPone = function() { + return jspb.Message.setOneofField(this, 3, proto.jspb.test.TestMessageWithOneof.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestMessageWithOneof.prototype.hasPone = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional string pthree = 5; + * @return {string} + */ +proto.jspb.test.TestMessageWithOneof.prototype.getPthree = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.setPthree = function(value) { + return jspb.Message.setOneofField(this, 5, proto.jspb.test.TestMessageWithOneof.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.clearPthree = function() { + return jspb.Message.setOneofField(this, 5, proto.jspb.test.TestMessageWithOneof.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestMessageWithOneof.prototype.hasPthree = function() { + return jspb.Message.getField(this, 5) != null; +}; + + +/** + * optional TestMessageWithOneof rone = 6; + * @return {?proto.jspb.test.TestMessageWithOneof} + */ +proto.jspb.test.TestMessageWithOneof.prototype.getRone = function() { + return /** @type{?proto.jspb.test.TestMessageWithOneof} */ ( + jspb.Message.getWrapperField(this, proto.jspb.test.TestMessageWithOneof, 6)); +}; + + +/** + * @param {?proto.jspb.test.TestMessageWithOneof|undefined} value + * @return {!proto.jspb.test.TestMessageWithOneof} returns this +*/ +proto.jspb.test.TestMessageWithOneof.prototype.setRone = function(value) { + return jspb.Message.setOneofWrapperField(this, 6, proto.jspb.test.TestMessageWithOneof.oneofGroups_[1], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.clearRone = function() { + return this.setRone(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestMessageWithOneof.prototype.hasRone = function() { + return jspb.Message.getField(this, 6) != null; +}; + + +/** + * optional string rtwo = 7; + * @return {string} + */ +proto.jspb.test.TestMessageWithOneof.prototype.getRtwo = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.setRtwo = function(value) { + return jspb.Message.setOneofField(this, 7, proto.jspb.test.TestMessageWithOneof.oneofGroups_[1], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.clearRtwo = function() { + return jspb.Message.setOneofField(this, 7, proto.jspb.test.TestMessageWithOneof.oneofGroups_[1], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestMessageWithOneof.prototype.hasRtwo = function() { + return jspb.Message.getField(this, 7) != null; +}; + + +/** + * optional bool normal_field = 8; + * @return {boolean} + */ +proto.jspb.test.TestMessageWithOneof.prototype.getNormalField = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 8, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.setNormalField = function(value) { + return jspb.Message.setField(this, 8, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.clearNormalField = function() { + return jspb.Message.setField(this, 8, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestMessageWithOneof.prototype.hasNormalField = function() { + return jspb.Message.getField(this, 8) != null; +}; + + +/** + * repeated string repeated_field = 9; + * @return {!Array} + */ +proto.jspb.test.TestMessageWithOneof.prototype.getRepeatedFieldList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 9)); +}; + + +/** + * @param {!Array} value + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.setRepeatedFieldList = function(value) { + return jspb.Message.setField(this, 9, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.addRepeatedField = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 9, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.clearRepeatedFieldList = function() { + return this.setRepeatedFieldList([]); +}; + + +/** + * optional int32 aone = 10; + * @return {number} + */ +proto.jspb.test.TestMessageWithOneof.prototype.getAone = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 10, 1234)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.setAone = function(value) { + return jspb.Message.setOneofField(this, 10, proto.jspb.test.TestMessageWithOneof.oneofGroups_[2], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.clearAone = function() { + return jspb.Message.setOneofField(this, 10, proto.jspb.test.TestMessageWithOneof.oneofGroups_[2], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestMessageWithOneof.prototype.hasAone = function() { + return jspb.Message.getField(this, 10) != null; +}; + + +/** + * optional int32 atwo = 11; + * @return {number} + */ +proto.jspb.test.TestMessageWithOneof.prototype.getAtwo = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 11, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.setAtwo = function(value) { + return jspb.Message.setOneofField(this, 11, proto.jspb.test.TestMessageWithOneof.oneofGroups_[2], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.clearAtwo = function() { + return jspb.Message.setOneofField(this, 11, proto.jspb.test.TestMessageWithOneof.oneofGroups_[2], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestMessageWithOneof.prototype.hasAtwo = function() { + return jspb.Message.getField(this, 11) != null; +}; + + +/** + * optional int32 bone = 12; + * @return {number} + */ +proto.jspb.test.TestMessageWithOneof.prototype.getBone = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 12, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.setBone = function(value) { + return jspb.Message.setOneofField(this, 12, proto.jspb.test.TestMessageWithOneof.oneofGroups_[3], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.clearBone = function() { + return jspb.Message.setOneofField(this, 12, proto.jspb.test.TestMessageWithOneof.oneofGroups_[3], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestMessageWithOneof.prototype.hasBone = function() { + return jspb.Message.getField(this, 12) != null; +}; + + +/** + * optional int32 btwo = 13; + * @return {number} + */ +proto.jspb.test.TestMessageWithOneof.prototype.getBtwo = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 13, 1234)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.setBtwo = function(value) { + return jspb.Message.setOneofField(this, 13, proto.jspb.test.TestMessageWithOneof.oneofGroups_[3], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.clearBtwo = function() { + return jspb.Message.setOneofField(this, 13, proto.jspb.test.TestMessageWithOneof.oneofGroups_[3], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestMessageWithOneof.prototype.hasBtwo = function() { + return jspb.Message.getField(this, 13) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.TestEndsWithBytes.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.TestEndsWithBytes.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.TestEndsWithBytes} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestEndsWithBytes.toObject = function(includeInstance, msg) { + var f, obj = { +value: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, +data: msg.getData_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.TestEndsWithBytes} + */ +proto.jspb.test.TestEndsWithBytes.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.TestEndsWithBytes; + return proto.jspb.test.TestEndsWithBytes.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.TestEndsWithBytes} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.TestEndsWithBytes} + */ +proto.jspb.test.TestEndsWithBytes.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt32()); + msg.setValue(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setData(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.TestEndsWithBytes.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.TestEndsWithBytes.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.TestEndsWithBytes} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestEndsWithBytes.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {number} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeInt32( + 1, + f + ); + } + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeBytes( + 2, + f + ); + } +}; + + +/** + * optional int32 value = 1; + * @return {number} + */ +proto.jspb.test.TestEndsWithBytes.prototype.getValue = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.TestEndsWithBytes} returns this + */ +proto.jspb.test.TestEndsWithBytes.prototype.setValue = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestEndsWithBytes} returns this + */ +proto.jspb.test.TestEndsWithBytes.prototype.clearValue = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestEndsWithBytes.prototype.hasValue = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional bytes data = 2; + * @return {!(string|Uint8Array)} + */ +proto.jspb.test.TestEndsWithBytes.prototype.getData = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes data = 2; + * This is a type-conversion wrapper around `getData()` + * @return {string} + */ +proto.jspb.test.TestEndsWithBytes.prototype.getData_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getData())); +}; + + +/** + * optional bytes data = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getData()` + * @return {!Uint8Array} + */ +proto.jspb.test.TestEndsWithBytes.prototype.getData_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getData())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.jspb.test.TestEndsWithBytes} returns this + */ +proto.jspb.test.TestEndsWithBytes.prototype.setData = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestEndsWithBytes} returns this + */ +proto.jspb.test.TestEndsWithBytes.prototype.clearData = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestEndsWithBytes.prototype.hasData = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.TestLastFieldBeforePivot.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.TestLastFieldBeforePivot.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.TestLastFieldBeforePivot} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestLastFieldBeforePivot.toObject = function(includeInstance, msg) { + var f, obj = { +lastFieldBeforePivot: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f + }; + + jspb.Message.toObjectExtension(/** @type {!jspb.Message} */ (msg), obj, + proto.jspb.test.TestLastFieldBeforePivot.extensions, proto.jspb.test.TestLastFieldBeforePivot.prototype.getExtension, + includeInstance); + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.TestLastFieldBeforePivot} + */ +proto.jspb.test.TestLastFieldBeforePivot.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.TestLastFieldBeforePivot; + return proto.jspb.test.TestLastFieldBeforePivot.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.TestLastFieldBeforePivot} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.TestLastFieldBeforePivot} + */ +proto.jspb.test.TestLastFieldBeforePivot.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt32()); + msg.setLastFieldBeforePivot(value); + break; + default: + jspb.Message.readBinaryExtension(msg, reader, + proto.jspb.test.TestLastFieldBeforePivot.extensionsBinary, + proto.jspb.test.TestLastFieldBeforePivot.prototype.getExtension, + proto.jspb.test.TestLastFieldBeforePivot.prototype.setExtension); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.TestLastFieldBeforePivot.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.TestLastFieldBeforePivot.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.TestLastFieldBeforePivot} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestLastFieldBeforePivot.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {number} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeInt32( + 1, + f + ); + } + jspb.Message.serializeBinaryExtensions(message, writer, + proto.jspb.test.TestLastFieldBeforePivot.extensionsBinary, proto.jspb.test.TestLastFieldBeforePivot.prototype.getExtension); +}; + + +/** + * optional int32 last_field_before_pivot = 1; + * @return {number} + */ +proto.jspb.test.TestLastFieldBeforePivot.prototype.getLastFieldBeforePivot = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.TestLastFieldBeforePivot} returns this + */ +proto.jspb.test.TestLastFieldBeforePivot.prototype.setLastFieldBeforePivot = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestLastFieldBeforePivot} returns this + */ +proto.jspb.test.TestLastFieldBeforePivot.prototype.clearLastFieldBeforePivot = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestLastFieldBeforePivot.prototype.hasLastFieldBeforePivot = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.Int64Types.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.Int64Types.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.Int64Types} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Int64Types.toObject = function(includeInstance, msg) { + var f, obj = { +int64Normal: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, +int64String: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f, +int64Number: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.Int64Types} + */ +proto.jspb.test.Int64Types.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.Int64Types; + return proto.jspb.test.Int64Types.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.Int64Types} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.Int64Types} + */ +proto.jspb.test.Int64Types.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt64()); + msg.setInt64Normal(value); + break; + case 2: + var value = /** @type {string} */ (reader.readSint64String()); + msg.setInt64String(value); + break; + case 3: + var value = /** @type {number} */ (reader.readUint64()); + msg.setInt64Number(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.Int64Types.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.Int64Types.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.Int64Types} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Int64Types.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {number} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeInt64( + 1, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeSint64String( + 2, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 3)); + if (f != null) { + writer.writeUint64( + 3, + f + ); + } +}; + + +/** + * optional int64 int64_normal = 1; + * @return {number} + */ +proto.jspb.test.Int64Types.prototype.getInt64Normal = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.Int64Types} returns this + */ +proto.jspb.test.Int64Types.prototype.setInt64Normal = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.Int64Types} returns this + */ +proto.jspb.test.Int64Types.prototype.clearInt64Normal = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.Int64Types.prototype.hasInt64Normal = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional sint64 int64_string = 2; + * @return {string} + */ +proto.jspb.test.Int64Types.prototype.getInt64String = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "0")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.Int64Types} returns this + */ +proto.jspb.test.Int64Types.prototype.setInt64String = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.Int64Types} returns this + */ +proto.jspb.test.Int64Types.prototype.clearInt64String = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.Int64Types.prototype.hasInt64String = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional uint64 int64_number = 3; + * @return {number} + */ +proto.jspb.test.Int64Types.prototype.getInt64Number = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.Int64Types} returns this + */ +proto.jspb.test.Int64Types.prototype.setInt64Number = function(value) { + return jspb.Message.setField(this, 3, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.Int64Types} returns this + */ +proto.jspb.test.Int64Types.prototype.clearInt64Number = function() { + return jspb.Message.setField(this, 3, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.Int64Types.prototype.hasInt64Number = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.TestMapFieldsNoBinary.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.TestMapFieldsNoBinary} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestMapFieldsNoBinary.toObject = function(includeInstance, msg) { + var f, obj = { +mapStringStringMap: (f = msg.getMapStringStringMap()) ? f.toObject(includeInstance, undefined) : [], +mapStringInt32Map: (f = msg.getMapStringInt32Map()) ? f.toObject(includeInstance, undefined) : [], +mapStringInt64Map: (f = msg.getMapStringInt64Map()) ? f.toObject(includeInstance, undefined) : [], +mapStringBoolMap: (f = msg.getMapStringBoolMap()) ? f.toObject(includeInstance, undefined) : [], +mapStringDoubleMap: (f = msg.getMapStringDoubleMap()) ? f.toObject(includeInstance, undefined) : [], +mapStringEnumMap: (f = msg.getMapStringEnumMap()) ? f.toObject(includeInstance, undefined) : [], +mapStringMsgMap: (f = msg.getMapStringMsgMap()) ? f.toObject(includeInstance, proto.jspb.test.MapValueMessageNoBinary.toObject) : [], +mapInt32StringMap: (f = msg.getMapInt32StringMap()) ? f.toObject(includeInstance, undefined) : [], +mapInt64StringMap: (f = msg.getMapInt64StringMap()) ? f.toObject(includeInstance, undefined) : [], +mapBoolStringMap: (f = msg.getMapBoolStringMap()) ? f.toObject(includeInstance, undefined) : [], +testMapFields: (f = msg.getTestMapFields()) && proto.jspb.test.TestMapFieldsNoBinary.toObject(includeInstance, f), +mapStringTestmapfieldsMap: (f = msg.getMapStringTestmapfieldsMap()) ? f.toObject(includeInstance, proto.jspb.test.TestMapFieldsNoBinary.toObject) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.TestMapFieldsNoBinary} + */ +proto.jspb.test.TestMapFieldsNoBinary.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.TestMapFieldsNoBinary; + return proto.jspb.test.TestMapFieldsNoBinary.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.TestMapFieldsNoBinary} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.TestMapFieldsNoBinary} + */ +proto.jspb.test.TestMapFieldsNoBinary.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = msg.getMapStringStringMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; + case 2: + var value = msg.getMapStringInt32Map(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readInt32, null, "", 0); + }); + break; + case 3: + var value = msg.getMapStringInt64Map(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readInt64, null, "", 0); + }); + break; + case 4: + var value = msg.getMapStringBoolMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readBool, null, "", false); + }); + break; + case 5: + var value = msg.getMapStringDoubleMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readDouble, null, "", 0.0); + }); + break; + case 6: + var value = msg.getMapStringEnumMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readEnum, null, "", 0); + }); + break; + case 7: + var value = msg.getMapStringMsgMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.jspb.test.MapValueMessageNoBinary.deserializeBinaryFromReader, "", new proto.jspb.test.MapValueMessageNoBinary()); + }); + break; + case 8: + var value = msg.getMapInt32StringMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readInt32, jspb.BinaryReader.prototype.readString, null, 0, ""); + }); + break; + case 9: + var value = msg.getMapInt64StringMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readInt64, jspb.BinaryReader.prototype.readString, null, 0, ""); + }); + break; + case 10: + var value = msg.getMapBoolStringMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readBool, jspb.BinaryReader.prototype.readString, null, false, ""); + }); + break; + case 11: + var value = new proto.jspb.test.TestMapFieldsNoBinary; + reader.readMessage(value,proto.jspb.test.TestMapFieldsNoBinary.deserializeBinaryFromReader); + msg.setTestMapFields(value); + break; + case 12: + var value = msg.getMapStringTestmapfieldsMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.jspb.test.TestMapFieldsNoBinary.deserializeBinaryFromReader, "", new proto.jspb.test.TestMapFieldsNoBinary()); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.TestMapFieldsNoBinary.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.TestMapFieldsNoBinary} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestMapFieldsNoBinary.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getMapStringStringMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } + f = message.getMapStringInt32Map(true); + if (f && f.getLength() > 0) { + f.serializeBinary(2, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeInt32); + } + f = message.getMapStringInt64Map(true); + if (f && f.getLength() > 0) { + f.serializeBinary(3, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeInt64); + } + f = message.getMapStringBoolMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(4, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeBool); + } + f = message.getMapStringDoubleMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(5, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeDouble); + } + f = message.getMapStringEnumMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(6, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeEnum); + } + f = message.getMapStringMsgMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(7, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.jspb.test.MapValueMessageNoBinary.serializeBinaryToWriter); + } + f = message.getMapInt32StringMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(8, writer, jspb.BinaryWriter.prototype.writeInt32, jspb.BinaryWriter.prototype.writeString); + } + f = message.getMapInt64StringMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(9, writer, jspb.BinaryWriter.prototype.writeInt64, jspb.BinaryWriter.prototype.writeString); + } + f = message.getMapBoolStringMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(10, writer, jspb.BinaryWriter.prototype.writeBool, jspb.BinaryWriter.prototype.writeString); + } + f = message.getTestMapFields(); + if (f != null) { + writer.writeMessage( + 11, + f, + proto.jspb.test.TestMapFieldsNoBinary.serializeBinaryToWriter + ); + } + f = message.getMapStringTestmapfieldsMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(12, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.jspb.test.TestMapFieldsNoBinary.serializeBinaryToWriter); + } +}; + + +/** + * map map_string_string = 1; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapStringStringMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 1, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapStringStringMap = function() { + this.getMapStringStringMap().clear(); + return this; +}; + + +/** + * map map_string_int32 = 2; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapStringInt32Map = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 2, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapStringInt32Map = function() { + this.getMapStringInt32Map().clear(); + return this; +}; + + +/** + * map map_string_int64 = 3; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapStringInt64Map = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 3, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapStringInt64Map = function() { + this.getMapStringInt64Map().clear(); + return this; +}; + + +/** + * map map_string_bool = 4; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapStringBoolMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 4, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapStringBoolMap = function() { + this.getMapStringBoolMap().clear(); + return this; +}; + + +/** + * map map_string_double = 5; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapStringDoubleMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 5, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapStringDoubleMap = function() { + this.getMapStringDoubleMap().clear(); + return this; +}; + + +/** + * map map_string_enum = 6; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapStringEnumMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 6, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapStringEnumMap = function() { + this.getMapStringEnumMap().clear(); + return this; +}; + + +/** + * map map_string_msg = 7; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapStringMsgMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 7, opt_noLazyCreate, + proto.jspb.test.MapValueMessageNoBinary)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapStringMsgMap = function() { + this.getMapStringMsgMap().clear(); + return this; +}; + + +/** + * map map_int32_string = 8; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapInt32StringMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 8, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapInt32StringMap = function() { + this.getMapInt32StringMap().clear(); + return this; +}; + + +/** + * map map_int64_string = 9; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapInt64StringMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 9, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapInt64StringMap = function() { + this.getMapInt64StringMap().clear(); + return this; +}; + + +/** + * map map_bool_string = 10; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapBoolStringMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 10, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapBoolStringMap = function() { + this.getMapBoolStringMap().clear(); + return this; +}; + + +/** + * optional TestMapFieldsNoBinary test_map_fields = 11; + * @return {?proto.jspb.test.TestMapFieldsNoBinary} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.getTestMapFields = function() { + return /** @type{?proto.jspb.test.TestMapFieldsNoBinary} */ ( + jspb.Message.getWrapperField(this, proto.jspb.test.TestMapFieldsNoBinary, 11)); +}; + + +/** + * @param {?proto.jspb.test.TestMapFieldsNoBinary|undefined} value + * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this +*/ +proto.jspb.test.TestMapFieldsNoBinary.prototype.setTestMapFields = function(value) { + return jspb.Message.setWrapperField(this, 11, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.clearTestMapFields = function() { + return this.setTestMapFields(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.hasTestMapFields = function() { + return jspb.Message.getField(this, 11) != null; +}; + + +/** + * map map_string_testmapfields = 12; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapStringTestmapfieldsMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 12, opt_noLazyCreate, + proto.jspb.test.TestMapFieldsNoBinary)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapStringTestmapfieldsMap = function() { + this.getMapStringTestmapfieldsMap().clear(); + return this; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.MapValueMessageNoBinary.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.MapValueMessageNoBinary.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.MapValueMessageNoBinary} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.MapValueMessageNoBinary.toObject = function(includeInstance, msg) { + var f, obj = { +foo: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.MapValueMessageNoBinary} + */ +proto.jspb.test.MapValueMessageNoBinary.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.MapValueMessageNoBinary; + return proto.jspb.test.MapValueMessageNoBinary.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.MapValueMessageNoBinary} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.MapValueMessageNoBinary} + */ +proto.jspb.test.MapValueMessageNoBinary.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt32()); + msg.setFoo(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.MapValueMessageNoBinary.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.MapValueMessageNoBinary.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.MapValueMessageNoBinary} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.MapValueMessageNoBinary.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {number} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeInt32( + 1, + f + ); + } +}; + + +/** + * optional int32 foo = 1; + * @return {number} + */ +proto.jspb.test.MapValueMessageNoBinary.prototype.getFoo = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.MapValueMessageNoBinary} returns this + */ +proto.jspb.test.MapValueMessageNoBinary.prototype.setFoo = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.MapValueMessageNoBinary} returns this + */ +proto.jspb.test.MapValueMessageNoBinary.prototype.clearFoo = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.MapValueMessageNoBinary.prototype.hasFoo = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.Deeply.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.Deeply.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.Deeply} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Deeply.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.Deeply} + */ +proto.jspb.test.Deeply.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.Deeply; + return proto.jspb.test.Deeply.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.Deeply} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.Deeply} + */ +proto.jspb.test.Deeply.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.Deeply.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.Deeply.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.Deeply} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Deeply.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.Deeply.Nested.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.Deeply.Nested.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.Deeply.Nested} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Deeply.Nested.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.Deeply.Nested} + */ +proto.jspb.test.Deeply.Nested.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.Deeply.Nested; + return proto.jspb.test.Deeply.Nested.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.Deeply.Nested} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.Deeply.Nested} + */ +proto.jspb.test.Deeply.Nested.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.Deeply.Nested.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.Deeply.Nested.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.Deeply.Nested} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Deeply.Nested.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.Deeply.Nested.Message.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.Deeply.Nested.Message.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.Deeply.Nested.Message} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Deeply.Nested.Message.toObject = function(includeInstance, msg) { + var f, obj = { +count: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.Deeply.Nested.Message} + */ +proto.jspb.test.Deeply.Nested.Message.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.Deeply.Nested.Message; + return proto.jspb.test.Deeply.Nested.Message.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.Deeply.Nested.Message} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.Deeply.Nested.Message} + */ +proto.jspb.test.Deeply.Nested.Message.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt32()); + msg.setCount(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.Deeply.Nested.Message.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.Deeply.Nested.Message.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.Deeply.Nested.Message} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Deeply.Nested.Message.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {number} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeInt32( + 1, + f + ); + } +}; + + +/** + * optional int32 count = 1; + * @return {number} + */ +proto.jspb.test.Deeply.Nested.Message.prototype.getCount = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.Deeply.Nested.Message} returns this + */ +proto.jspb.test.Deeply.Nested.Message.prototype.setCount = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.Deeply.Nested.Message} returns this + */ +proto.jspb.test.Deeply.Nested.Message.prototype.clearCount = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.Deeply.Nested.Message.prototype.hasCount = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * @enum {number} + */ +proto.jspb.test.OuterEnum = { + FOO: 1, + BAR: 2 +}; + +/** + * @enum {number} + */ +proto.jspb.test.MapValueEnumNoBinary = { + MAP_VALUE_FOO_NOBINARY: 0, + MAP_VALUE_BAR_NOBINARY: 1, + MAP_VALUE_BAZ_NOBINARY: 2 +}; + +/** + * @enum {number} + */ +proto.jspb.test.TestAllowAliasEnum = { + TEST_ALLOW_ALIAS_DEFAULT: 0, + VALUE1: 1 +}; + + +/** + * A tuple of {field number, class constructor} for the extension + * field named `simple1`. + * @type {!jspb.ExtensionFieldInfo} + */ +proto.jspb.test.simple1 = new jspb.ExtensionFieldInfo( + 105, + {simple1: 0}, + proto.jspb.test.Simple1, + /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( + proto.jspb.test.Simple1.toObject), + 0); + +proto.jspb.test.HasExtensions.extensionsBinary[105] = new jspb.ExtensionFieldBinaryInfo( + proto.jspb.test.simple1, + jspb.BinaryReader.prototype.readMessage, + jspb.BinaryWriter.prototype.writeMessage, + proto.jspb.test.Simple1.serializeBinaryToWriter, + proto.jspb.test.Simple1.deserializeBinaryFromReader, + false); +// This registers the extension field with the extended class, so that +// toObject() will function correctly. +proto.jspb.test.HasExtensions.extensions[105] = proto.jspb.test.simple1; + + +/** + * A tuple of {field number, class constructor} for the extension + * field named `extendTestLastFieldBeforePivotField`. + * @type {!jspb.ExtensionFieldInfo} + */ +proto.jspb.test.extendTestLastFieldBeforePivotField = new jspb.ExtensionFieldInfo( + 101, + {extendTestLastFieldBeforePivotField: 0}, + null, + /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( + null), + 0); + +proto.jspb.test.TestLastFieldBeforePivot.extensionsBinary[101] = new jspb.ExtensionFieldBinaryInfo( + proto.jspb.test.extendTestLastFieldBeforePivotField, + jspb.BinaryReader.prototype.readInt32, + jspb.BinaryWriter.prototype.writeInt32, + undefined, + undefined, + false); +// This registers the extension field with the extended class, so that +// toObject() will function correctly. +proto.jspb.test.TestLastFieldBeforePivot.extensions[101] = proto.jspb.test.extendTestLastFieldBeforePivotField; + diff --git a/example/test.closure-old.js b/example/test.closure-old.js new file mode 100644 index 0000000..d1f8d94 --- /dev/null +++ b/example/test.closure-old.js @@ -0,0 +1,9724 @@ +// source: test.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + + +goog.provide('proto.jspb.test.BooleanFields'); +goog.provide('proto.jspb.test.CloneExtension'); +goog.provide('proto.jspb.test.Complex'); +goog.provide('proto.jspb.test.Complex.Nested'); +goog.provide('proto.jspb.test.Deeply'); +goog.provide('proto.jspb.test.Deeply.Nested'); +goog.provide('proto.jspb.test.Deeply.Nested.Message'); +goog.provide('proto.jspb.test.DefaultValues'); +goog.provide('proto.jspb.test.DefaultValues.Enum'); +goog.provide('proto.jspb.test.Empty'); +goog.provide('proto.jspb.test.EnumContainer'); +goog.provide('proto.jspb.test.FloatingPointFields'); +goog.provide('proto.jspb.test.HasExtensions'); +goog.provide('proto.jspb.test.IndirectExtension'); +goog.provide('proto.jspb.test.Int64Types'); +goog.provide('proto.jspb.test.IsExtension'); +goog.provide('proto.jspb.test.MapValueEnumNoBinary'); +goog.provide('proto.jspb.test.MapValueMessageNoBinary'); +goog.provide('proto.jspb.test.MineField'); +goog.provide('proto.jspb.test.OptionalFields'); +goog.provide('proto.jspb.test.OptionalFields.Nested'); +goog.provide('proto.jspb.test.OuterEnum'); +goog.provide('proto.jspb.test.OuterMessage'); +goog.provide('proto.jspb.test.OuterMessage.Complex'); +goog.provide('proto.jspb.test.Simple1'); +goog.provide('proto.jspb.test.Simple2'); +goog.provide('proto.jspb.test.SpecialCases'); +goog.provide('proto.jspb.test.TestAllowAliasEnum'); +goog.provide('proto.jspb.test.TestClone'); +goog.provide('proto.jspb.test.TestCloneExtension'); +goog.provide('proto.jspb.test.TestEndsWithBytes'); +goog.provide('proto.jspb.test.TestGroup'); +goog.provide('proto.jspb.test.TestGroup.OptionalGroup'); +goog.provide('proto.jspb.test.TestGroup.RepeatedGroup'); +goog.provide('proto.jspb.test.TestGroup.RequiredGroup'); +goog.provide('proto.jspb.test.TestGroup1'); +goog.provide('proto.jspb.test.TestLastFieldBeforePivot'); +goog.provide('proto.jspb.test.TestMapFieldsNoBinary'); +goog.provide('proto.jspb.test.TestMessageWithOneof'); +goog.provide('proto.jspb.test.TestMessageWithOneof.DefaultOneofACase'); +goog.provide('proto.jspb.test.TestMessageWithOneof.DefaultOneofBCase'); +goog.provide('proto.jspb.test.TestMessageWithOneof.PartialOneofCase'); +goog.provide('proto.jspb.test.TestMessageWithOneof.RecursiveOneofCase'); +goog.provide('proto.jspb.test.TestReservedNames'); +goog.provide('proto.jspb.test.TestReservedNamesExtension'); +goog.provide('proto.jspb.test.extendTestLastFieldBeforePivotField'); +goog.provide('proto.jspb.test.simple1'); + +goog.require('jspb.BinaryReader'); +goog.require('jspb.BinaryWriter'); +goog.require('jspb.ExtensionFieldBinaryInfo'); +goog.require('jspb.ExtensionFieldInfo'); +goog.require('jspb.Map'); +goog.require('jspb.Message'); + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.Empty = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.Empty, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.Empty.displayName = 'proto.jspb.test.Empty'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.EnumContainer = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.EnumContainer, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.EnumContainer.displayName = 'proto.jspb.test.EnumContainer'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.Simple1 = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.jspb.test.Simple1.repeatedFields_, null); +}; +goog.inherits(proto.jspb.test.Simple1, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.Simple1.displayName = 'proto.jspb.test.Simple1'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.Simple2 = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.jspb.test.Simple2.repeatedFields_, null); +}; +goog.inherits(proto.jspb.test.Simple2, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.Simple2.displayName = 'proto.jspb.test.Simple2'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.SpecialCases = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.SpecialCases, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.SpecialCases.displayName = 'proto.jspb.test.SpecialCases'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.OptionalFields = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.jspb.test.OptionalFields.repeatedFields_, null); +}; +goog.inherits(proto.jspb.test.OptionalFields, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.OptionalFields.displayName = 'proto.jspb.test.OptionalFields'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.OptionalFields.Nested = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.OptionalFields.Nested, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.OptionalFields.Nested.displayName = 'proto.jspb.test.OptionalFields.Nested'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.HasExtensions = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, 4, null, null); +}; +goog.inherits(proto.jspb.test.HasExtensions, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.HasExtensions.displayName = 'proto.jspb.test.HasExtensions'; +} + +/** + * The extensions registered with this message class. This is a map of + * extension field number to fieldInfo object. + * + * For example: + * { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, ctor: proto.example.MyMessage} } + * + * fieldName contains the JsCompiler renamed field name property so that it + * works in OPTIMIZED mode. + * + * @type {!Object} + */ +proto.jspb.test.HasExtensions.extensions = {}; + + +/** + * The extensions registered with this message class. This is a map of + * extension field number to fieldInfo object. + * + * For example: + * { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, ctor: proto.example.MyMessage} } + * + * fieldName contains the JsCompiler renamed field name property so that it + * works in OPTIMIZED mode. + * + * @type {!Object} + */ +proto.jspb.test.HasExtensions.extensionsBinary = {}; + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.Complex = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.jspb.test.Complex.repeatedFields_, null); +}; +goog.inherits(proto.jspb.test.Complex, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.Complex.displayName = 'proto.jspb.test.Complex'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.Complex.Nested = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.Complex.Nested, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.Complex.Nested.displayName = 'proto.jspb.test.Complex.Nested'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.OuterMessage = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.OuterMessage, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.OuterMessage.displayName = 'proto.jspb.test.OuterMessage'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.OuterMessage.Complex = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.OuterMessage.Complex, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.OuterMessage.Complex.displayName = 'proto.jspb.test.OuterMessage.Complex'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.MineField = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.MineField, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.MineField.displayName = 'proto.jspb.test.MineField'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.IsExtension = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.IsExtension, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.IsExtension.displayName = 'proto.jspb.test.IsExtension'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.IndirectExtension = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.IndirectExtension, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.IndirectExtension.displayName = 'proto.jspb.test.IndirectExtension'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.DefaultValues = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.DefaultValues, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.DefaultValues.displayName = 'proto.jspb.test.DefaultValues'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.FloatingPointFields = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.jspb.test.FloatingPointFields.repeatedFields_, null); +}; +goog.inherits(proto.jspb.test.FloatingPointFields, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.FloatingPointFields.displayName = 'proto.jspb.test.FloatingPointFields'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.BooleanFields = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.jspb.test.BooleanFields.repeatedFields_, null); +}; +goog.inherits(proto.jspb.test.BooleanFields, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.BooleanFields.displayName = 'proto.jspb.test.BooleanFields'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.TestClone = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, 8, proto.jspb.test.TestClone.repeatedFields_, null); +}; +goog.inherits(proto.jspb.test.TestClone, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.TestClone.displayName = 'proto.jspb.test.TestClone'; +} + +/** + * The extensions registered with this message class. This is a map of + * extension field number to fieldInfo object. + * + * For example: + * { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, ctor: proto.example.MyMessage} } + * + * fieldName contains the JsCompiler renamed field name property so that it + * works in OPTIMIZED mode. + * + * @type {!Object} + */ +proto.jspb.test.TestClone.extensions = {}; + + +/** + * The extensions registered with this message class. This is a map of + * extension field number to fieldInfo object. + * + * For example: + * { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, ctor: proto.example.MyMessage} } + * + * fieldName contains the JsCompiler renamed field name property so that it + * works in OPTIMIZED mode. + * + * @type {!Object} + */ +proto.jspb.test.TestClone.extensionsBinary = {}; + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.TestCloneExtension = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.TestCloneExtension, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.TestCloneExtension.displayName = 'proto.jspb.test.TestCloneExtension'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.CloneExtension = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.CloneExtension, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.CloneExtension.displayName = 'proto.jspb.test.CloneExtension'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.TestGroup = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.jspb.test.TestGroup.repeatedFields_, null); +}; +goog.inherits(proto.jspb.test.TestGroup, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.TestGroup.displayName = 'proto.jspb.test.TestGroup'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.TestGroup.RepeatedGroup = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.jspb.test.TestGroup.RepeatedGroup.repeatedFields_, null); +}; +goog.inherits(proto.jspb.test.TestGroup.RepeatedGroup, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.TestGroup.RepeatedGroup.displayName = 'proto.jspb.test.TestGroup.RepeatedGroup'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.TestGroup.RequiredGroup = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.TestGroup.RequiredGroup, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.TestGroup.RequiredGroup.displayName = 'proto.jspb.test.TestGroup.RequiredGroup'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.TestGroup.OptionalGroup = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.TestGroup.OptionalGroup, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.TestGroup.OptionalGroup.displayName = 'proto.jspb.test.TestGroup.OptionalGroup'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.TestGroup1 = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.TestGroup1, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.TestGroup1.displayName = 'proto.jspb.test.TestGroup1'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.TestReservedNames = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, 2, null, null); +}; +goog.inherits(proto.jspb.test.TestReservedNames, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.TestReservedNames.displayName = 'proto.jspb.test.TestReservedNames'; +} + +/** + * The extensions registered with this message class. This is a map of + * extension field number to fieldInfo object. + * + * For example: + * { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, ctor: proto.example.MyMessage} } + * + * fieldName contains the JsCompiler renamed field name property so that it + * works in OPTIMIZED mode. + * + * @type {!Object} + */ +proto.jspb.test.TestReservedNames.extensions = {}; + + +/** + * The extensions registered with this message class. This is a map of + * extension field number to fieldInfo object. + * + * For example: + * { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, ctor: proto.example.MyMessage} } + * + * fieldName contains the JsCompiler renamed field name property so that it + * works in OPTIMIZED mode. + * + * @type {!Object} + */ +proto.jspb.test.TestReservedNames.extensionsBinary = {}; + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.TestReservedNamesExtension = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.TestReservedNamesExtension, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.TestReservedNamesExtension.displayName = 'proto.jspb.test.TestReservedNamesExtension'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.TestMessageWithOneof = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.jspb.test.TestMessageWithOneof.repeatedFields_, proto.jspb.test.TestMessageWithOneof.oneofGroups_); +}; +goog.inherits(proto.jspb.test.TestMessageWithOneof, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.TestMessageWithOneof.displayName = 'proto.jspb.test.TestMessageWithOneof'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.TestEndsWithBytes = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.TestEndsWithBytes, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.TestEndsWithBytes.displayName = 'proto.jspb.test.TestEndsWithBytes'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.TestLastFieldBeforePivot = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, 2, null, null); +}; +goog.inherits(proto.jspb.test.TestLastFieldBeforePivot, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.TestLastFieldBeforePivot.displayName = 'proto.jspb.test.TestLastFieldBeforePivot'; +} + +/** + * The extensions registered with this message class. This is a map of + * extension field number to fieldInfo object. + * + * For example: + * { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, ctor: proto.example.MyMessage} } + * + * fieldName contains the JsCompiler renamed field name property so that it + * works in OPTIMIZED mode. + * + * @type {!Object} + */ +proto.jspb.test.TestLastFieldBeforePivot.extensions = {}; + + +/** + * The extensions registered with this message class. This is a map of + * extension field number to fieldInfo object. + * + * For example: + * { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, ctor: proto.example.MyMessage} } + * + * fieldName contains the JsCompiler renamed field name property so that it + * works in OPTIMIZED mode. + * + * @type {!Object} + */ +proto.jspb.test.TestLastFieldBeforePivot.extensionsBinary = {}; + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.Int64Types = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.Int64Types, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.Int64Types.displayName = 'proto.jspb.test.Int64Types'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.TestMapFieldsNoBinary = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.TestMapFieldsNoBinary, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.TestMapFieldsNoBinary.displayName = 'proto.jspb.test.TestMapFieldsNoBinary'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.MapValueMessageNoBinary = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.MapValueMessageNoBinary, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.MapValueMessageNoBinary.displayName = 'proto.jspb.test.MapValueMessageNoBinary'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.Deeply = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.Deeply, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.Deeply.displayName = 'proto.jspb.test.Deeply'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.Deeply.Nested = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.Deeply.Nested, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.Deeply.Nested.displayName = 'proto.jspb.test.Deeply.Nested'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.jspb.test.Deeply.Nested.Message = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.jspb.test.Deeply.Nested.Message, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.jspb.test.Deeply.Nested.Message.displayName = 'proto.jspb.test.Deeply.Nested.Message'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.Empty.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.Empty.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.Empty} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Empty.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.Empty} + */ +proto.jspb.test.Empty.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.Empty; + return proto.jspb.test.Empty.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.Empty} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.Empty} + */ +proto.jspb.test.Empty.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.Empty.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.Empty.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.Empty} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Empty.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.EnumContainer.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.EnumContainer.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.EnumContainer} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.EnumContainer.toObject = function(includeInstance, msg) { + var f, obj = { +outerEnum: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.EnumContainer} + */ +proto.jspb.test.EnumContainer.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.EnumContainer; + return proto.jspb.test.EnumContainer.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.EnumContainer} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.EnumContainer} + */ +proto.jspb.test.EnumContainer.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.jspb.test.OuterEnum} */ (reader.readEnum()); + msg.setOuterEnum(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.EnumContainer.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.EnumContainer.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.EnumContainer} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.EnumContainer.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {!proto.jspb.test.OuterEnum} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeEnum( + 1, + f + ); + } +}; + + +/** + * optional OuterEnum outer_enum = 1; + * @return {!proto.jspb.test.OuterEnum} + */ +proto.jspb.test.EnumContainer.prototype.getOuterEnum = function() { + return /** @type {!proto.jspb.test.OuterEnum} */ (jspb.Message.getFieldWithDefault(this, 1, 1)); +}; + + +/** + * @param {!proto.jspb.test.OuterEnum} value + * @return {!proto.jspb.test.EnumContainer} returns this + */ +proto.jspb.test.EnumContainer.prototype.setOuterEnum = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.EnumContainer} returns this + */ +proto.jspb.test.EnumContainer.prototype.clearOuterEnum = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.EnumContainer.prototype.hasOuterEnum = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.jspb.test.Simple1.repeatedFields_ = [2]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.Simple1.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.Simple1.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.Simple1} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Simple1.toObject = function(includeInstance, msg) { + var f, obj = { +aString: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, +aRepeatedStringList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? undefined : f, +aBoolean: (f = jspb.Message.getBooleanField(msg, 3)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.Simple1} + */ +proto.jspb.test.Simple1.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.Simple1; + return proto.jspb.test.Simple1.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.Simple1} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.Simple1} + */ +proto.jspb.test.Simple1.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setAString(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.addARepeatedString(value); + break; + case 3: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setABoolean(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.Simple1.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.Simple1.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.Simple1} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Simple1.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } + f = message.getARepeatedStringList(); + if (f.length > 0) { + writer.writeRepeatedString( + 2, + f + ); + } + f = /** @type {boolean} */ (jspb.Message.getField(message, 3)); + if (f != null) { + writer.writeBool( + 3, + f + ); + } +}; + + +/** + * required string a_string = 1; + * @return {string} + */ +proto.jspb.test.Simple1.prototype.getAString = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.Simple1} returns this + */ +proto.jspb.test.Simple1.prototype.setAString = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.Simple1} returns this + */ +proto.jspb.test.Simple1.prototype.clearAString = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.Simple1.prototype.hasAString = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * repeated string a_repeated_string = 2; + * @return {!Array} + */ +proto.jspb.test.Simple1.prototype.getARepeatedStringList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.jspb.test.Simple1} returns this + */ +proto.jspb.test.Simple1.prototype.setARepeatedStringList = function(value) { + return jspb.Message.setField(this, 2, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.jspb.test.Simple1} returns this + */ +proto.jspb.test.Simple1.prototype.addARepeatedString = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 2, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.jspb.test.Simple1} returns this + */ +proto.jspb.test.Simple1.prototype.clearARepeatedStringList = function() { + return this.setARepeatedStringList([]); +}; + + +/** + * optional bool a_boolean = 3; + * @return {boolean} + */ +proto.jspb.test.Simple1.prototype.getABoolean = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.jspb.test.Simple1} returns this + */ +proto.jspb.test.Simple1.prototype.setABoolean = function(value) { + return jspb.Message.setField(this, 3, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.Simple1} returns this + */ +proto.jspb.test.Simple1.prototype.clearABoolean = function() { + return jspb.Message.setField(this, 3, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.Simple1.prototype.hasABoolean = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.jspb.test.Simple2.repeatedFields_ = [2]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.Simple2.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.Simple2.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.Simple2} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Simple2.toObject = function(includeInstance, msg) { + var f, obj = { +aString: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, +aRepeatedStringList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.Simple2} + */ +proto.jspb.test.Simple2.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.Simple2; + return proto.jspb.test.Simple2.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.Simple2} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.Simple2} + */ +proto.jspb.test.Simple2.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setAString(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.addARepeatedString(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.Simple2.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.Simple2.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.Simple2} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Simple2.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } + f = message.getARepeatedStringList(); + if (f.length > 0) { + writer.writeRepeatedString( + 2, + f + ); + } +}; + + +/** + * required string a_string = 1; + * @return {string} + */ +proto.jspb.test.Simple2.prototype.getAString = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.Simple2} returns this + */ +proto.jspb.test.Simple2.prototype.setAString = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.Simple2} returns this + */ +proto.jspb.test.Simple2.prototype.clearAString = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.Simple2.prototype.hasAString = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * repeated string a_repeated_string = 2; + * @return {!Array} + */ +proto.jspb.test.Simple2.prototype.getARepeatedStringList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.jspb.test.Simple2} returns this + */ +proto.jspb.test.Simple2.prototype.setARepeatedStringList = function(value) { + return jspb.Message.setField(this, 2, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.jspb.test.Simple2} returns this + */ +proto.jspb.test.Simple2.prototype.addARepeatedString = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 2, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.jspb.test.Simple2} returns this + */ +proto.jspb.test.Simple2.prototype.clearARepeatedStringList = function() { + return this.setARepeatedStringList([]); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.SpecialCases.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.SpecialCases.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.SpecialCases} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.SpecialCases.toObject = function(includeInstance, msg) { + var f, obj = { +normal: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, +pb_default: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f, +pb_function: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f, +pb_var: (f = jspb.Message.getField(msg, 4)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.SpecialCases} + */ +proto.jspb.test.SpecialCases.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.SpecialCases; + return proto.jspb.test.SpecialCases.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.SpecialCases} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.SpecialCases} + */ +proto.jspb.test.SpecialCases.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setNormal(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setDefault(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setFunction(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setVar(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.SpecialCases.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.SpecialCases.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.SpecialCases} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.SpecialCases.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeString( + 2, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 3)); + if (f != null) { + writer.writeString( + 3, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 4)); + if (f != null) { + writer.writeString( + 4, + f + ); + } +}; + + +/** + * required string normal = 1; + * @return {string} + */ +proto.jspb.test.SpecialCases.prototype.getNormal = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.SpecialCases} returns this + */ +proto.jspb.test.SpecialCases.prototype.setNormal = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.SpecialCases} returns this + */ +proto.jspb.test.SpecialCases.prototype.clearNormal = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.SpecialCases.prototype.hasNormal = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * required string default = 2; + * @return {string} + */ +proto.jspb.test.SpecialCases.prototype.getDefault = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.SpecialCases} returns this + */ +proto.jspb.test.SpecialCases.prototype.setDefault = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.SpecialCases} returns this + */ +proto.jspb.test.SpecialCases.prototype.clearDefault = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.SpecialCases.prototype.hasDefault = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * required string function = 3; + * @return {string} + */ +proto.jspb.test.SpecialCases.prototype.getFunction = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.SpecialCases} returns this + */ +proto.jspb.test.SpecialCases.prototype.setFunction = function(value) { + return jspb.Message.setField(this, 3, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.SpecialCases} returns this + */ +proto.jspb.test.SpecialCases.prototype.clearFunction = function() { + return jspb.Message.setField(this, 3, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.SpecialCases.prototype.hasFunction = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * required string var = 4; + * @return {string} + */ +proto.jspb.test.SpecialCases.prototype.getVar = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.SpecialCases} returns this + */ +proto.jspb.test.SpecialCases.prototype.setVar = function(value) { + return jspb.Message.setField(this, 4, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.SpecialCases} returns this + */ +proto.jspb.test.SpecialCases.prototype.clearVar = function() { + return jspb.Message.setField(this, 4, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.SpecialCases.prototype.hasVar = function() { + return jspb.Message.getField(this, 4) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.jspb.test.OptionalFields.repeatedFields_ = [4,5]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.OptionalFields.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.OptionalFields.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.OptionalFields} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.OptionalFields.toObject = function(includeInstance, msg) { + var f, obj = { +aString: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, +aBool: (f = jspb.Message.getBooleanField(msg, 2)) == null ? undefined : f, +aNestedMessage: (f = msg.getANestedMessage()) && proto.jspb.test.OptionalFields.Nested.toObject(includeInstance, f), +aRepeatedMessageList: jspb.Message.toObjectList(msg.getARepeatedMessageList(), + proto.jspb.test.OptionalFields.Nested.toObject, includeInstance), +aRepeatedStringList: (f = jspb.Message.getRepeatedField(msg, 5)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.OptionalFields} + */ +proto.jspb.test.OptionalFields.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.OptionalFields; + return proto.jspb.test.OptionalFields.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.OptionalFields} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.OptionalFields} + */ +proto.jspb.test.OptionalFields.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setAString(value); + break; + case 2: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setABool(value); + break; + case 3: + var value = new proto.jspb.test.OptionalFields.Nested; + reader.readMessage(value,proto.jspb.test.OptionalFields.Nested.deserializeBinaryFromReader); + msg.setANestedMessage(value); + break; + case 4: + var value = new proto.jspb.test.OptionalFields.Nested; + reader.readMessage(value,proto.jspb.test.OptionalFields.Nested.deserializeBinaryFromReader); + msg.addARepeatedMessage(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.addARepeatedString(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.OptionalFields.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.OptionalFields.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.OptionalFields} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.OptionalFields.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } + f = /** @type {boolean} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeBool( + 2, + f + ); + } + f = message.getANestedMessage(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.jspb.test.OptionalFields.Nested.serializeBinaryToWriter + ); + } + f = message.getARepeatedMessageList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 4, + f, + proto.jspb.test.OptionalFields.Nested.serializeBinaryToWriter + ); + } + f = message.getARepeatedStringList(); + if (f.length > 0) { + writer.writeRepeatedString( + 5, + f + ); + } +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.OptionalFields.Nested.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.OptionalFields.Nested.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.OptionalFields.Nested} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.OptionalFields.Nested.toObject = function(includeInstance, msg) { + var f, obj = { +anInt: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.OptionalFields.Nested} + */ +proto.jspb.test.OptionalFields.Nested.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.OptionalFields.Nested; + return proto.jspb.test.OptionalFields.Nested.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.OptionalFields.Nested} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.OptionalFields.Nested} + */ +proto.jspb.test.OptionalFields.Nested.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt32()); + msg.setAnInt(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.OptionalFields.Nested.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.OptionalFields.Nested.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.OptionalFields.Nested} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.OptionalFields.Nested.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {number} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeInt32( + 1, + f + ); + } +}; + + +/** + * optional int32 an_int = 1; + * @return {number} + */ +proto.jspb.test.OptionalFields.Nested.prototype.getAnInt = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.OptionalFields.Nested} returns this + */ +proto.jspb.test.OptionalFields.Nested.prototype.setAnInt = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.OptionalFields.Nested} returns this + */ +proto.jspb.test.OptionalFields.Nested.prototype.clearAnInt = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.OptionalFields.Nested.prototype.hasAnInt = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional string a_string = 1; + * @return {string} + */ +proto.jspb.test.OptionalFields.prototype.getAString = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.OptionalFields} returns this + */ +proto.jspb.test.OptionalFields.prototype.setAString = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.OptionalFields} returns this + */ +proto.jspb.test.OptionalFields.prototype.clearAString = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.OptionalFields.prototype.hasAString = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * required bool a_bool = 2; + * @return {boolean} + */ +proto.jspb.test.OptionalFields.prototype.getABool = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.jspb.test.OptionalFields} returns this + */ +proto.jspb.test.OptionalFields.prototype.setABool = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.OptionalFields} returns this + */ +proto.jspb.test.OptionalFields.prototype.clearABool = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.OptionalFields.prototype.hasABool = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional Nested a_nested_message = 3; + * @return {?proto.jspb.test.OptionalFields.Nested} + */ +proto.jspb.test.OptionalFields.prototype.getANestedMessage = function() { + return /** @type{?proto.jspb.test.OptionalFields.Nested} */ ( + jspb.Message.getWrapperField(this, proto.jspb.test.OptionalFields.Nested, 3)); +}; + + +/** + * @param {?proto.jspb.test.OptionalFields.Nested|undefined} value + * @return {!proto.jspb.test.OptionalFields} returns this +*/ +proto.jspb.test.OptionalFields.prototype.setANestedMessage = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.jspb.test.OptionalFields} returns this + */ +proto.jspb.test.OptionalFields.prototype.clearANestedMessage = function() { + return this.setANestedMessage(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.OptionalFields.prototype.hasANestedMessage = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * repeated Nested a_repeated_message = 4; + * @return {!Array} + */ +proto.jspb.test.OptionalFields.prototype.getARepeatedMessageList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.jspb.test.OptionalFields.Nested, 4)); +}; + + +/** + * @param {!Array} value + * @return {!proto.jspb.test.OptionalFields} returns this +*/ +proto.jspb.test.OptionalFields.prototype.setARepeatedMessageList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 4, value); +}; + + +/** + * @param {!proto.jspb.test.OptionalFields.Nested=} opt_value + * @param {number=} opt_index + * @return {!proto.jspb.test.OptionalFields.Nested} + */ +proto.jspb.test.OptionalFields.prototype.addARepeatedMessage = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.jspb.test.OptionalFields.Nested, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.jspb.test.OptionalFields} returns this + */ +proto.jspb.test.OptionalFields.prototype.clearARepeatedMessageList = function() { + return this.setARepeatedMessageList([]); +}; + + +/** + * repeated string a_repeated_string = 5; + * @return {!Array} + */ +proto.jspb.test.OptionalFields.prototype.getARepeatedStringList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 5)); +}; + + +/** + * @param {!Array} value + * @return {!proto.jspb.test.OptionalFields} returns this + */ +proto.jspb.test.OptionalFields.prototype.setARepeatedStringList = function(value) { + return jspb.Message.setField(this, 5, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.jspb.test.OptionalFields} returns this + */ +proto.jspb.test.OptionalFields.prototype.addARepeatedString = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 5, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.jspb.test.OptionalFields} returns this + */ +proto.jspb.test.OptionalFields.prototype.clearARepeatedStringList = function() { + return this.setARepeatedStringList([]); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.HasExtensions.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.HasExtensions.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.HasExtensions} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.HasExtensions.toObject = function(includeInstance, msg) { + var f, obj = { +str1: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, +str2: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f, +str3: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f + }; + + jspb.Message.toObjectExtension(/** @type {!jspb.Message} */ (msg), obj, + proto.jspb.test.HasExtensions.extensions, proto.jspb.test.HasExtensions.prototype.getExtension, + includeInstance); + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.HasExtensions} + */ +proto.jspb.test.HasExtensions.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.HasExtensions; + return proto.jspb.test.HasExtensions.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.HasExtensions} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.HasExtensions} + */ +proto.jspb.test.HasExtensions.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setStr1(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setStr2(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setStr3(value); + break; + default: + jspb.Message.readBinaryExtension(msg, reader, + proto.jspb.test.HasExtensions.extensionsBinary, + proto.jspb.test.HasExtensions.prototype.getExtension, + proto.jspb.test.HasExtensions.prototype.setExtension); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.HasExtensions.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.HasExtensions.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.HasExtensions} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.HasExtensions.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeString( + 2, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 3)); + if (f != null) { + writer.writeString( + 3, + f + ); + } + jspb.Message.serializeBinaryExtensions(message, writer, + proto.jspb.test.HasExtensions.extensionsBinary, proto.jspb.test.HasExtensions.prototype.getExtension); +}; + + +/** + * optional string str1 = 1; + * @return {string} + */ +proto.jspb.test.HasExtensions.prototype.getStr1 = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.HasExtensions} returns this + */ +proto.jspb.test.HasExtensions.prototype.setStr1 = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.HasExtensions} returns this + */ +proto.jspb.test.HasExtensions.prototype.clearStr1 = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.HasExtensions.prototype.hasStr1 = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional string str2 = 2; + * @return {string} + */ +proto.jspb.test.HasExtensions.prototype.getStr2 = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.HasExtensions} returns this + */ +proto.jspb.test.HasExtensions.prototype.setStr2 = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.HasExtensions} returns this + */ +proto.jspb.test.HasExtensions.prototype.clearStr2 = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.HasExtensions.prototype.hasStr2 = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional string str3 = 3; + * @return {string} + */ +proto.jspb.test.HasExtensions.prototype.getStr3 = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.HasExtensions} returns this + */ +proto.jspb.test.HasExtensions.prototype.setStr3 = function(value) { + return jspb.Message.setField(this, 3, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.HasExtensions} returns this + */ +proto.jspb.test.HasExtensions.prototype.clearStr3 = function() { + return jspb.Message.setField(this, 3, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.HasExtensions.prototype.hasStr3 = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.jspb.test.Complex.repeatedFields_ = [5,7]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.Complex.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.Complex.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.Complex} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Complex.toObject = function(includeInstance, msg) { + var f, obj = { +aString: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, +anOutOfOrderBool: (f = jspb.Message.getBooleanField(msg, 9)) == null ? undefined : f, +aNestedMessage: (f = msg.getANestedMessage()) && proto.jspb.test.Complex.Nested.toObject(includeInstance, f), +aRepeatedMessageList: jspb.Message.toObjectList(msg.getARepeatedMessageList(), + proto.jspb.test.Complex.Nested.toObject, includeInstance), +aRepeatedStringList: (f = jspb.Message.getRepeatedField(msg, 7)) == null ? undefined : f, +aFloatingPointField: (f = jspb.Message.getOptionalFloatingPointField(msg, 10)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.Complex} + */ +proto.jspb.test.Complex.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.Complex; + return proto.jspb.test.Complex.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.Complex} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.Complex} + */ +proto.jspb.test.Complex.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setAString(value); + break; + case 9: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setAnOutOfOrderBool(value); + break; + case 4: + var value = new proto.jspb.test.Complex.Nested; + reader.readMessage(value,proto.jspb.test.Complex.Nested.deserializeBinaryFromReader); + msg.setANestedMessage(value); + break; + case 5: + var value = new proto.jspb.test.Complex.Nested; + reader.readMessage(value,proto.jspb.test.Complex.Nested.deserializeBinaryFromReader); + msg.addARepeatedMessage(value); + break; + case 7: + var value = /** @type {string} */ (reader.readString()); + msg.addARepeatedString(value); + break; + case 10: + var value = /** @type {number} */ (reader.readDouble()); + msg.setAFloatingPointField(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.Complex.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.Complex.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.Complex} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Complex.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } + f = /** @type {boolean} */ (jspb.Message.getField(message, 9)); + if (f != null) { + writer.writeBool( + 9, + f + ); + } + f = message.getANestedMessage(); + if (f != null) { + writer.writeMessage( + 4, + f, + proto.jspb.test.Complex.Nested.serializeBinaryToWriter + ); + } + f = message.getARepeatedMessageList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 5, + f, + proto.jspb.test.Complex.Nested.serializeBinaryToWriter + ); + } + f = message.getARepeatedStringList(); + if (f.length > 0) { + writer.writeRepeatedString( + 7, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 10)); + if (f != null) { + writer.writeDouble( + 10, + f + ); + } +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.Complex.Nested.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.Complex.Nested.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.Complex.Nested} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Complex.Nested.toObject = function(includeInstance, msg) { + var f, obj = { +anInt: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.Complex.Nested} + */ +proto.jspb.test.Complex.Nested.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.Complex.Nested; + return proto.jspb.test.Complex.Nested.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.Complex.Nested} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.Complex.Nested} + */ +proto.jspb.test.Complex.Nested.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 2: + var value = /** @type {number} */ (reader.readInt32()); + msg.setAnInt(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.Complex.Nested.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.Complex.Nested.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.Complex.Nested} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Complex.Nested.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {number} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeInt32( + 2, + f + ); + } +}; + + +/** + * required int32 an_int = 2; + * @return {number} + */ +proto.jspb.test.Complex.Nested.prototype.getAnInt = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.Complex.Nested} returns this + */ +proto.jspb.test.Complex.Nested.prototype.setAnInt = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.Complex.Nested} returns this + */ +proto.jspb.test.Complex.Nested.prototype.clearAnInt = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.Complex.Nested.prototype.hasAnInt = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * required string a_string = 1; + * @return {string} + */ +proto.jspb.test.Complex.prototype.getAString = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.Complex} returns this + */ +proto.jspb.test.Complex.prototype.setAString = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.Complex} returns this + */ +proto.jspb.test.Complex.prototype.clearAString = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.Complex.prototype.hasAString = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional bool an_out_of_order_bool = 9; + * @return {boolean} + */ +proto.jspb.test.Complex.prototype.getAnOutOfOrderBool = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 9, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.jspb.test.Complex} returns this + */ +proto.jspb.test.Complex.prototype.setAnOutOfOrderBool = function(value) { + return jspb.Message.setField(this, 9, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.Complex} returns this + */ +proto.jspb.test.Complex.prototype.clearAnOutOfOrderBool = function() { + return jspb.Message.setField(this, 9, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.Complex.prototype.hasAnOutOfOrderBool = function() { + return jspb.Message.getField(this, 9) != null; +}; + + +/** + * optional Nested a_nested_message = 4; + * @return {?proto.jspb.test.Complex.Nested} + */ +proto.jspb.test.Complex.prototype.getANestedMessage = function() { + return /** @type{?proto.jspb.test.Complex.Nested} */ ( + jspb.Message.getWrapperField(this, proto.jspb.test.Complex.Nested, 4)); +}; + + +/** + * @param {?proto.jspb.test.Complex.Nested|undefined} value + * @return {!proto.jspb.test.Complex} returns this +*/ +proto.jspb.test.Complex.prototype.setANestedMessage = function(value) { + return jspb.Message.setWrapperField(this, 4, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.jspb.test.Complex} returns this + */ +proto.jspb.test.Complex.prototype.clearANestedMessage = function() { + return this.setANestedMessage(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.Complex.prototype.hasANestedMessage = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * repeated Nested a_repeated_message = 5; + * @return {!Array} + */ +proto.jspb.test.Complex.prototype.getARepeatedMessageList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.jspb.test.Complex.Nested, 5)); +}; + + +/** + * @param {!Array} value + * @return {!proto.jspb.test.Complex} returns this +*/ +proto.jspb.test.Complex.prototype.setARepeatedMessageList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 5, value); +}; + + +/** + * @param {!proto.jspb.test.Complex.Nested=} opt_value + * @param {number=} opt_index + * @return {!proto.jspb.test.Complex.Nested} + */ +proto.jspb.test.Complex.prototype.addARepeatedMessage = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, proto.jspb.test.Complex.Nested, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.jspb.test.Complex} returns this + */ +proto.jspb.test.Complex.prototype.clearARepeatedMessageList = function() { + return this.setARepeatedMessageList([]); +}; + + +/** + * repeated string a_repeated_string = 7; + * @return {!Array} + */ +proto.jspb.test.Complex.prototype.getARepeatedStringList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 7)); +}; + + +/** + * @param {!Array} value + * @return {!proto.jspb.test.Complex} returns this + */ +proto.jspb.test.Complex.prototype.setARepeatedStringList = function(value) { + return jspb.Message.setField(this, 7, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.jspb.test.Complex} returns this + */ +proto.jspb.test.Complex.prototype.addARepeatedString = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 7, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.jspb.test.Complex} returns this + */ +proto.jspb.test.Complex.prototype.clearARepeatedStringList = function() { + return this.setARepeatedStringList([]); +}; + + +/** + * optional double a_floating_point_field = 10; + * @return {number} + */ +proto.jspb.test.Complex.prototype.getAFloatingPointField = function() { + return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 10, 0.0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.Complex} returns this + */ +proto.jspb.test.Complex.prototype.setAFloatingPointField = function(value) { + return jspb.Message.setField(this, 10, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.Complex} returns this + */ +proto.jspb.test.Complex.prototype.clearAFloatingPointField = function() { + return jspb.Message.setField(this, 10, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.Complex.prototype.hasAFloatingPointField = function() { + return jspb.Message.getField(this, 10) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.OuterMessage.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.OuterMessage.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.OuterMessage} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.OuterMessage.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.OuterMessage} + */ +proto.jspb.test.OuterMessage.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.OuterMessage; + return proto.jspb.test.OuterMessage.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.OuterMessage} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.OuterMessage} + */ +proto.jspb.test.OuterMessage.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.OuterMessage.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.OuterMessage.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.OuterMessage} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.OuterMessage.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.OuterMessage.Complex.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.OuterMessage.Complex.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.OuterMessage.Complex} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.OuterMessage.Complex.toObject = function(includeInstance, msg) { + var f, obj = { +innerComplexField: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.OuterMessage.Complex} + */ +proto.jspb.test.OuterMessage.Complex.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.OuterMessage.Complex; + return proto.jspb.test.OuterMessage.Complex.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.OuterMessage.Complex} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.OuterMessage.Complex} + */ +proto.jspb.test.OuterMessage.Complex.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt32()); + msg.setInnerComplexField(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.OuterMessage.Complex.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.OuterMessage.Complex.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.OuterMessage.Complex} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.OuterMessage.Complex.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {number} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeInt32( + 1, + f + ); + } +}; + + +/** + * optional int32 inner_complex_field = 1; + * @return {number} + */ +proto.jspb.test.OuterMessage.Complex.prototype.getInnerComplexField = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.OuterMessage.Complex} returns this + */ +proto.jspb.test.OuterMessage.Complex.prototype.setInnerComplexField = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.OuterMessage.Complex} returns this + */ +proto.jspb.test.OuterMessage.Complex.prototype.clearInnerComplexField = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.OuterMessage.Complex.prototype.hasInnerComplexField = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.MineField.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.MineField.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.MineField} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.MineField.toObject = function(includeInstance, msg) { + var f, obj = { +cookie: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.MineField} + */ +proto.jspb.test.MineField.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.MineField; + return proto.jspb.test.MineField.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.MineField} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.MineField} + */ +proto.jspb.test.MineField.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setCookie(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.MineField.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.MineField.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.MineField} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.MineField.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string cookie = 1; + * @return {string} + */ +proto.jspb.test.MineField.prototype.getCookie = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.MineField} returns this + */ +proto.jspb.test.MineField.prototype.setCookie = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.MineField} returns this + */ +proto.jspb.test.MineField.prototype.clearCookie = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.MineField.prototype.hasCookie = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.IsExtension.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.IsExtension.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.IsExtension} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.IsExtension.toObject = function(includeInstance, msg) { + var f, obj = { +ext1: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.IsExtension} + */ +proto.jspb.test.IsExtension.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.IsExtension; + return proto.jspb.test.IsExtension.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.IsExtension} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.IsExtension} + */ +proto.jspb.test.IsExtension.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setExt1(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.IsExtension.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.IsExtension.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.IsExtension} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.IsExtension.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } +}; + + + +/** + * A tuple of {field number, class constructor} for the extension + * field named `extField`. + * @type {!jspb.ExtensionFieldInfo} + */ +proto.jspb.test.IsExtension.extField = new jspb.ExtensionFieldInfo( + 100, + {extField: 0}, + proto.jspb.test.IsExtension, + /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( + proto.jspb.test.IsExtension.toObject), + 0); + +proto.jspb.test.HasExtensions.extensionsBinary[100] = new jspb.ExtensionFieldBinaryInfo( + proto.jspb.test.IsExtension.extField, + jspb.BinaryReader.prototype.readMessage, + jspb.BinaryWriter.prototype.writeMessage, + proto.jspb.test.IsExtension.serializeBinaryToWriter, + proto.jspb.test.IsExtension.deserializeBinaryFromReader, + false); +// This registers the extension field with the extended class, so that +// toObject() will function correctly. +proto.jspb.test.HasExtensions.extensions[100] = proto.jspb.test.IsExtension.extField; + +/** + * optional string ext1 = 1; + * @return {string} + */ +proto.jspb.test.IsExtension.prototype.getExt1 = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.IsExtension} returns this + */ +proto.jspb.test.IsExtension.prototype.setExt1 = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.IsExtension} returns this + */ +proto.jspb.test.IsExtension.prototype.clearExt1 = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.IsExtension.prototype.hasExt1 = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.IndirectExtension.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.IndirectExtension.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.IndirectExtension} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.IndirectExtension.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.IndirectExtension} + */ +proto.jspb.test.IndirectExtension.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.IndirectExtension; + return proto.jspb.test.IndirectExtension.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.IndirectExtension} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.IndirectExtension} + */ +proto.jspb.test.IndirectExtension.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.IndirectExtension.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.IndirectExtension.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.IndirectExtension} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.IndirectExtension.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + +/** + * A tuple of {field number, class constructor} for the extension + * field named `simple`. + * @type {!jspb.ExtensionFieldInfo} + */ +proto.jspb.test.IndirectExtension.simple = new jspb.ExtensionFieldInfo( + 101, + {simple: 0}, + proto.jspb.test.Simple1, + /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( + proto.jspb.test.Simple1.toObject), + 0); + +proto.jspb.test.HasExtensions.extensionsBinary[101] = new jspb.ExtensionFieldBinaryInfo( + proto.jspb.test.IndirectExtension.simple, + jspb.BinaryReader.prototype.readMessage, + jspb.BinaryWriter.prototype.writeMessage, + proto.jspb.test.Simple1.serializeBinaryToWriter, + proto.jspb.test.Simple1.deserializeBinaryFromReader, + false); +// This registers the extension field with the extended class, so that +// toObject() will function correctly. +proto.jspb.test.HasExtensions.extensions[101] = proto.jspb.test.IndirectExtension.simple; + + +/** + * A tuple of {field number, class constructor} for the extension + * field named `str`. + * @type {!jspb.ExtensionFieldInfo} + */ +proto.jspb.test.IndirectExtension.str = new jspb.ExtensionFieldInfo( + 102, + {str: 0}, + null, + /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( + null), + 0); + +proto.jspb.test.HasExtensions.extensionsBinary[102] = new jspb.ExtensionFieldBinaryInfo( + proto.jspb.test.IndirectExtension.str, + jspb.BinaryReader.prototype.readString, + jspb.BinaryWriter.prototype.writeString, + undefined, + undefined, + false); +// This registers the extension field with the extended class, so that +// toObject() will function correctly. +proto.jspb.test.HasExtensions.extensions[102] = proto.jspb.test.IndirectExtension.str; + + +/** + * A tuple of {field number, class constructor} for the extension + * field named `repeatedStrList`. + * @type {!jspb.ExtensionFieldInfo>} + */ +proto.jspb.test.IndirectExtension.repeatedStrList = new jspb.ExtensionFieldInfo( + 103, + {repeatedStrList: 0}, + null, + /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( + null), + 1); + +proto.jspb.test.HasExtensions.extensionsBinary[103] = new jspb.ExtensionFieldBinaryInfo( + proto.jspb.test.IndirectExtension.repeatedStrList, + jspb.BinaryReader.prototype.readString, + jspb.BinaryWriter.prototype.writeRepeatedString, + undefined, + undefined, + false); +// This registers the extension field with the extended class, so that +// toObject() will function correctly. +proto.jspb.test.HasExtensions.extensions[103] = proto.jspb.test.IndirectExtension.repeatedStrList; + + +/** + * A tuple of {field number, class constructor} for the extension + * field named `repeatedSimpleList`. + * @type {!jspb.ExtensionFieldInfo>} + */ +proto.jspb.test.IndirectExtension.repeatedSimpleList = new jspb.ExtensionFieldInfo( + 104, + {repeatedSimpleList: 0}, + proto.jspb.test.Simple1, + /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( + proto.jspb.test.Simple1.toObject), + 1); + +proto.jspb.test.HasExtensions.extensionsBinary[104] = new jspb.ExtensionFieldBinaryInfo( + proto.jspb.test.IndirectExtension.repeatedSimpleList, + jspb.BinaryReader.prototype.readMessage, + jspb.BinaryWriter.prototype.writeRepeatedMessage, + proto.jspb.test.Simple1.serializeBinaryToWriter, + proto.jspb.test.Simple1.deserializeBinaryFromReader, + false); +// This registers the extension field with the extended class, so that +// toObject() will function correctly. +proto.jspb.test.HasExtensions.extensions[104] = proto.jspb.test.IndirectExtension.repeatedSimpleList; + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.DefaultValues.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.DefaultValues.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.DefaultValues} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.DefaultValues.toObject = function(includeInstance, msg) { + var f, obj = { +stringField: jspb.Message.getFieldWithDefault(msg, 1, "default\x3c\x3e\x27\x22abc"), +boolField: jspb.Message.getBooleanFieldWithDefault(msg, 2, true), +intField: jspb.Message.getFieldWithDefault(msg, 3, 11), +enumField: jspb.Message.getFieldWithDefault(msg, 4, 13), +emptyField: jspb.Message.getFieldWithDefault(msg, 6, ""), +bytesField: msg.getBytesField_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.DefaultValues} + */ +proto.jspb.test.DefaultValues.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.DefaultValues; + return proto.jspb.test.DefaultValues.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.DefaultValues} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.DefaultValues} + */ +proto.jspb.test.DefaultValues.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setStringField(value); + break; + case 2: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setBoolField(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt64()); + msg.setIntField(value); + break; + case 4: + var value = /** @type {!proto.jspb.test.DefaultValues.Enum} */ (reader.readEnum()); + msg.setEnumField(value); + break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.setEmptyField(value); + break; + case 8: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setBytesField(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.DefaultValues.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.DefaultValues.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.DefaultValues} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.DefaultValues.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } + f = /** @type {boolean} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeBool( + 2, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 3)); + if (f != null) { + writer.writeInt64( + 3, + f + ); + } + f = /** @type {!proto.jspb.test.DefaultValues.Enum} */ (jspb.Message.getField(message, 4)); + if (f != null) { + writer.writeEnum( + 4, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 6)); + if (f != null) { + writer.writeString( + 6, + f + ); + } + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 8)); + if (f != null) { + writer.writeBytes( + 8, + f + ); + } +}; + + +/** + * @enum {number} + */ +proto.jspb.test.DefaultValues.Enum = { + E1: 13, + E2: 77 +}; + +/** + * optional string string_field = 1; + * @return {string} + */ +proto.jspb.test.DefaultValues.prototype.getStringField = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "default\x3c\x3e\x27\x22abc")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.DefaultValues} returns this + */ +proto.jspb.test.DefaultValues.prototype.setStringField = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.DefaultValues} returns this + */ +proto.jspb.test.DefaultValues.prototype.clearStringField = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.DefaultValues.prototype.hasStringField = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional bool bool_field = 2; + * @return {boolean} + */ +proto.jspb.test.DefaultValues.prototype.getBoolField = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, true)); +}; + + +/** + * @param {boolean} value + * @return {!proto.jspb.test.DefaultValues} returns this + */ +proto.jspb.test.DefaultValues.prototype.setBoolField = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.DefaultValues} returns this + */ +proto.jspb.test.DefaultValues.prototype.clearBoolField = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.DefaultValues.prototype.hasBoolField = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional int64 int_field = 3; + * @return {number} + */ +proto.jspb.test.DefaultValues.prototype.getIntField = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 11)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.DefaultValues} returns this + */ +proto.jspb.test.DefaultValues.prototype.setIntField = function(value) { + return jspb.Message.setField(this, 3, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.DefaultValues} returns this + */ +proto.jspb.test.DefaultValues.prototype.clearIntField = function() { + return jspb.Message.setField(this, 3, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.DefaultValues.prototype.hasIntField = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional Enum enum_field = 4; + * @return {!proto.jspb.test.DefaultValues.Enum} + */ +proto.jspb.test.DefaultValues.prototype.getEnumField = function() { + return /** @type {!proto.jspb.test.DefaultValues.Enum} */ (jspb.Message.getFieldWithDefault(this, 4, 13)); +}; + + +/** + * @param {!proto.jspb.test.DefaultValues.Enum} value + * @return {!proto.jspb.test.DefaultValues} returns this + */ +proto.jspb.test.DefaultValues.prototype.setEnumField = function(value) { + return jspb.Message.setField(this, 4, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.DefaultValues} returns this + */ +proto.jspb.test.DefaultValues.prototype.clearEnumField = function() { + return jspb.Message.setField(this, 4, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.DefaultValues.prototype.hasEnumField = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * optional string empty_field = 6; + * @return {string} + */ +proto.jspb.test.DefaultValues.prototype.getEmptyField = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.DefaultValues} returns this + */ +proto.jspb.test.DefaultValues.prototype.setEmptyField = function(value) { + return jspb.Message.setField(this, 6, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.DefaultValues} returns this + */ +proto.jspb.test.DefaultValues.prototype.clearEmptyField = function() { + return jspb.Message.setField(this, 6, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.DefaultValues.prototype.hasEmptyField = function() { + return jspb.Message.getField(this, 6) != null; +}; + + +/** + * optional bytes bytes_field = 8; + * @return {!(string|Uint8Array)} + */ +proto.jspb.test.DefaultValues.prototype.getBytesField = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 8, "bW9v")); +}; + + +/** + * optional bytes bytes_field = 8; + * This is a type-conversion wrapper around `getBytesField()` + * @return {string} + */ +proto.jspb.test.DefaultValues.prototype.getBytesField_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getBytesField())); +}; + + +/** + * optional bytes bytes_field = 8; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getBytesField()` + * @return {!Uint8Array} + */ +proto.jspb.test.DefaultValues.prototype.getBytesField_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getBytesField())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.jspb.test.DefaultValues} returns this + */ +proto.jspb.test.DefaultValues.prototype.setBytesField = function(value) { + return jspb.Message.setField(this, 8, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.DefaultValues} returns this + */ +proto.jspb.test.DefaultValues.prototype.clearBytesField = function() { + return jspb.Message.setField(this, 8, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.DefaultValues.prototype.hasBytesField = function() { + return jspb.Message.getField(this, 8) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.jspb.test.FloatingPointFields.repeatedFields_ = [3,7]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.FloatingPointFields.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.FloatingPointFields.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.FloatingPointFields} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.FloatingPointFields.toObject = function(includeInstance, msg) { + var f, obj = { +optionalFloatField: (f = jspb.Message.getOptionalFloatingPointField(msg, 1)) == null ? undefined : f, +requiredFloatField: (f = jspb.Message.getOptionalFloatingPointField(msg, 2)) == null ? undefined : f, +repeatedFloatFieldList: (f = jspb.Message.getRepeatedFloatingPointField(msg, 3)) == null ? undefined : f, +defaultFloatField: jspb.Message.getFloatingPointFieldWithDefault(msg, 4, 2.0), +optionalDoubleField: (f = jspb.Message.getOptionalFloatingPointField(msg, 5)) == null ? undefined : f, +requiredDoubleField: (f = jspb.Message.getOptionalFloatingPointField(msg, 6)) == null ? undefined : f, +repeatedDoubleFieldList: (f = jspb.Message.getRepeatedFloatingPointField(msg, 7)) == null ? undefined : f, +defaultDoubleField: jspb.Message.getFloatingPointFieldWithDefault(msg, 8, 2.0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.FloatingPointFields} + */ +proto.jspb.test.FloatingPointFields.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.FloatingPointFields; + return proto.jspb.test.FloatingPointFields.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.FloatingPointFields} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.FloatingPointFields} + */ +proto.jspb.test.FloatingPointFields.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readFloat()); + msg.setOptionalFloatField(value); + break; + case 2: + var value = /** @type {number} */ (reader.readFloat()); + msg.setRequiredFloatField(value); + break; + case 3: + var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readFloat() : [reader.readFloat()]); + for (var i = 0; i < values.length; i++) { + msg.addRepeatedFloatField(values[i]); + } + break; + case 4: + var value = /** @type {number} */ (reader.readFloat()); + msg.setDefaultFloatField(value); + break; + case 5: + var value = /** @type {number} */ (reader.readDouble()); + msg.setOptionalDoubleField(value); + break; + case 6: + var value = /** @type {number} */ (reader.readDouble()); + msg.setRequiredDoubleField(value); + break; + case 7: + var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readDouble() : [reader.readDouble()]); + for (var i = 0; i < values.length; i++) { + msg.addRepeatedDoubleField(values[i]); + } + break; + case 8: + var value = /** @type {number} */ (reader.readDouble()); + msg.setDefaultDoubleField(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.FloatingPointFields.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.FloatingPointFields.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.FloatingPointFields} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.FloatingPointFields.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {number} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeFloat( + 1, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeFloat( + 2, + f + ); + } + f = message.getRepeatedFloatFieldList(); + if (f.length > 0) { + writer.writeRepeatedFloat( + 3, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 4)); + if (f != null) { + writer.writeFloat( + 4, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 5)); + if (f != null) { + writer.writeDouble( + 5, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 6)); + if (f != null) { + writer.writeDouble( + 6, + f + ); + } + f = message.getRepeatedDoubleFieldList(); + if (f.length > 0) { + writer.writeRepeatedDouble( + 7, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 8)); + if (f != null) { + writer.writeDouble( + 8, + f + ); + } +}; + + +/** + * optional float optional_float_field = 1; + * @return {number} + */ +proto.jspb.test.FloatingPointFields.prototype.getOptionalFloatField = function() { + return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 1, 0.0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.setOptionalFloatField = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.clearOptionalFloatField = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.FloatingPointFields.prototype.hasOptionalFloatField = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * required float required_float_field = 2; + * @return {number} + */ +proto.jspb.test.FloatingPointFields.prototype.getRequiredFloatField = function() { + return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 2, 0.0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.setRequiredFloatField = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.clearRequiredFloatField = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.FloatingPointFields.prototype.hasRequiredFloatField = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * repeated float repeated_float_field = 3; + * @return {!Array} + */ +proto.jspb.test.FloatingPointFields.prototype.getRepeatedFloatFieldList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedFloatingPointField(this, 3)); +}; + + +/** + * @param {!Array} value + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.setRepeatedFloatFieldList = function(value) { + return jspb.Message.setField(this, 3, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.addRepeatedFloatField = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 3, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.clearRepeatedFloatFieldList = function() { + return this.setRepeatedFloatFieldList([]); +}; + + +/** + * optional float default_float_field = 4; + * @return {number} + */ +proto.jspb.test.FloatingPointFields.prototype.getDefaultFloatField = function() { + return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 4, 2.0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.setDefaultFloatField = function(value) { + return jspb.Message.setField(this, 4, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.clearDefaultFloatField = function() { + return jspb.Message.setField(this, 4, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.FloatingPointFields.prototype.hasDefaultFloatField = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * optional double optional_double_field = 5; + * @return {number} + */ +proto.jspb.test.FloatingPointFields.prototype.getOptionalDoubleField = function() { + return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 5, 0.0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.setOptionalDoubleField = function(value) { + return jspb.Message.setField(this, 5, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.clearOptionalDoubleField = function() { + return jspb.Message.setField(this, 5, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.FloatingPointFields.prototype.hasOptionalDoubleField = function() { + return jspb.Message.getField(this, 5) != null; +}; + + +/** + * required double required_double_field = 6; + * @return {number} + */ +proto.jspb.test.FloatingPointFields.prototype.getRequiredDoubleField = function() { + return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 6, 0.0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.setRequiredDoubleField = function(value) { + return jspb.Message.setField(this, 6, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.clearRequiredDoubleField = function() { + return jspb.Message.setField(this, 6, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.FloatingPointFields.prototype.hasRequiredDoubleField = function() { + return jspb.Message.getField(this, 6) != null; +}; + + +/** + * repeated double repeated_double_field = 7; + * @return {!Array} + */ +proto.jspb.test.FloatingPointFields.prototype.getRepeatedDoubleFieldList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedFloatingPointField(this, 7)); +}; + + +/** + * @param {!Array} value + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.setRepeatedDoubleFieldList = function(value) { + return jspb.Message.setField(this, 7, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.addRepeatedDoubleField = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 7, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.clearRepeatedDoubleFieldList = function() { + return this.setRepeatedDoubleFieldList([]); +}; + + +/** + * optional double default_double_field = 8; + * @return {number} + */ +proto.jspb.test.FloatingPointFields.prototype.getDefaultDoubleField = function() { + return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 8, 2.0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.setDefaultDoubleField = function(value) { + return jspb.Message.setField(this, 8, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.FloatingPointFields} returns this + */ +proto.jspb.test.FloatingPointFields.prototype.clearDefaultDoubleField = function() { + return jspb.Message.setField(this, 8, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.FloatingPointFields.prototype.hasDefaultDoubleField = function() { + return jspb.Message.getField(this, 8) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.jspb.test.BooleanFields.repeatedFields_ = [3]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.BooleanFields.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.BooleanFields.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.BooleanFields} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.BooleanFields.toObject = function(includeInstance, msg) { + var f, obj = { +optionalBooleanField: (f = jspb.Message.getBooleanField(msg, 1)) == null ? undefined : f, +requiredBooleanField: (f = jspb.Message.getBooleanField(msg, 2)) == null ? undefined : f, +repeatedBooleanFieldList: (f = jspb.Message.getRepeatedBooleanField(msg, 3)) == null ? undefined : f, +defaultBooleanField: jspb.Message.getBooleanFieldWithDefault(msg, 4, true) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.BooleanFields} + */ +proto.jspb.test.BooleanFields.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.BooleanFields; + return proto.jspb.test.BooleanFields.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.BooleanFields} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.BooleanFields} + */ +proto.jspb.test.BooleanFields.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setOptionalBooleanField(value); + break; + case 2: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setRequiredBooleanField(value); + break; + case 3: + var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readBool() : [reader.readBool()]); + for (var i = 0; i < values.length; i++) { + msg.addRepeatedBooleanField(values[i]); + } + break; + case 4: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setDefaultBooleanField(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.BooleanFields.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.BooleanFields.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.BooleanFields} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.BooleanFields.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {boolean} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeBool( + 1, + f + ); + } + f = /** @type {boolean} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeBool( + 2, + f + ); + } + f = message.getRepeatedBooleanFieldList(); + if (f.length > 0) { + writer.writeRepeatedBool( + 3, + f + ); + } + f = /** @type {boolean} */ (jspb.Message.getField(message, 4)); + if (f != null) { + writer.writeBool( + 4, + f + ); + } +}; + + +/** + * optional bool optional_boolean_field = 1; + * @return {boolean} + */ +proto.jspb.test.BooleanFields.prototype.getOptionalBooleanField = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.jspb.test.BooleanFields} returns this + */ +proto.jspb.test.BooleanFields.prototype.setOptionalBooleanField = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.BooleanFields} returns this + */ +proto.jspb.test.BooleanFields.prototype.clearOptionalBooleanField = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.BooleanFields.prototype.hasOptionalBooleanField = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * required bool required_boolean_field = 2; + * @return {boolean} + */ +proto.jspb.test.BooleanFields.prototype.getRequiredBooleanField = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.jspb.test.BooleanFields} returns this + */ +proto.jspb.test.BooleanFields.prototype.setRequiredBooleanField = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.BooleanFields} returns this + */ +proto.jspb.test.BooleanFields.prototype.clearRequiredBooleanField = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.BooleanFields.prototype.hasRequiredBooleanField = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * repeated bool repeated_boolean_field = 3; + * @return {!Array} + */ +proto.jspb.test.BooleanFields.prototype.getRepeatedBooleanFieldList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedBooleanField(this, 3)); +}; + + +/** + * @param {!Array} value + * @return {!proto.jspb.test.BooleanFields} returns this + */ +proto.jspb.test.BooleanFields.prototype.setRepeatedBooleanFieldList = function(value) { + return jspb.Message.setField(this, 3, value || []); +}; + + +/** + * @param {boolean} value + * @param {number=} opt_index + * @return {!proto.jspb.test.BooleanFields} returns this + */ +proto.jspb.test.BooleanFields.prototype.addRepeatedBooleanField = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 3, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.jspb.test.BooleanFields} returns this + */ +proto.jspb.test.BooleanFields.prototype.clearRepeatedBooleanFieldList = function() { + return this.setRepeatedBooleanFieldList([]); +}; + + +/** + * optional bool default_boolean_field = 4; + * @return {boolean} + */ +proto.jspb.test.BooleanFields.prototype.getDefaultBooleanField = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, true)); +}; + + +/** + * @param {boolean} value + * @return {!proto.jspb.test.BooleanFields} returns this + */ +proto.jspb.test.BooleanFields.prototype.setDefaultBooleanField = function(value) { + return jspb.Message.setField(this, 4, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.BooleanFields} returns this + */ +proto.jspb.test.BooleanFields.prototype.clearDefaultBooleanField = function() { + return jspb.Message.setField(this, 4, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.BooleanFields.prototype.hasDefaultBooleanField = function() { + return jspb.Message.getField(this, 4) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.jspb.test.TestClone.repeatedFields_ = [5]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.TestClone.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.TestClone.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.TestClone} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestClone.toObject = function(includeInstance, msg) { + var f, obj = { +str: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, +simple1: (f = msg.getSimple1()) && proto.jspb.test.Simple1.toObject(includeInstance, f), +simple2List: jspb.Message.toObjectList(msg.getSimple2List(), + proto.jspb.test.Simple1.toObject, includeInstance), +bytesField: msg.getBytesField_asB64(), +unused: (f = jspb.Message.getField(msg, 7)) == null ? undefined : f + }; + + jspb.Message.toObjectExtension(/** @type {!jspb.Message} */ (msg), obj, + proto.jspb.test.TestClone.extensions, proto.jspb.test.TestClone.prototype.getExtension, + includeInstance); + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.TestClone} + */ +proto.jspb.test.TestClone.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.TestClone; + return proto.jspb.test.TestClone.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.TestClone} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.TestClone} + */ +proto.jspb.test.TestClone.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setStr(value); + break; + case 3: + var value = new proto.jspb.test.Simple1; + reader.readMessage(value,proto.jspb.test.Simple1.deserializeBinaryFromReader); + msg.setSimple1(value); + break; + case 5: + var value = new proto.jspb.test.Simple1; + reader.readMessage(value,proto.jspb.test.Simple1.deserializeBinaryFromReader); + msg.addSimple2(value); + break; + case 6: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setBytesField(value); + break; + case 7: + var value = /** @type {string} */ (reader.readString()); + msg.setUnused(value); + break; + default: + jspb.Message.readBinaryExtension(msg, reader, + proto.jspb.test.TestClone.extensionsBinary, + proto.jspb.test.TestClone.prototype.getExtension, + proto.jspb.test.TestClone.prototype.setExtension); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.TestClone.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.TestClone.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.TestClone} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestClone.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } + f = message.getSimple1(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.jspb.test.Simple1.serializeBinaryToWriter + ); + } + f = message.getSimple2List(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 5, + f, + proto.jspb.test.Simple1.serializeBinaryToWriter + ); + } + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 6)); + if (f != null) { + writer.writeBytes( + 6, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 7)); + if (f != null) { + writer.writeString( + 7, + f + ); + } + jspb.Message.serializeBinaryExtensions(message, writer, + proto.jspb.test.TestClone.extensionsBinary, proto.jspb.test.TestClone.prototype.getExtension); +}; + + +/** + * optional string str = 1; + * @return {string} + */ +proto.jspb.test.TestClone.prototype.getStr = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.TestClone} returns this + */ +proto.jspb.test.TestClone.prototype.setStr = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestClone} returns this + */ +proto.jspb.test.TestClone.prototype.clearStr = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestClone.prototype.hasStr = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional Simple1 simple1 = 3; + * @return {?proto.jspb.test.Simple1} + */ +proto.jspb.test.TestClone.prototype.getSimple1 = function() { + return /** @type{?proto.jspb.test.Simple1} */ ( + jspb.Message.getWrapperField(this, proto.jspb.test.Simple1, 3)); +}; + + +/** + * @param {?proto.jspb.test.Simple1|undefined} value + * @return {!proto.jspb.test.TestClone} returns this +*/ +proto.jspb.test.TestClone.prototype.setSimple1 = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.jspb.test.TestClone} returns this + */ +proto.jspb.test.TestClone.prototype.clearSimple1 = function() { + return this.setSimple1(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestClone.prototype.hasSimple1 = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * repeated Simple1 simple2 = 5; + * @return {!Array} + */ +proto.jspb.test.TestClone.prototype.getSimple2List = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.jspb.test.Simple1, 5)); +}; + + +/** + * @param {!Array} value + * @return {!proto.jspb.test.TestClone} returns this +*/ +proto.jspb.test.TestClone.prototype.setSimple2List = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 5, value); +}; + + +/** + * @param {!proto.jspb.test.Simple1=} opt_value + * @param {number=} opt_index + * @return {!proto.jspb.test.Simple1} + */ +proto.jspb.test.TestClone.prototype.addSimple2 = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, proto.jspb.test.Simple1, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.jspb.test.TestClone} returns this + */ +proto.jspb.test.TestClone.prototype.clearSimple2List = function() { + return this.setSimple2List([]); +}; + + +/** + * optional bytes bytes_field = 6; + * @return {!(string|Uint8Array)} + */ +proto.jspb.test.TestClone.prototype.getBytesField = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** + * optional bytes bytes_field = 6; + * This is a type-conversion wrapper around `getBytesField()` + * @return {string} + */ +proto.jspb.test.TestClone.prototype.getBytesField_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getBytesField())); +}; + + +/** + * optional bytes bytes_field = 6; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getBytesField()` + * @return {!Uint8Array} + */ +proto.jspb.test.TestClone.prototype.getBytesField_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getBytesField())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.jspb.test.TestClone} returns this + */ +proto.jspb.test.TestClone.prototype.setBytesField = function(value) { + return jspb.Message.setField(this, 6, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestClone} returns this + */ +proto.jspb.test.TestClone.prototype.clearBytesField = function() { + return jspb.Message.setField(this, 6, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestClone.prototype.hasBytesField = function() { + return jspb.Message.getField(this, 6) != null; +}; + + +/** + * optional string unused = 7; + * @return {string} + */ +proto.jspb.test.TestClone.prototype.getUnused = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.TestClone} returns this + */ +proto.jspb.test.TestClone.prototype.setUnused = function(value) { + return jspb.Message.setField(this, 7, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestClone} returns this + */ +proto.jspb.test.TestClone.prototype.clearUnused = function() { + return jspb.Message.setField(this, 7, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestClone.prototype.hasUnused = function() { + return jspb.Message.getField(this, 7) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.TestCloneExtension.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.TestCloneExtension.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.TestCloneExtension} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestCloneExtension.toObject = function(includeInstance, msg) { + var f, obj = { +f: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.TestCloneExtension} + */ +proto.jspb.test.TestCloneExtension.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.TestCloneExtension; + return proto.jspb.test.TestCloneExtension.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.TestCloneExtension} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.TestCloneExtension} + */ +proto.jspb.test.TestCloneExtension.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt32()); + msg.setF(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.TestCloneExtension.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.TestCloneExtension.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.TestCloneExtension} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestCloneExtension.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {number} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeInt32( + 1, + f + ); + } +}; + + + +/** + * A tuple of {field number, class constructor} for the extension + * field named `lowExt`. + * @type {!jspb.ExtensionFieldInfo} + */ +proto.jspb.test.TestCloneExtension.lowExt = new jspb.ExtensionFieldInfo( + 11, + {lowExt: 0}, + proto.jspb.test.TestCloneExtension, + /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( + proto.jspb.test.TestCloneExtension.toObject), + 0); + +proto.jspb.test.TestClone.extensionsBinary[11] = new jspb.ExtensionFieldBinaryInfo( + proto.jspb.test.TestCloneExtension.lowExt, + jspb.BinaryReader.prototype.readMessage, + jspb.BinaryWriter.prototype.writeMessage, + proto.jspb.test.TestCloneExtension.serializeBinaryToWriter, + proto.jspb.test.TestCloneExtension.deserializeBinaryFromReader, + false); +// This registers the extension field with the extended class, so that +// toObject() will function correctly. +proto.jspb.test.TestClone.extensions[11] = proto.jspb.test.TestCloneExtension.lowExt; + +/** + * optional int32 f = 1; + * @return {number} + */ +proto.jspb.test.TestCloneExtension.prototype.getF = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.TestCloneExtension} returns this + */ +proto.jspb.test.TestCloneExtension.prototype.setF = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestCloneExtension} returns this + */ +proto.jspb.test.TestCloneExtension.prototype.clearF = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestCloneExtension.prototype.hasF = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.CloneExtension.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.CloneExtension.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.CloneExtension} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.CloneExtension.toObject = function(includeInstance, msg) { + var f, obj = { +ext: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.CloneExtension} + */ +proto.jspb.test.CloneExtension.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.CloneExtension; + return proto.jspb.test.CloneExtension.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.CloneExtension} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.CloneExtension} + */ +proto.jspb.test.CloneExtension.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setExt(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.CloneExtension.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.CloneExtension.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.CloneExtension} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.CloneExtension.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeString( + 2, + f + ); + } +}; + + + +/** + * A tuple of {field number, class constructor} for the extension + * field named `extField`. + * @type {!jspb.ExtensionFieldInfo} + */ +proto.jspb.test.CloneExtension.extField = new jspb.ExtensionFieldInfo( + 100, + {extField: 0}, + proto.jspb.test.CloneExtension, + /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( + proto.jspb.test.CloneExtension.toObject), + 0); + +proto.jspb.test.TestClone.extensionsBinary[100] = new jspb.ExtensionFieldBinaryInfo( + proto.jspb.test.CloneExtension.extField, + jspb.BinaryReader.prototype.readMessage, + jspb.BinaryWriter.prototype.writeMessage, + proto.jspb.test.CloneExtension.serializeBinaryToWriter, + proto.jspb.test.CloneExtension.deserializeBinaryFromReader, + false); +// This registers the extension field with the extended class, so that +// toObject() will function correctly. +proto.jspb.test.TestClone.extensions[100] = proto.jspb.test.CloneExtension.extField; + +/** + * optional string ext = 2; + * @return {string} + */ +proto.jspb.test.CloneExtension.prototype.getExt = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.CloneExtension} returns this + */ +proto.jspb.test.CloneExtension.prototype.setExt = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.CloneExtension} returns this + */ +proto.jspb.test.CloneExtension.prototype.clearExt = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.CloneExtension.prototype.hasExt = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.jspb.test.TestGroup.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.TestGroup.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.TestGroup.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.TestGroup} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestGroup.toObject = function(includeInstance, msg) { + var f, obj = { +repeatedGroupList: jspb.Message.toObjectList(msg.getRepeatedGroupList(), + proto.jspb.test.TestGroup.RepeatedGroup.toObject, includeInstance), +requiredGroup: (f = msg.getRequiredGroup()) && proto.jspb.test.TestGroup.RequiredGroup.toObject(includeInstance, f), +optionalGroup: (f = msg.getOptionalGroup()) && proto.jspb.test.TestGroup.OptionalGroup.toObject(includeInstance, f), +id: (f = jspb.Message.getField(msg, 4)) == null ? undefined : f, +requiredSimple: (f = msg.getRequiredSimple()) && proto.jspb.test.Simple2.toObject(includeInstance, f), +optionalSimple: (f = msg.getOptionalSimple()) && proto.jspb.test.Simple2.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.TestGroup} + */ +proto.jspb.test.TestGroup.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.TestGroup; + return proto.jspb.test.TestGroup.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.TestGroup} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.TestGroup} + */ +proto.jspb.test.TestGroup.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.jspb.test.TestGroup.RepeatedGroup; + reader.readGroup(1, value,proto.jspb.test.TestGroup.RepeatedGroup.deserializeBinaryFromReader); + msg.addRepeatedGroup(value); + break; + case 2: + var value = new proto.jspb.test.TestGroup.RequiredGroup; + reader.readGroup(2, value,proto.jspb.test.TestGroup.RequiredGroup.deserializeBinaryFromReader); + msg.setRequiredGroup(value); + break; + case 3: + var value = new proto.jspb.test.TestGroup.OptionalGroup; + reader.readGroup(3, value,proto.jspb.test.TestGroup.OptionalGroup.deserializeBinaryFromReader); + msg.setOptionalGroup(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setId(value); + break; + case 5: + var value = new proto.jspb.test.Simple2; + reader.readMessage(value,proto.jspb.test.Simple2.deserializeBinaryFromReader); + msg.setRequiredSimple(value); + break; + case 6: + var value = new proto.jspb.test.Simple2; + reader.readMessage(value,proto.jspb.test.Simple2.deserializeBinaryFromReader); + msg.setOptionalSimple(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.TestGroup.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.TestGroup.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.TestGroup} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestGroup.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getRepeatedGroupList(); + if (f.length > 0) { + writer.writeRepeatedGroup( + 1, + f, + proto.jspb.test.TestGroup.RepeatedGroup.serializeBinaryToWriter + ); + } + f = message.getRequiredGroup(); + if (f != null) { + writer.writeGroup( + 2, + f, + proto.jspb.test.TestGroup.RequiredGroup.serializeBinaryToWriter + ); + } + f = message.getOptionalGroup(); + if (f != null) { + writer.writeGroup( + 3, + f, + proto.jspb.test.TestGroup.OptionalGroup.serializeBinaryToWriter + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 4)); + if (f != null) { + writer.writeString( + 4, + f + ); + } + f = message.getRequiredSimple(); + if (f != null) { + writer.writeMessage( + 5, + f, + proto.jspb.test.Simple2.serializeBinaryToWriter + ); + } + f = message.getOptionalSimple(); + if (f != null) { + writer.writeMessage( + 6, + f, + proto.jspb.test.Simple2.serializeBinaryToWriter + ); + } +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.jspb.test.TestGroup.RepeatedGroup.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.TestGroup.RepeatedGroup.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.TestGroup.RepeatedGroup.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.TestGroup.RepeatedGroup} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestGroup.RepeatedGroup.toObject = function(includeInstance, msg) { + var f, obj = { +id: (f = jspb.Message.getField(msg, 0)) == null ? undefined : f, +someBoolList: (f = jspb.Message.getRepeatedBooleanField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.TestGroup.RepeatedGroup} + */ +proto.jspb.test.TestGroup.RepeatedGroup.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.TestGroup.RepeatedGroup; + return proto.jspb.test.TestGroup.RepeatedGroup.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.TestGroup.RepeatedGroup} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.TestGroup.RepeatedGroup} + */ +proto.jspb.test.TestGroup.RepeatedGroup.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setId(value); + break; + case 2: + var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readBool() : [reader.readBool()]); + for (var i = 0; i < values.length; i++) { + msg.addSomeBool(values[i]); + } + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.TestGroup.RepeatedGroup.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.TestGroup.RepeatedGroup.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.TestGroup.RepeatedGroup} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestGroup.RepeatedGroup.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 0)); + if (f != null) { + writer.writeString( + 1, + f + ); + } + f = message.getSomeBoolList(); + if (f.length > 0) { + writer.writeRepeatedBool( + 2, + f + ); + } +}; + + +/** + * required string id = 1; + * @return {string} + */ +proto.jspb.test.TestGroup.RepeatedGroup.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 0, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.TestGroup.RepeatedGroup} returns this + */ +proto.jspb.test.TestGroup.RepeatedGroup.prototype.setId = function(value) { + return jspb.Message.setField(this, 0, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestGroup.RepeatedGroup} returns this + */ +proto.jspb.test.TestGroup.RepeatedGroup.prototype.clearId = function() { + return jspb.Message.setField(this, 0, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestGroup.RepeatedGroup.prototype.hasId = function() { + return jspb.Message.getField(this, 0) != null; +}; + + +/** + * repeated bool some_bool = 2; + * @return {!Array} + */ +proto.jspb.test.TestGroup.RepeatedGroup.prototype.getSomeBoolList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedBooleanField(this, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.jspb.test.TestGroup.RepeatedGroup} returns this + */ +proto.jspb.test.TestGroup.RepeatedGroup.prototype.setSomeBoolList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {boolean} value + * @param {number=} opt_index + * @return {!proto.jspb.test.TestGroup.RepeatedGroup} returns this + */ +proto.jspb.test.TestGroup.RepeatedGroup.prototype.addSomeBool = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.jspb.test.TestGroup.RepeatedGroup} returns this + */ +proto.jspb.test.TestGroup.RepeatedGroup.prototype.clearSomeBoolList = function() { + return this.setSomeBoolList([]); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.TestGroup.RequiredGroup.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.TestGroup.RequiredGroup.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.TestGroup.RequiredGroup} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestGroup.RequiredGroup.toObject = function(includeInstance, msg) { + var f, obj = { +id: (f = jspb.Message.getField(msg, -1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.TestGroup.RequiredGroup} + */ +proto.jspb.test.TestGroup.RequiredGroup.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.TestGroup.RequiredGroup; + return proto.jspb.test.TestGroup.RequiredGroup.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.TestGroup.RequiredGroup} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.TestGroup.RequiredGroup} + */ +proto.jspb.test.TestGroup.RequiredGroup.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.TestGroup.RequiredGroup.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.TestGroup.RequiredGroup.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.TestGroup.RequiredGroup} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestGroup.RequiredGroup.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, -1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * required string id = 1; + * @return {string} + */ +proto.jspb.test.TestGroup.RequiredGroup.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, -1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.TestGroup.RequiredGroup} returns this + */ +proto.jspb.test.TestGroup.RequiredGroup.prototype.setId = function(value) { + return jspb.Message.setField(this, -1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestGroup.RequiredGroup} returns this + */ +proto.jspb.test.TestGroup.RequiredGroup.prototype.clearId = function() { + return jspb.Message.setField(this, -1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestGroup.RequiredGroup.prototype.hasId = function() { + return jspb.Message.getField(this, -1) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.TestGroup.OptionalGroup.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.TestGroup.OptionalGroup.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.TestGroup.OptionalGroup} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestGroup.OptionalGroup.toObject = function(includeInstance, msg) { + var f, obj = { +id: (f = jspb.Message.getField(msg, -2)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.TestGroup.OptionalGroup} + */ +proto.jspb.test.TestGroup.OptionalGroup.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.TestGroup.OptionalGroup; + return proto.jspb.test.TestGroup.OptionalGroup.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.TestGroup.OptionalGroup} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.TestGroup.OptionalGroup} + */ +proto.jspb.test.TestGroup.OptionalGroup.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.TestGroup.OptionalGroup.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.TestGroup.OptionalGroup.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.TestGroup.OptionalGroup} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestGroup.OptionalGroup.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, -2)); + if (f != null) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * required string id = 1; + * @return {string} + */ +proto.jspb.test.TestGroup.OptionalGroup.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, -2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.TestGroup.OptionalGroup} returns this + */ +proto.jspb.test.TestGroup.OptionalGroup.prototype.setId = function(value) { + return jspb.Message.setField(this, -2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestGroup.OptionalGroup} returns this + */ +proto.jspb.test.TestGroup.OptionalGroup.prototype.clearId = function() { + return jspb.Message.setField(this, -2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestGroup.OptionalGroup.prototype.hasId = function() { + return jspb.Message.getField(this, -2) != null; +}; + + +/** + * repeated group RepeatedGroup = 1; + * @return {!Array} + */ +proto.jspb.test.TestGroup.prototype.getRepeatedGroupList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.jspb.test.TestGroup.RepeatedGroup, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.jspb.test.TestGroup} returns this +*/ +proto.jspb.test.TestGroup.prototype.setRepeatedGroupList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.jspb.test.TestGroup.RepeatedGroup=} opt_value + * @param {number=} opt_index + * @return {!proto.jspb.test.TestGroup.RepeatedGroup} + */ +proto.jspb.test.TestGroup.prototype.addRepeatedGroup = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.jspb.test.TestGroup.RepeatedGroup, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.jspb.test.TestGroup} returns this + */ +proto.jspb.test.TestGroup.prototype.clearRepeatedGroupList = function() { + return this.setRepeatedGroupList([]); +}; + + +/** + * required group RequiredGroup = 2; + * @return {!proto.jspb.test.TestGroup.RequiredGroup} + */ +proto.jspb.test.TestGroup.prototype.getRequiredGroup = function() { + return /** @type{!proto.jspb.test.TestGroup.RequiredGroup} */ ( + jspb.Message.getWrapperField(this, proto.jspb.test.TestGroup.RequiredGroup, 2, 1)); +}; + + +/** + * @param {!proto.jspb.test.TestGroup.RequiredGroup} value + * @return {!proto.jspb.test.TestGroup} returns this +*/ +proto.jspb.test.TestGroup.prototype.setRequiredGroup = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestGroup} returns this + */ +proto.jspb.test.TestGroup.prototype.clearRequiredGroup = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestGroup.prototype.hasRequiredGroup = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional group OptionalGroup = 3; + * @return {?proto.jspb.test.TestGroup.OptionalGroup} + */ +proto.jspb.test.TestGroup.prototype.getOptionalGroup = function() { + return /** @type{?proto.jspb.test.TestGroup.OptionalGroup} */ ( + jspb.Message.getWrapperField(this, proto.jspb.test.TestGroup.OptionalGroup, 3)); +}; + + +/** + * @param {?proto.jspb.test.TestGroup.OptionalGroup|undefined} value + * @return {!proto.jspb.test.TestGroup} returns this +*/ +proto.jspb.test.TestGroup.prototype.setOptionalGroup = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.jspb.test.TestGroup} returns this + */ +proto.jspb.test.TestGroup.prototype.clearOptionalGroup = function() { + return this.setOptionalGroup(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestGroup.prototype.hasOptionalGroup = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional string id = 4; + * @return {string} + */ +proto.jspb.test.TestGroup.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.TestGroup} returns this + */ +proto.jspb.test.TestGroup.prototype.setId = function(value) { + return jspb.Message.setField(this, 4, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestGroup} returns this + */ +proto.jspb.test.TestGroup.prototype.clearId = function() { + return jspb.Message.setField(this, 4, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestGroup.prototype.hasId = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * required Simple2 required_simple = 5; + * @return {!proto.jspb.test.Simple2} + */ +proto.jspb.test.TestGroup.prototype.getRequiredSimple = function() { + return /** @type{!proto.jspb.test.Simple2} */ ( + jspb.Message.getWrapperField(this, proto.jspb.test.Simple2, 5, 1)); +}; + + +/** + * @param {!proto.jspb.test.Simple2} value + * @return {!proto.jspb.test.TestGroup} returns this +*/ +proto.jspb.test.TestGroup.prototype.setRequiredSimple = function(value) { + return jspb.Message.setWrapperField(this, 5, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestGroup} returns this + */ +proto.jspb.test.TestGroup.prototype.clearRequiredSimple = function() { + return jspb.Message.setField(this, 5, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestGroup.prototype.hasRequiredSimple = function() { + return jspb.Message.getField(this, 5) != null; +}; + + +/** + * optional Simple2 optional_simple = 6; + * @return {?proto.jspb.test.Simple2} + */ +proto.jspb.test.TestGroup.prototype.getOptionalSimple = function() { + return /** @type{?proto.jspb.test.Simple2} */ ( + jspb.Message.getWrapperField(this, proto.jspb.test.Simple2, 6)); +}; + + +/** + * @param {?proto.jspb.test.Simple2|undefined} value + * @return {!proto.jspb.test.TestGroup} returns this +*/ +proto.jspb.test.TestGroup.prototype.setOptionalSimple = function(value) { + return jspb.Message.setWrapperField(this, 6, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.jspb.test.TestGroup} returns this + */ +proto.jspb.test.TestGroup.prototype.clearOptionalSimple = function() { + return this.setOptionalSimple(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestGroup.prototype.hasOptionalSimple = function() { + return jspb.Message.getField(this, 6) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.TestGroup1.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.TestGroup1.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.TestGroup1} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestGroup1.toObject = function(includeInstance, msg) { + var f, obj = { +group: (f = msg.getGroup()) && proto.jspb.test.TestGroup.RepeatedGroup.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.TestGroup1} + */ +proto.jspb.test.TestGroup1.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.TestGroup1; + return proto.jspb.test.TestGroup1.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.TestGroup1} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.TestGroup1} + */ +proto.jspb.test.TestGroup1.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.jspb.test.TestGroup.RepeatedGroup; + reader.readMessage(value,proto.jspb.test.TestGroup.RepeatedGroup.deserializeBinaryFromReader); + msg.setGroup(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.TestGroup1.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.TestGroup1.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.TestGroup1} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestGroup1.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getGroup(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.jspb.test.TestGroup.RepeatedGroup.serializeBinaryToWriter + ); + } +}; + + +/** + * optional TestGroup.RepeatedGroup group = 1; + * @return {?proto.jspb.test.TestGroup.RepeatedGroup} + */ +proto.jspb.test.TestGroup1.prototype.getGroup = function() { + return /** @type{?proto.jspb.test.TestGroup.RepeatedGroup} */ ( + jspb.Message.getWrapperField(this, proto.jspb.test.TestGroup.RepeatedGroup, 1)); +}; + + +/** + * @param {?proto.jspb.test.TestGroup.RepeatedGroup|undefined} value + * @return {!proto.jspb.test.TestGroup1} returns this +*/ +proto.jspb.test.TestGroup1.prototype.setGroup = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.jspb.test.TestGroup1} returns this + */ +proto.jspb.test.TestGroup1.prototype.clearGroup = function() { + return this.setGroup(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestGroup1.prototype.hasGroup = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.TestReservedNames.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.TestReservedNames.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.TestReservedNames} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestReservedNames.toObject = function(includeInstance, msg) { + var f, obj = { +extension: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f + }; + + jspb.Message.toObjectExtension(/** @type {!jspb.Message} */ (msg), obj, + proto.jspb.test.TestReservedNames.extensions, proto.jspb.test.TestReservedNames.prototype.getExtension, + includeInstance); + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.TestReservedNames} + */ +proto.jspb.test.TestReservedNames.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.TestReservedNames; + return proto.jspb.test.TestReservedNames.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.TestReservedNames} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.TestReservedNames} + */ +proto.jspb.test.TestReservedNames.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt32()); + msg.setExtension$(value); + break; + default: + jspb.Message.readBinaryExtension(msg, reader, + proto.jspb.test.TestReservedNames.extensionsBinary, + proto.jspb.test.TestReservedNames.prototype.getExtension, + proto.jspb.test.TestReservedNames.prototype.setExtension); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.TestReservedNames.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.TestReservedNames.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.TestReservedNames} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestReservedNames.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {number} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeInt32( + 1, + f + ); + } + jspb.Message.serializeBinaryExtensions(message, writer, + proto.jspb.test.TestReservedNames.extensionsBinary, proto.jspb.test.TestReservedNames.prototype.getExtension); +}; + + +/** + * optional int32 extension = 1; + * @return {number} + */ +proto.jspb.test.TestReservedNames.prototype.getExtension$ = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.TestReservedNames} returns this + */ +proto.jspb.test.TestReservedNames.prototype.setExtension$ = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestReservedNames} returns this + */ +proto.jspb.test.TestReservedNames.prototype.clearExtension$ = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestReservedNames.prototype.hasExtension$ = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.TestReservedNamesExtension.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.TestReservedNamesExtension.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.TestReservedNamesExtension} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestReservedNamesExtension.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.TestReservedNamesExtension} + */ +proto.jspb.test.TestReservedNamesExtension.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.TestReservedNamesExtension; + return proto.jspb.test.TestReservedNamesExtension.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.TestReservedNamesExtension} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.TestReservedNamesExtension} + */ +proto.jspb.test.TestReservedNamesExtension.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.TestReservedNamesExtension.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.TestReservedNamesExtension.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.TestReservedNamesExtension} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestReservedNamesExtension.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + +/** + * A tuple of {field number, class constructor} for the extension + * field named `foo`. + * @type {!jspb.ExtensionFieldInfo} + */ +proto.jspb.test.TestReservedNamesExtension.foo = new jspb.ExtensionFieldInfo( + 10, + {foo: 0}, + null, + /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( + null), + 0); + +proto.jspb.test.TestReservedNames.extensionsBinary[10] = new jspb.ExtensionFieldBinaryInfo( + proto.jspb.test.TestReservedNamesExtension.foo, + jspb.BinaryReader.prototype.readInt32, + jspb.BinaryWriter.prototype.writeInt32, + undefined, + undefined, + false); +// This registers the extension field with the extended class, so that +// toObject() will function correctly. +proto.jspb.test.TestReservedNames.extensions[10] = proto.jspb.test.TestReservedNamesExtension.foo; + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.jspb.test.TestMessageWithOneof.repeatedFields_ = [9]; + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.jspb.test.TestMessageWithOneof.oneofGroups_ = [[3,5],[6,7],[10,11],[12,13]]; + +/** + * @enum {number} + */ +proto.jspb.test.TestMessageWithOneof.PartialOneofCase = { + PARTIAL_ONEOF_NOT_SET: 0, + PONE: 3, + PTHREE: 5 +}; + +/** + * @return {proto.jspb.test.TestMessageWithOneof.PartialOneofCase} + */ +proto.jspb.test.TestMessageWithOneof.prototype.getPartialOneofCase = function() { + return /** @type {proto.jspb.test.TestMessageWithOneof.PartialOneofCase} */(jspb.Message.computeOneofCase(this, proto.jspb.test.TestMessageWithOneof.oneofGroups_[0])); +}; + +/** + * @enum {number} + */ +proto.jspb.test.TestMessageWithOneof.RecursiveOneofCase = { + RECURSIVE_ONEOF_NOT_SET: 0, + RONE: 6, + RTWO: 7 +}; + +/** + * @return {proto.jspb.test.TestMessageWithOneof.RecursiveOneofCase} + */ +proto.jspb.test.TestMessageWithOneof.prototype.getRecursiveOneofCase = function() { + return /** @type {proto.jspb.test.TestMessageWithOneof.RecursiveOneofCase} */(jspb.Message.computeOneofCase(this, proto.jspb.test.TestMessageWithOneof.oneofGroups_[1])); +}; + +/** + * @enum {number} + */ +proto.jspb.test.TestMessageWithOneof.DefaultOneofACase = { + DEFAULT_ONEOF_A_NOT_SET: 0, + AONE: 10, + ATWO: 11 +}; + +/** + * @return {proto.jspb.test.TestMessageWithOneof.DefaultOneofACase} + */ +proto.jspb.test.TestMessageWithOneof.prototype.getDefaultOneofACase = function() { + return /** @type {proto.jspb.test.TestMessageWithOneof.DefaultOneofACase} */(jspb.Message.computeOneofCase(this, proto.jspb.test.TestMessageWithOneof.oneofGroups_[2])); +}; + +/** + * @enum {number} + */ +proto.jspb.test.TestMessageWithOneof.DefaultOneofBCase = { + DEFAULT_ONEOF_B_NOT_SET: 0, + BONE: 12, + BTWO: 13 +}; + +/** + * @return {proto.jspb.test.TestMessageWithOneof.DefaultOneofBCase} + */ +proto.jspb.test.TestMessageWithOneof.prototype.getDefaultOneofBCase = function() { + return /** @type {proto.jspb.test.TestMessageWithOneof.DefaultOneofBCase} */(jspb.Message.computeOneofCase(this, proto.jspb.test.TestMessageWithOneof.oneofGroups_[3])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.TestMessageWithOneof.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.TestMessageWithOneof.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.TestMessageWithOneof} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestMessageWithOneof.toObject = function(includeInstance, msg) { + var f, obj = { +pone: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f, +pthree: (f = jspb.Message.getField(msg, 5)) == null ? undefined : f, +rone: (f = msg.getRone()) && proto.jspb.test.TestMessageWithOneof.toObject(includeInstance, f), +rtwo: (f = jspb.Message.getField(msg, 7)) == null ? undefined : f, +normalField: (f = jspb.Message.getBooleanField(msg, 8)) == null ? undefined : f, +repeatedFieldList: (f = jspb.Message.getRepeatedField(msg, 9)) == null ? undefined : f, +aone: jspb.Message.getFieldWithDefault(msg, 10, 1234), +atwo: (f = jspb.Message.getField(msg, 11)) == null ? undefined : f, +bone: (f = jspb.Message.getField(msg, 12)) == null ? undefined : f, +btwo: jspb.Message.getFieldWithDefault(msg, 13, 1234) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.TestMessageWithOneof} + */ +proto.jspb.test.TestMessageWithOneof.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.TestMessageWithOneof; + return proto.jspb.test.TestMessageWithOneof.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.TestMessageWithOneof} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.TestMessageWithOneof} + */ +proto.jspb.test.TestMessageWithOneof.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setPone(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.setPthree(value); + break; + case 6: + var value = new proto.jspb.test.TestMessageWithOneof; + reader.readMessage(value,proto.jspb.test.TestMessageWithOneof.deserializeBinaryFromReader); + msg.setRone(value); + break; + case 7: + var value = /** @type {string} */ (reader.readString()); + msg.setRtwo(value); + break; + case 8: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setNormalField(value); + break; + case 9: + var value = /** @type {string} */ (reader.readString()); + msg.addRepeatedField(value); + break; + case 10: + var value = /** @type {number} */ (reader.readInt32()); + msg.setAone(value); + break; + case 11: + var value = /** @type {number} */ (reader.readInt32()); + msg.setAtwo(value); + break; + case 12: + var value = /** @type {number} */ (reader.readInt32()); + msg.setBone(value); + break; + case 13: + var value = /** @type {number} */ (reader.readInt32()); + msg.setBtwo(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.TestMessageWithOneof.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.TestMessageWithOneof.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.TestMessageWithOneof} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestMessageWithOneof.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 3)); + if (f != null) { + writer.writeString( + 3, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 5)); + if (f != null) { + writer.writeString( + 5, + f + ); + } + f = message.getRone(); + if (f != null) { + writer.writeMessage( + 6, + f, + proto.jspb.test.TestMessageWithOneof.serializeBinaryToWriter + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 7)); + if (f != null) { + writer.writeString( + 7, + f + ); + } + f = /** @type {boolean} */ (jspb.Message.getField(message, 8)); + if (f != null) { + writer.writeBool( + 8, + f + ); + } + f = message.getRepeatedFieldList(); + if (f.length > 0) { + writer.writeRepeatedString( + 9, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 10)); + if (f != null) { + writer.writeInt32( + 10, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 11)); + if (f != null) { + writer.writeInt32( + 11, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 12)); + if (f != null) { + writer.writeInt32( + 12, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 13)); + if (f != null) { + writer.writeInt32( + 13, + f + ); + } +}; + + +/** + * optional string pone = 3; + * @return {string} + */ +proto.jspb.test.TestMessageWithOneof.prototype.getPone = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.setPone = function(value) { + return jspb.Message.setOneofField(this, 3, proto.jspb.test.TestMessageWithOneof.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.clearPone = function() { + return jspb.Message.setOneofField(this, 3, proto.jspb.test.TestMessageWithOneof.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestMessageWithOneof.prototype.hasPone = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional string pthree = 5; + * @return {string} + */ +proto.jspb.test.TestMessageWithOneof.prototype.getPthree = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.setPthree = function(value) { + return jspb.Message.setOneofField(this, 5, proto.jspb.test.TestMessageWithOneof.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.clearPthree = function() { + return jspb.Message.setOneofField(this, 5, proto.jspb.test.TestMessageWithOneof.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestMessageWithOneof.prototype.hasPthree = function() { + return jspb.Message.getField(this, 5) != null; +}; + + +/** + * optional TestMessageWithOneof rone = 6; + * @return {?proto.jspb.test.TestMessageWithOneof} + */ +proto.jspb.test.TestMessageWithOneof.prototype.getRone = function() { + return /** @type{?proto.jspb.test.TestMessageWithOneof} */ ( + jspb.Message.getWrapperField(this, proto.jspb.test.TestMessageWithOneof, 6)); +}; + + +/** + * @param {?proto.jspb.test.TestMessageWithOneof|undefined} value + * @return {!proto.jspb.test.TestMessageWithOneof} returns this +*/ +proto.jspb.test.TestMessageWithOneof.prototype.setRone = function(value) { + return jspb.Message.setOneofWrapperField(this, 6, proto.jspb.test.TestMessageWithOneof.oneofGroups_[1], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.clearRone = function() { + return this.setRone(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestMessageWithOneof.prototype.hasRone = function() { + return jspb.Message.getField(this, 6) != null; +}; + + +/** + * optional string rtwo = 7; + * @return {string} + */ +proto.jspb.test.TestMessageWithOneof.prototype.getRtwo = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.setRtwo = function(value) { + return jspb.Message.setOneofField(this, 7, proto.jspb.test.TestMessageWithOneof.oneofGroups_[1], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.clearRtwo = function() { + return jspb.Message.setOneofField(this, 7, proto.jspb.test.TestMessageWithOneof.oneofGroups_[1], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestMessageWithOneof.prototype.hasRtwo = function() { + return jspb.Message.getField(this, 7) != null; +}; + + +/** + * optional bool normal_field = 8; + * @return {boolean} + */ +proto.jspb.test.TestMessageWithOneof.prototype.getNormalField = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 8, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.setNormalField = function(value) { + return jspb.Message.setField(this, 8, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.clearNormalField = function() { + return jspb.Message.setField(this, 8, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestMessageWithOneof.prototype.hasNormalField = function() { + return jspb.Message.getField(this, 8) != null; +}; + + +/** + * repeated string repeated_field = 9; + * @return {!Array} + */ +proto.jspb.test.TestMessageWithOneof.prototype.getRepeatedFieldList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 9)); +}; + + +/** + * @param {!Array} value + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.setRepeatedFieldList = function(value) { + return jspb.Message.setField(this, 9, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.addRepeatedField = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 9, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.clearRepeatedFieldList = function() { + return this.setRepeatedFieldList([]); +}; + + +/** + * optional int32 aone = 10; + * @return {number} + */ +proto.jspb.test.TestMessageWithOneof.prototype.getAone = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 10, 1234)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.setAone = function(value) { + return jspb.Message.setOneofField(this, 10, proto.jspb.test.TestMessageWithOneof.oneofGroups_[2], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.clearAone = function() { + return jspb.Message.setOneofField(this, 10, proto.jspb.test.TestMessageWithOneof.oneofGroups_[2], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestMessageWithOneof.prototype.hasAone = function() { + return jspb.Message.getField(this, 10) != null; +}; + + +/** + * optional int32 atwo = 11; + * @return {number} + */ +proto.jspb.test.TestMessageWithOneof.prototype.getAtwo = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 11, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.setAtwo = function(value) { + return jspb.Message.setOneofField(this, 11, proto.jspb.test.TestMessageWithOneof.oneofGroups_[2], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.clearAtwo = function() { + return jspb.Message.setOneofField(this, 11, proto.jspb.test.TestMessageWithOneof.oneofGroups_[2], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestMessageWithOneof.prototype.hasAtwo = function() { + return jspb.Message.getField(this, 11) != null; +}; + + +/** + * optional int32 bone = 12; + * @return {number} + */ +proto.jspb.test.TestMessageWithOneof.prototype.getBone = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 12, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.setBone = function(value) { + return jspb.Message.setOneofField(this, 12, proto.jspb.test.TestMessageWithOneof.oneofGroups_[3], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.clearBone = function() { + return jspb.Message.setOneofField(this, 12, proto.jspb.test.TestMessageWithOneof.oneofGroups_[3], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestMessageWithOneof.prototype.hasBone = function() { + return jspb.Message.getField(this, 12) != null; +}; + + +/** + * optional int32 btwo = 13; + * @return {number} + */ +proto.jspb.test.TestMessageWithOneof.prototype.getBtwo = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 13, 1234)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.setBtwo = function(value) { + return jspb.Message.setOneofField(this, 13, proto.jspb.test.TestMessageWithOneof.oneofGroups_[3], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestMessageWithOneof} returns this + */ +proto.jspb.test.TestMessageWithOneof.prototype.clearBtwo = function() { + return jspb.Message.setOneofField(this, 13, proto.jspb.test.TestMessageWithOneof.oneofGroups_[3], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestMessageWithOneof.prototype.hasBtwo = function() { + return jspb.Message.getField(this, 13) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.TestEndsWithBytes.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.TestEndsWithBytes.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.TestEndsWithBytes} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestEndsWithBytes.toObject = function(includeInstance, msg) { + var f, obj = { +value: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, +data: msg.getData_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.TestEndsWithBytes} + */ +proto.jspb.test.TestEndsWithBytes.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.TestEndsWithBytes; + return proto.jspb.test.TestEndsWithBytes.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.TestEndsWithBytes} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.TestEndsWithBytes} + */ +proto.jspb.test.TestEndsWithBytes.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt32()); + msg.setValue(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setData(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.TestEndsWithBytes.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.TestEndsWithBytes.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.TestEndsWithBytes} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestEndsWithBytes.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {number} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeInt32( + 1, + f + ); + } + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeBytes( + 2, + f + ); + } +}; + + +/** + * optional int32 value = 1; + * @return {number} + */ +proto.jspb.test.TestEndsWithBytes.prototype.getValue = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.TestEndsWithBytes} returns this + */ +proto.jspb.test.TestEndsWithBytes.prototype.setValue = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestEndsWithBytes} returns this + */ +proto.jspb.test.TestEndsWithBytes.prototype.clearValue = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestEndsWithBytes.prototype.hasValue = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional bytes data = 2; + * @return {!(string|Uint8Array)} + */ +proto.jspb.test.TestEndsWithBytes.prototype.getData = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes data = 2; + * This is a type-conversion wrapper around `getData()` + * @return {string} + */ +proto.jspb.test.TestEndsWithBytes.prototype.getData_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getData())); +}; + + +/** + * optional bytes data = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getData()` + * @return {!Uint8Array} + */ +proto.jspb.test.TestEndsWithBytes.prototype.getData_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getData())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.jspb.test.TestEndsWithBytes} returns this + */ +proto.jspb.test.TestEndsWithBytes.prototype.setData = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestEndsWithBytes} returns this + */ +proto.jspb.test.TestEndsWithBytes.prototype.clearData = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestEndsWithBytes.prototype.hasData = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.TestLastFieldBeforePivot.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.TestLastFieldBeforePivot.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.TestLastFieldBeforePivot} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestLastFieldBeforePivot.toObject = function(includeInstance, msg) { + var f, obj = { +lastFieldBeforePivot: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f + }; + + jspb.Message.toObjectExtension(/** @type {!jspb.Message} */ (msg), obj, + proto.jspb.test.TestLastFieldBeforePivot.extensions, proto.jspb.test.TestLastFieldBeforePivot.prototype.getExtension, + includeInstance); + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.TestLastFieldBeforePivot} + */ +proto.jspb.test.TestLastFieldBeforePivot.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.TestLastFieldBeforePivot; + return proto.jspb.test.TestLastFieldBeforePivot.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.TestLastFieldBeforePivot} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.TestLastFieldBeforePivot} + */ +proto.jspb.test.TestLastFieldBeforePivot.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt32()); + msg.setLastFieldBeforePivot(value); + break; + default: + jspb.Message.readBinaryExtension(msg, reader, + proto.jspb.test.TestLastFieldBeforePivot.extensionsBinary, + proto.jspb.test.TestLastFieldBeforePivot.prototype.getExtension, + proto.jspb.test.TestLastFieldBeforePivot.prototype.setExtension); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.TestLastFieldBeforePivot.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.TestLastFieldBeforePivot.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.TestLastFieldBeforePivot} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestLastFieldBeforePivot.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {number} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeInt32( + 1, + f + ); + } + jspb.Message.serializeBinaryExtensions(message, writer, + proto.jspb.test.TestLastFieldBeforePivot.extensionsBinary, proto.jspb.test.TestLastFieldBeforePivot.prototype.getExtension); +}; + + +/** + * optional int32 last_field_before_pivot = 1; + * @return {number} + */ +proto.jspb.test.TestLastFieldBeforePivot.prototype.getLastFieldBeforePivot = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.TestLastFieldBeforePivot} returns this + */ +proto.jspb.test.TestLastFieldBeforePivot.prototype.setLastFieldBeforePivot = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.TestLastFieldBeforePivot} returns this + */ +proto.jspb.test.TestLastFieldBeforePivot.prototype.clearLastFieldBeforePivot = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestLastFieldBeforePivot.prototype.hasLastFieldBeforePivot = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.Int64Types.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.Int64Types.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.Int64Types} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Int64Types.toObject = function(includeInstance, msg) { + var f, obj = { +int64Normal: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, +int64String: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f, +int64Number: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.Int64Types} + */ +proto.jspb.test.Int64Types.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.Int64Types; + return proto.jspb.test.Int64Types.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.Int64Types} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.Int64Types} + */ +proto.jspb.test.Int64Types.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt64()); + msg.setInt64Normal(value); + break; + case 2: + var value = /** @type {string} */ (reader.readSint64String()); + msg.setInt64String(value); + break; + case 3: + var value = /** @type {number} */ (reader.readUint64()); + msg.setInt64Number(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.Int64Types.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.Int64Types.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.Int64Types} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Int64Types.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {number} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeInt64( + 1, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeSint64String( + 2, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 3)); + if (f != null) { + writer.writeUint64( + 3, + f + ); + } +}; + + +/** + * optional int64 int64_normal = 1; + * @return {number} + */ +proto.jspb.test.Int64Types.prototype.getInt64Normal = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.Int64Types} returns this + */ +proto.jspb.test.Int64Types.prototype.setInt64Normal = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.Int64Types} returns this + */ +proto.jspb.test.Int64Types.prototype.clearInt64Normal = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.Int64Types.prototype.hasInt64Normal = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional sint64 int64_string = 2; + * @return {string} + */ +proto.jspb.test.Int64Types.prototype.getInt64String = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "0")); +}; + + +/** + * @param {string} value + * @return {!proto.jspb.test.Int64Types} returns this + */ +proto.jspb.test.Int64Types.prototype.setInt64String = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.Int64Types} returns this + */ +proto.jspb.test.Int64Types.prototype.clearInt64String = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.Int64Types.prototype.hasInt64String = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional uint64 int64_number = 3; + * @return {number} + */ +proto.jspb.test.Int64Types.prototype.getInt64Number = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.Int64Types} returns this + */ +proto.jspb.test.Int64Types.prototype.setInt64Number = function(value) { + return jspb.Message.setField(this, 3, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.Int64Types} returns this + */ +proto.jspb.test.Int64Types.prototype.clearInt64Number = function() { + return jspb.Message.setField(this, 3, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.Int64Types.prototype.hasInt64Number = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.TestMapFieldsNoBinary.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.TestMapFieldsNoBinary} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestMapFieldsNoBinary.toObject = function(includeInstance, msg) { + var f, obj = { +mapStringStringMap: (f = msg.getMapStringStringMap()) ? f.toObject(includeInstance, undefined) : [], +mapStringInt32Map: (f = msg.getMapStringInt32Map()) ? f.toObject(includeInstance, undefined) : [], +mapStringInt64Map: (f = msg.getMapStringInt64Map()) ? f.toObject(includeInstance, undefined) : [], +mapStringBoolMap: (f = msg.getMapStringBoolMap()) ? f.toObject(includeInstance, undefined) : [], +mapStringDoubleMap: (f = msg.getMapStringDoubleMap()) ? f.toObject(includeInstance, undefined) : [], +mapStringEnumMap: (f = msg.getMapStringEnumMap()) ? f.toObject(includeInstance, undefined) : [], +mapStringMsgMap: (f = msg.getMapStringMsgMap()) ? f.toObject(includeInstance, proto.jspb.test.MapValueMessageNoBinary.toObject) : [], +mapInt32StringMap: (f = msg.getMapInt32StringMap()) ? f.toObject(includeInstance, undefined) : [], +mapInt64StringMap: (f = msg.getMapInt64StringMap()) ? f.toObject(includeInstance, undefined) : [], +mapBoolStringMap: (f = msg.getMapBoolStringMap()) ? f.toObject(includeInstance, undefined) : [], +testMapFields: (f = msg.getTestMapFields()) && proto.jspb.test.TestMapFieldsNoBinary.toObject(includeInstance, f), +mapStringTestmapfieldsMap: (f = msg.getMapStringTestmapfieldsMap()) ? f.toObject(includeInstance, proto.jspb.test.TestMapFieldsNoBinary.toObject) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.TestMapFieldsNoBinary} + */ +proto.jspb.test.TestMapFieldsNoBinary.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.TestMapFieldsNoBinary; + return proto.jspb.test.TestMapFieldsNoBinary.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.TestMapFieldsNoBinary} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.TestMapFieldsNoBinary} + */ +proto.jspb.test.TestMapFieldsNoBinary.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = msg.getMapStringStringMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; + case 2: + var value = msg.getMapStringInt32Map(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readInt32, null, "", 0); + }); + break; + case 3: + var value = msg.getMapStringInt64Map(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readInt64, null, "", 0); + }); + break; + case 4: + var value = msg.getMapStringBoolMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readBool, null, "", false); + }); + break; + case 5: + var value = msg.getMapStringDoubleMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readDouble, null, "", 0.0); + }); + break; + case 6: + var value = msg.getMapStringEnumMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readEnum, null, "", 0); + }); + break; + case 7: + var value = msg.getMapStringMsgMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.jspb.test.MapValueMessageNoBinary.deserializeBinaryFromReader, "", new proto.jspb.test.MapValueMessageNoBinary()); + }); + break; + case 8: + var value = msg.getMapInt32StringMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readInt32, jspb.BinaryReader.prototype.readString, null, 0, ""); + }); + break; + case 9: + var value = msg.getMapInt64StringMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readInt64, jspb.BinaryReader.prototype.readString, null, 0, ""); + }); + break; + case 10: + var value = msg.getMapBoolStringMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readBool, jspb.BinaryReader.prototype.readString, null, false, ""); + }); + break; + case 11: + var value = new proto.jspb.test.TestMapFieldsNoBinary; + reader.readMessage(value,proto.jspb.test.TestMapFieldsNoBinary.deserializeBinaryFromReader); + msg.setTestMapFields(value); + break; + case 12: + var value = msg.getMapStringTestmapfieldsMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.jspb.test.TestMapFieldsNoBinary.deserializeBinaryFromReader, "", new proto.jspb.test.TestMapFieldsNoBinary()); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.TestMapFieldsNoBinary.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.TestMapFieldsNoBinary} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.TestMapFieldsNoBinary.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getMapStringStringMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } + f = message.getMapStringInt32Map(true); + if (f && f.getLength() > 0) { + f.serializeBinary(2, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeInt32); + } + f = message.getMapStringInt64Map(true); + if (f && f.getLength() > 0) { + f.serializeBinary(3, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeInt64); + } + f = message.getMapStringBoolMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(4, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeBool); + } + f = message.getMapStringDoubleMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(5, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeDouble); + } + f = message.getMapStringEnumMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(6, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeEnum); + } + f = message.getMapStringMsgMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(7, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.jspb.test.MapValueMessageNoBinary.serializeBinaryToWriter); + } + f = message.getMapInt32StringMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(8, writer, jspb.BinaryWriter.prototype.writeInt32, jspb.BinaryWriter.prototype.writeString); + } + f = message.getMapInt64StringMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(9, writer, jspb.BinaryWriter.prototype.writeInt64, jspb.BinaryWriter.prototype.writeString); + } + f = message.getMapBoolStringMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(10, writer, jspb.BinaryWriter.prototype.writeBool, jspb.BinaryWriter.prototype.writeString); + } + f = message.getTestMapFields(); + if (f != null) { + writer.writeMessage( + 11, + f, + proto.jspb.test.TestMapFieldsNoBinary.serializeBinaryToWriter + ); + } + f = message.getMapStringTestmapfieldsMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(12, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.jspb.test.TestMapFieldsNoBinary.serializeBinaryToWriter); + } +}; + + +/** + * map map_string_string = 1; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapStringStringMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 1, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapStringStringMap = function() { + this.getMapStringStringMap().clear(); + return this; +}; + + +/** + * map map_string_int32 = 2; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapStringInt32Map = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 2, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapStringInt32Map = function() { + this.getMapStringInt32Map().clear(); + return this; +}; + + +/** + * map map_string_int64 = 3; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapStringInt64Map = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 3, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapStringInt64Map = function() { + this.getMapStringInt64Map().clear(); + return this; +}; + + +/** + * map map_string_bool = 4; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapStringBoolMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 4, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapStringBoolMap = function() { + this.getMapStringBoolMap().clear(); + return this; +}; + + +/** + * map map_string_double = 5; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapStringDoubleMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 5, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapStringDoubleMap = function() { + this.getMapStringDoubleMap().clear(); + return this; +}; + + +/** + * map map_string_enum = 6; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapStringEnumMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 6, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapStringEnumMap = function() { + this.getMapStringEnumMap().clear(); + return this; +}; + + +/** + * map map_string_msg = 7; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapStringMsgMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 7, opt_noLazyCreate, + proto.jspb.test.MapValueMessageNoBinary)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapStringMsgMap = function() { + this.getMapStringMsgMap().clear(); + return this; +}; + + +/** + * map map_int32_string = 8; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapInt32StringMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 8, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapInt32StringMap = function() { + this.getMapInt32StringMap().clear(); + return this; +}; + + +/** + * map map_int64_string = 9; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapInt64StringMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 9, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapInt64StringMap = function() { + this.getMapInt64StringMap().clear(); + return this; +}; + + +/** + * map map_bool_string = 10; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapBoolStringMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 10, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapBoolStringMap = function() { + this.getMapBoolStringMap().clear(); + return this; +}; + + +/** + * optional TestMapFieldsNoBinary test_map_fields = 11; + * @return {?proto.jspb.test.TestMapFieldsNoBinary} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.getTestMapFields = function() { + return /** @type{?proto.jspb.test.TestMapFieldsNoBinary} */ ( + jspb.Message.getWrapperField(this, proto.jspb.test.TestMapFieldsNoBinary, 11)); +}; + + +/** + * @param {?proto.jspb.test.TestMapFieldsNoBinary|undefined} value + * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this +*/ +proto.jspb.test.TestMapFieldsNoBinary.prototype.setTestMapFields = function(value) { + return jspb.Message.setWrapperField(this, 11, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.clearTestMapFields = function() { + return this.setTestMapFields(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.hasTestMapFields = function() { + return jspb.Message.getField(this, 11) != null; +}; + + +/** + * map map_string_testmapfields = 12; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.getMapStringTestmapfieldsMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 12, opt_noLazyCreate, + proto.jspb.test.TestMapFieldsNoBinary)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.jspb.test.TestMapFieldsNoBinary} returns this + */ +proto.jspb.test.TestMapFieldsNoBinary.prototype.clearMapStringTestmapfieldsMap = function() { + this.getMapStringTestmapfieldsMap().clear(); + return this; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.MapValueMessageNoBinary.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.MapValueMessageNoBinary.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.MapValueMessageNoBinary} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.MapValueMessageNoBinary.toObject = function(includeInstance, msg) { + var f, obj = { +foo: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.MapValueMessageNoBinary} + */ +proto.jspb.test.MapValueMessageNoBinary.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.MapValueMessageNoBinary; + return proto.jspb.test.MapValueMessageNoBinary.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.MapValueMessageNoBinary} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.MapValueMessageNoBinary} + */ +proto.jspb.test.MapValueMessageNoBinary.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt32()); + msg.setFoo(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.MapValueMessageNoBinary.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.MapValueMessageNoBinary.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.MapValueMessageNoBinary} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.MapValueMessageNoBinary.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {number} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeInt32( + 1, + f + ); + } +}; + + +/** + * optional int32 foo = 1; + * @return {number} + */ +proto.jspb.test.MapValueMessageNoBinary.prototype.getFoo = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.MapValueMessageNoBinary} returns this + */ +proto.jspb.test.MapValueMessageNoBinary.prototype.setFoo = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.MapValueMessageNoBinary} returns this + */ +proto.jspb.test.MapValueMessageNoBinary.prototype.clearFoo = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.MapValueMessageNoBinary.prototype.hasFoo = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.Deeply.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.Deeply.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.Deeply} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Deeply.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.Deeply} + */ +proto.jspb.test.Deeply.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.Deeply; + return proto.jspb.test.Deeply.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.Deeply} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.Deeply} + */ +proto.jspb.test.Deeply.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.Deeply.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.Deeply.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.Deeply} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Deeply.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.Deeply.Nested.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.Deeply.Nested.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.Deeply.Nested} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Deeply.Nested.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.Deeply.Nested} + */ +proto.jspb.test.Deeply.Nested.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.Deeply.Nested; + return proto.jspb.test.Deeply.Nested.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.Deeply.Nested} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.Deeply.Nested} + */ +proto.jspb.test.Deeply.Nested.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.Deeply.Nested.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.Deeply.Nested.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.Deeply.Nested} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Deeply.Nested.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.jspb.test.Deeply.Nested.Message.prototype.toObject = function(opt_includeInstance) { + return proto.jspb.test.Deeply.Nested.Message.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.jspb.test.Deeply.Nested.Message} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Deeply.Nested.Message.toObject = function(includeInstance, msg) { + var f, obj = { +count: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.jspb.test.Deeply.Nested.Message} + */ +proto.jspb.test.Deeply.Nested.Message.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.jspb.test.Deeply.Nested.Message; + return proto.jspb.test.Deeply.Nested.Message.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.jspb.test.Deeply.Nested.Message} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.jspb.test.Deeply.Nested.Message} + */ +proto.jspb.test.Deeply.Nested.Message.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt32()); + msg.setCount(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.jspb.test.Deeply.Nested.Message.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.jspb.test.Deeply.Nested.Message.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.jspb.test.Deeply.Nested.Message} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.jspb.test.Deeply.Nested.Message.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {number} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeInt32( + 1, + f + ); + } +}; + + +/** + * optional int32 count = 1; + * @return {number} + */ +proto.jspb.test.Deeply.Nested.Message.prototype.getCount = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.jspb.test.Deeply.Nested.Message} returns this + */ +proto.jspb.test.Deeply.Nested.Message.prototype.setCount = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.jspb.test.Deeply.Nested.Message} returns this + */ +proto.jspb.test.Deeply.Nested.Message.prototype.clearCount = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.jspb.test.Deeply.Nested.Message.prototype.hasCount = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * @enum {number} + */ +proto.jspb.test.OuterEnum = { + FOO: 1, + BAR: 2 +}; + +/** + * @enum {number} + */ +proto.jspb.test.MapValueEnumNoBinary = { + MAP_VALUE_FOO_NOBINARY: 0, + MAP_VALUE_BAR_NOBINARY: 1, + MAP_VALUE_BAZ_NOBINARY: 2 +}; + +/** + * @enum {number} + */ +proto.jspb.test.TestAllowAliasEnum = { + TEST_ALLOW_ALIAS_DEFAULT: 0, + VALUE1: 1 +}; + + +/** + * A tuple of {field number, class constructor} for the extension + * field named `simple1`. + * @type {!jspb.ExtensionFieldInfo} + */ +proto.jspb.test.simple1 = new jspb.ExtensionFieldInfo( + 105, + {simple1: 0}, + proto.jspb.test.Simple1, + /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( + proto.jspb.test.Simple1.toObject), + 0); + +proto.jspb.test.HasExtensions.extensionsBinary[105] = new jspb.ExtensionFieldBinaryInfo( + proto.jspb.test.simple1, + jspb.BinaryReader.prototype.readMessage, + jspb.BinaryWriter.prototype.writeMessage, + proto.jspb.test.Simple1.serializeBinaryToWriter, + proto.jspb.test.Simple1.deserializeBinaryFromReader, + false); +// This registers the extension field with the extended class, so that +// toObject() will function correctly. +proto.jspb.test.HasExtensions.extensions[105] = proto.jspb.test.simple1; + + +/** + * A tuple of {field number, class constructor} for the extension + * field named `extendTestLastFieldBeforePivotField`. + * @type {!jspb.ExtensionFieldInfo} + */ +proto.jspb.test.extendTestLastFieldBeforePivotField = new jspb.ExtensionFieldInfo( + 101, + {extendTestLastFieldBeforePivotField: 0}, + null, + /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( + null), + 0); + +proto.jspb.test.TestLastFieldBeforePivot.extensionsBinary[101] = new jspb.ExtensionFieldBinaryInfo( + proto.jspb.test.extendTestLastFieldBeforePivotField, + jspb.BinaryReader.prototype.readInt32, + jspb.BinaryWriter.prototype.writeInt32, + undefined, + undefined, + false); +// This registers the extension field with the extended class, so that +// toObject() will function correctly. +proto.jspb.test.TestLastFieldBeforePivot.extensions[101] = proto.jspb.test.extendTestLastFieldBeforePivotField; + diff --git a/example/test.closure.diff b/example/test.closure.diff new file mode 100644 index 0000000..e69de29