UnittestIssues.cs 91 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637
  1. // <auto-generated>
  2. // Generated by the protocol buffer compiler. DO NOT EDIT!
  3. // source: unittest_issues.proto
  4. // </auto-generated>
  5. #pragma warning disable 1591, 0612, 3021
  6. #region Designer generated code
  7. using pb = global::Google.Protobuf;
  8. using pbc = global::Google.Protobuf.Collections;
  9. using pbr = global::Google.Protobuf.Reflection;
  10. using scg = global::System.Collections.Generic;
  11. namespace UnitTest.Issues.TestProtos {
  12. /// <summary>Holder for reflection information generated from unittest_issues.proto</summary>
  13. public static partial class UnittestIssuesReflection {
  14. #region Descriptor
  15. /// <summary>File descriptor for unittest_issues.proto</summary>
  16. public static pbr::FileDescriptor Descriptor {
  17. get { return descriptor; }
  18. }
  19. private static pbr::FileDescriptor descriptor;
  20. static UnittestIssuesReflection() {
  21. byte[] descriptorData = global::System.Convert.FromBase64String(
  22. string.Concat(
  23. "ChV1bml0dGVzdF9pc3N1ZXMucHJvdG8SD3VuaXR0ZXN0X2lzc3VlcyInCghJ",
  24. "c3N1ZTMwNxobCgpOZXN0ZWRPbmNlGg0KC05lc3RlZFR3aWNlIrABChNOZWdh",
  25. "dGl2ZUVudW1NZXNzYWdlEiwKBXZhbHVlGAEgASgOMh0udW5pdHRlc3RfaXNz",
  26. "dWVzLk5lZ2F0aXZlRW51bRIxCgZ2YWx1ZXMYAiADKA4yHS51bml0dGVzdF9p",
  27. "c3N1ZXMuTmVnYXRpdmVFbnVtQgIQABI4Cg1wYWNrZWRfdmFsdWVzGAMgAygO",
  28. "Mh0udW5pdHRlc3RfaXNzdWVzLk5lZ2F0aXZlRW51bUICEAEiEQoPRGVwcmVj",
  29. "YXRlZENoaWxkIrkCChdEZXByZWNhdGVkRmllbGRzTWVzc2FnZRIaCg5Qcmlt",
  30. "aXRpdmVWYWx1ZRgBIAEoBUICGAESGgoOUHJpbWl0aXZlQXJyYXkYAiADKAVC",
  31. "AhgBEjoKDE1lc3NhZ2VWYWx1ZRgDIAEoCzIgLnVuaXR0ZXN0X2lzc3Vlcy5E",
  32. "ZXByZWNhdGVkQ2hpbGRCAhgBEjoKDE1lc3NhZ2VBcnJheRgEIAMoCzIgLnVu",
  33. "aXR0ZXN0X2lzc3Vlcy5EZXByZWNhdGVkQ2hpbGRCAhgBEjYKCUVudW1WYWx1",
  34. "ZRgFIAEoDjIfLnVuaXR0ZXN0X2lzc3Vlcy5EZXByZWNhdGVkRW51bUICGAES",
  35. "NgoJRW51bUFycmF5GAYgAygOMh8udW5pdHRlc3RfaXNzdWVzLkRlcHJlY2F0",
  36. "ZWRFbnVtQgIYASIZCglJdGVtRmllbGQSDAoEaXRlbRgBIAEoBSJECg1SZXNl",
  37. "cnZlZE5hbWVzEg0KBXR5cGVzGAEgASgFEhIKCmRlc2NyaXB0b3IYAiABKAUa",
  38. "EAoOU29tZU5lc3RlZFR5cGUioAEKFVRlc3RKc29uRmllbGRPcmRlcmluZxIT",
  39. "CgtwbGFpbl9pbnQzMhgEIAEoBRITCglvMV9zdHJpbmcYAiABKAlIABISCghv",
  40. "MV9pbnQzMhgFIAEoBUgAEhQKDHBsYWluX3N0cmluZxgBIAEoCRISCghvMl9p",
  41. "bnQzMhgGIAEoBUgBEhMKCW8yX3N0cmluZxgDIAEoCUgBQgQKAm8xQgQKAm8y",
  42. "IksKDFRlc3RKc29uTmFtZRIMCgRuYW1lGAEgASgJEhkKC2Rlc2NyaXB0aW9u",
  43. "GAIgASgJUgRkZXNjEhIKBGd1aWQYAyABKAlSBGV4aWQifwoMT25lb2ZNZXJn",
  44. "aW5nEg4KBHRleHQYASABKAlIABI2CgZuZXN0ZWQYAiABKAsyJC51bml0dGVz",
  45. "dF9pc3N1ZXMuT25lb2ZNZXJnaW5nLk5lc3RlZEgAGh4KBk5lc3RlZBIJCgF4",
  46. "GAEgASgFEgkKAXkYAiABKAVCBwoFdmFsdWUqVQoMTmVnYXRpdmVFbnVtEhYK",
  47. "Ek5FR0FUSVZFX0VOVU1fWkVSTxAAEhYKCUZpdmVCZWxvdxD7//////////8B",
  48. "EhUKCE1pbnVzT25lEP///////////wEqLgoORGVwcmVjYXRlZEVudW0SEwoP",
  49. "REVQUkVDQVRFRF9aRVJPEAASBwoDb25lEAFCHaoCGlVuaXRUZXN0Lklzc3Vl",
  50. "cy5UZXN0UHJvdG9zYgZwcm90bzM="));
  51. descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
  52. new pbr::FileDescriptor[] { },
  53. new pbr::GeneratedClrTypeInfo(new[] {typeof(global::UnitTest.Issues.TestProtos.NegativeEnum), typeof(global::UnitTest.Issues.TestProtos.DeprecatedEnum), }, null, new pbr::GeneratedClrTypeInfo[] {
  54. new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.Issue307), global::UnitTest.Issues.TestProtos.Issue307.Parser, null, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce), global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce.Parser, null, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce.Types.NestedTwice), global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce.Types.NestedTwice.Parser, null, null, null, null, null)})}),
  55. new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.NegativeEnumMessage), global::UnitTest.Issues.TestProtos.NegativeEnumMessage.Parser, new[]{ "Value", "Values", "PackedValues" }, null, null, null, null),
  56. new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.DeprecatedChild), global::UnitTest.Issues.TestProtos.DeprecatedChild.Parser, null, null, null, null, null),
  57. new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.DeprecatedFieldsMessage), global::UnitTest.Issues.TestProtos.DeprecatedFieldsMessage.Parser, new[]{ "PrimitiveValue", "PrimitiveArray", "MessageValue", "MessageArray", "EnumValue", "EnumArray" }, null, null, null, null),
  58. new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.ItemField), global::UnitTest.Issues.TestProtos.ItemField.Parser, new[]{ "Item" }, null, null, null, null),
  59. new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.ReservedNames), global::UnitTest.Issues.TestProtos.ReservedNames.Parser, new[]{ "Types_", "Descriptor_" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.ReservedNames.Types.SomeNestedType), global::UnitTest.Issues.TestProtos.ReservedNames.Types.SomeNestedType.Parser, null, null, null, null, null)}),
  60. new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.TestJsonFieldOrdering), global::UnitTest.Issues.TestProtos.TestJsonFieldOrdering.Parser, new[]{ "PlainInt32", "O1String", "O1Int32", "PlainString", "O2Int32", "O2String" }, new[]{ "O1", "O2" }, null, null, null),
  61. new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.TestJsonName), global::UnitTest.Issues.TestProtos.TestJsonName.Parser, new[]{ "Name", "Description", "Guid" }, null, null, null, null),
  62. new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.OneofMerging), global::UnitTest.Issues.TestProtos.OneofMerging.Parser, new[]{ "Text", "Nested" }, new[]{ "Value" }, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.OneofMerging.Types.Nested), global::UnitTest.Issues.TestProtos.OneofMerging.Types.Nested.Parser, new[]{ "X", "Y" }, null, null, null, null)})
  63. }));
  64. }
  65. #endregion
  66. }
  67. #region Enums
  68. public enum NegativeEnum {
  69. [pbr::OriginalName("NEGATIVE_ENUM_ZERO")] Zero = 0,
  70. [pbr::OriginalName("FiveBelow")] FiveBelow = -5,
  71. [pbr::OriginalName("MinusOne")] MinusOne = -1,
  72. }
  73. public enum DeprecatedEnum {
  74. [pbr::OriginalName("DEPRECATED_ZERO")] DeprecatedZero = 0,
  75. [pbr::OriginalName("one")] One = 1,
  76. }
  77. #endregion
  78. #region Messages
  79. /// <summary>
  80. /// Issue 307: when generating doubly-nested types, any references
  81. /// should be of the form A.Types.B.Types.C.
  82. /// </summary>
  83. public sealed partial class Issue307 : pb::IMessage<Issue307>
  84. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  85. , pb::IBufferMessage
  86. #endif
  87. {
  88. private static readonly pb::MessageParser<Issue307> _parser = new pb::MessageParser<Issue307>(() => new Issue307());
  89. private pb::UnknownFieldSet _unknownFields;
  90. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  91. public static pb::MessageParser<Issue307> Parser { get { return _parser; } }
  92. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  93. public static pbr::MessageDescriptor Descriptor {
  94. get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[0]; }
  95. }
  96. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  97. pbr::MessageDescriptor pb::IMessage.Descriptor {
  98. get { return Descriptor; }
  99. }
  100. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  101. public Issue307() {
  102. OnConstruction();
  103. }
  104. partial void OnConstruction();
  105. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  106. public Issue307(Issue307 other) : this() {
  107. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  108. }
  109. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  110. public Issue307 Clone() {
  111. return new Issue307(this);
  112. }
  113. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  114. public override bool Equals(object other) {
  115. return Equals(other as Issue307);
  116. }
  117. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  118. public bool Equals(Issue307 other) {
  119. if (ReferenceEquals(other, null)) {
  120. return false;
  121. }
  122. if (ReferenceEquals(other, this)) {
  123. return true;
  124. }
  125. return Equals(_unknownFields, other._unknownFields);
  126. }
  127. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  128. public override int GetHashCode() {
  129. int hash = 1;
  130. if (_unknownFields != null) {
  131. hash ^= _unknownFields.GetHashCode();
  132. }
  133. return hash;
  134. }
  135. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  136. public override string ToString() {
  137. return pb::JsonFormatter.ToDiagnosticString(this);
  138. }
  139. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  140. public void WriteTo(pb::CodedOutputStream output) {
  141. if (_unknownFields != null) {
  142. _unknownFields.WriteTo(output);
  143. }
  144. }
  145. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  146. public int CalculateSize() {
  147. int size = 0;
  148. if (_unknownFields != null) {
  149. size += _unknownFields.CalculateSize();
  150. }
  151. return size;
  152. }
  153. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  154. public void MergeFrom(Issue307 other) {
  155. if (other == null) {
  156. return;
  157. }
  158. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  159. }
  160. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  161. public void MergeFrom(pb::CodedInputStream input) {
  162. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  163. input.ReadRawMessage(this);
  164. #else
  165. uint tag;
  166. while ((tag = input.ReadTag()) != 0) {
  167. switch(tag) {
  168. default:
  169. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  170. break;
  171. }
  172. }
  173. #endif
  174. }
  175. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  176. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  177. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  178. uint tag;
  179. while ((tag = input.ReadTag()) != 0) {
  180. switch(tag) {
  181. default:
  182. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  183. break;
  184. }
  185. }
  186. }
  187. #endif
  188. #region Nested types
  189. /// <summary>Container for nested types declared in the Issue307 message type.</summary>
  190. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  191. public static partial class Types {
  192. public sealed partial class NestedOnce : pb::IMessage<NestedOnce>
  193. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  194. , pb::IBufferMessage
  195. #endif
  196. {
  197. private static readonly pb::MessageParser<NestedOnce> _parser = new pb::MessageParser<NestedOnce>(() => new NestedOnce());
  198. private pb::UnknownFieldSet _unknownFields;
  199. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  200. public static pb::MessageParser<NestedOnce> Parser { get { return _parser; } }
  201. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  202. public static pbr::MessageDescriptor Descriptor {
  203. get { return global::UnitTest.Issues.TestProtos.Issue307.Descriptor.NestedTypes[0]; }
  204. }
  205. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  206. pbr::MessageDescriptor pb::IMessage.Descriptor {
  207. get { return Descriptor; }
  208. }
  209. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  210. public NestedOnce() {
  211. OnConstruction();
  212. }
  213. partial void OnConstruction();
  214. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  215. public NestedOnce(NestedOnce other) : this() {
  216. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  217. }
  218. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  219. public NestedOnce Clone() {
  220. return new NestedOnce(this);
  221. }
  222. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  223. public override bool Equals(object other) {
  224. return Equals(other as NestedOnce);
  225. }
  226. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  227. public bool Equals(NestedOnce other) {
  228. if (ReferenceEquals(other, null)) {
  229. return false;
  230. }
  231. if (ReferenceEquals(other, this)) {
  232. return true;
  233. }
  234. return Equals(_unknownFields, other._unknownFields);
  235. }
  236. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  237. public override int GetHashCode() {
  238. int hash = 1;
  239. if (_unknownFields != null) {
  240. hash ^= _unknownFields.GetHashCode();
  241. }
  242. return hash;
  243. }
  244. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  245. public override string ToString() {
  246. return pb::JsonFormatter.ToDiagnosticString(this);
  247. }
  248. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  249. public void WriteTo(pb::CodedOutputStream output) {
  250. if (_unknownFields != null) {
  251. _unknownFields.WriteTo(output);
  252. }
  253. }
  254. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  255. public int CalculateSize() {
  256. int size = 0;
  257. if (_unknownFields != null) {
  258. size += _unknownFields.CalculateSize();
  259. }
  260. return size;
  261. }
  262. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  263. public void MergeFrom(NestedOnce other) {
  264. if (other == null) {
  265. return;
  266. }
  267. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  268. }
  269. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  270. public void MergeFrom(pb::CodedInputStream input) {
  271. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  272. input.ReadRawMessage(this);
  273. #else
  274. uint tag;
  275. while ((tag = input.ReadTag()) != 0) {
  276. switch(tag) {
  277. default:
  278. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  279. break;
  280. }
  281. }
  282. #endif
  283. }
  284. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  285. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  286. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  287. uint tag;
  288. while ((tag = input.ReadTag()) != 0) {
  289. switch(tag) {
  290. default:
  291. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  292. break;
  293. }
  294. }
  295. }
  296. #endif
  297. #region Nested types
  298. /// <summary>Container for nested types declared in the NestedOnce message type.</summary>
  299. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  300. public static partial class Types {
  301. public sealed partial class NestedTwice : pb::IMessage<NestedTwice>
  302. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  303. , pb::IBufferMessage
  304. #endif
  305. {
  306. private static readonly pb::MessageParser<NestedTwice> _parser = new pb::MessageParser<NestedTwice>(() => new NestedTwice());
  307. private pb::UnknownFieldSet _unknownFields;
  308. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  309. public static pb::MessageParser<NestedTwice> Parser { get { return _parser; } }
  310. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  311. public static pbr::MessageDescriptor Descriptor {
  312. get { return global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce.Descriptor.NestedTypes[0]; }
  313. }
  314. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  315. pbr::MessageDescriptor pb::IMessage.Descriptor {
  316. get { return Descriptor; }
  317. }
  318. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  319. public NestedTwice() {
  320. OnConstruction();
  321. }
  322. partial void OnConstruction();
  323. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  324. public NestedTwice(NestedTwice other) : this() {
  325. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  326. }
  327. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  328. public NestedTwice Clone() {
  329. return new NestedTwice(this);
  330. }
  331. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  332. public override bool Equals(object other) {
  333. return Equals(other as NestedTwice);
  334. }
  335. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  336. public bool Equals(NestedTwice other) {
  337. if (ReferenceEquals(other, null)) {
  338. return false;
  339. }
  340. if (ReferenceEquals(other, this)) {
  341. return true;
  342. }
  343. return Equals(_unknownFields, other._unknownFields);
  344. }
  345. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  346. public override int GetHashCode() {
  347. int hash = 1;
  348. if (_unknownFields != null) {
  349. hash ^= _unknownFields.GetHashCode();
  350. }
  351. return hash;
  352. }
  353. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  354. public override string ToString() {
  355. return pb::JsonFormatter.ToDiagnosticString(this);
  356. }
  357. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  358. public void WriteTo(pb::CodedOutputStream output) {
  359. if (_unknownFields != null) {
  360. _unknownFields.WriteTo(output);
  361. }
  362. }
  363. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  364. public int CalculateSize() {
  365. int size = 0;
  366. if (_unknownFields != null) {
  367. size += _unknownFields.CalculateSize();
  368. }
  369. return size;
  370. }
  371. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  372. public void MergeFrom(NestedTwice other) {
  373. if (other == null) {
  374. return;
  375. }
  376. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  377. }
  378. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  379. public void MergeFrom(pb::CodedInputStream input) {
  380. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  381. input.ReadRawMessage(this);
  382. #else
  383. uint tag;
  384. while ((tag = input.ReadTag()) != 0) {
  385. switch(tag) {
  386. default:
  387. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  388. break;
  389. }
  390. }
  391. #endif
  392. }
  393. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  394. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  395. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  396. uint tag;
  397. while ((tag = input.ReadTag()) != 0) {
  398. switch(tag) {
  399. default:
  400. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  401. break;
  402. }
  403. }
  404. }
  405. #endif
  406. }
  407. }
  408. #endregion
  409. }
  410. }
  411. #endregion
  412. }
  413. public sealed partial class NegativeEnumMessage : pb::IMessage<NegativeEnumMessage>
  414. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  415. , pb::IBufferMessage
  416. #endif
  417. {
  418. private static readonly pb::MessageParser<NegativeEnumMessage> _parser = new pb::MessageParser<NegativeEnumMessage>(() => new NegativeEnumMessage());
  419. private pb::UnknownFieldSet _unknownFields;
  420. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  421. public static pb::MessageParser<NegativeEnumMessage> Parser { get { return _parser; } }
  422. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  423. public static pbr::MessageDescriptor Descriptor {
  424. get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[1]; }
  425. }
  426. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  427. pbr::MessageDescriptor pb::IMessage.Descriptor {
  428. get { return Descriptor; }
  429. }
  430. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  431. public NegativeEnumMessage() {
  432. OnConstruction();
  433. }
  434. partial void OnConstruction();
  435. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  436. public NegativeEnumMessage(NegativeEnumMessage other) : this() {
  437. value_ = other.value_;
  438. values_ = other.values_.Clone();
  439. packedValues_ = other.packedValues_.Clone();
  440. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  441. }
  442. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  443. public NegativeEnumMessage Clone() {
  444. return new NegativeEnumMessage(this);
  445. }
  446. /// <summary>Field number for the "value" field.</summary>
  447. public const int ValueFieldNumber = 1;
  448. private global::UnitTest.Issues.TestProtos.NegativeEnum value_ = global::UnitTest.Issues.TestProtos.NegativeEnum.Zero;
  449. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  450. public global::UnitTest.Issues.TestProtos.NegativeEnum Value {
  451. get { return value_; }
  452. set {
  453. value_ = value;
  454. }
  455. }
  456. /// <summary>Field number for the "values" field.</summary>
  457. public const int ValuesFieldNumber = 2;
  458. private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.NegativeEnum> _repeated_values_codec
  459. = pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::UnitTest.Issues.TestProtos.NegativeEnum) x);
  460. private readonly pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum> values_ = new pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum>();
  461. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  462. public pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum> Values {
  463. get { return values_; }
  464. }
  465. /// <summary>Field number for the "packed_values" field.</summary>
  466. public const int PackedValuesFieldNumber = 3;
  467. private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.NegativeEnum> _repeated_packedValues_codec
  468. = pb::FieldCodec.ForEnum(26, x => (int) x, x => (global::UnitTest.Issues.TestProtos.NegativeEnum) x);
  469. private readonly pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum> packedValues_ = new pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum>();
  470. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  471. public pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum> PackedValues {
  472. get { return packedValues_; }
  473. }
  474. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  475. public override bool Equals(object other) {
  476. return Equals(other as NegativeEnumMessage);
  477. }
  478. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  479. public bool Equals(NegativeEnumMessage other) {
  480. if (ReferenceEquals(other, null)) {
  481. return false;
  482. }
  483. if (ReferenceEquals(other, this)) {
  484. return true;
  485. }
  486. if (Value != other.Value) return false;
  487. if(!values_.Equals(other.values_)) return false;
  488. if(!packedValues_.Equals(other.packedValues_)) return false;
  489. return Equals(_unknownFields, other._unknownFields);
  490. }
  491. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  492. public override int GetHashCode() {
  493. int hash = 1;
  494. if (Value != global::UnitTest.Issues.TestProtos.NegativeEnum.Zero) hash ^= Value.GetHashCode();
  495. hash ^= values_.GetHashCode();
  496. hash ^= packedValues_.GetHashCode();
  497. if (_unknownFields != null) {
  498. hash ^= _unknownFields.GetHashCode();
  499. }
  500. return hash;
  501. }
  502. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  503. public override string ToString() {
  504. return pb::JsonFormatter.ToDiagnosticString(this);
  505. }
  506. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  507. public void WriteTo(pb::CodedOutputStream output) {
  508. if (Value != global::UnitTest.Issues.TestProtos.NegativeEnum.Zero) {
  509. output.WriteRawTag(8);
  510. output.WriteEnum((int) Value);
  511. }
  512. values_.WriteTo(output, _repeated_values_codec);
  513. packedValues_.WriteTo(output, _repeated_packedValues_codec);
  514. if (_unknownFields != null) {
  515. _unknownFields.WriteTo(output);
  516. }
  517. }
  518. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  519. public int CalculateSize() {
  520. int size = 0;
  521. if (Value != global::UnitTest.Issues.TestProtos.NegativeEnum.Zero) {
  522. size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Value);
  523. }
  524. size += values_.CalculateSize(_repeated_values_codec);
  525. size += packedValues_.CalculateSize(_repeated_packedValues_codec);
  526. if (_unknownFields != null) {
  527. size += _unknownFields.CalculateSize();
  528. }
  529. return size;
  530. }
  531. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  532. public void MergeFrom(NegativeEnumMessage other) {
  533. if (other == null) {
  534. return;
  535. }
  536. if (other.Value != global::UnitTest.Issues.TestProtos.NegativeEnum.Zero) {
  537. Value = other.Value;
  538. }
  539. values_.Add(other.values_);
  540. packedValues_.Add(other.packedValues_);
  541. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  542. }
  543. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  544. public void MergeFrom(pb::CodedInputStream input) {
  545. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  546. input.ReadRawMessage(this);
  547. #else
  548. uint tag;
  549. while ((tag = input.ReadTag()) != 0) {
  550. switch(tag) {
  551. default:
  552. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  553. break;
  554. case 8: {
  555. Value = (global::UnitTest.Issues.TestProtos.NegativeEnum) input.ReadEnum();
  556. break;
  557. }
  558. case 18:
  559. case 16: {
  560. values_.AddEntriesFrom(input, _repeated_values_codec);
  561. break;
  562. }
  563. case 26:
  564. case 24: {
  565. packedValues_.AddEntriesFrom(input, _repeated_packedValues_codec);
  566. break;
  567. }
  568. }
  569. }
  570. #endif
  571. }
  572. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  573. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  574. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  575. uint tag;
  576. while ((tag = input.ReadTag()) != 0) {
  577. switch(tag) {
  578. default:
  579. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  580. break;
  581. case 8: {
  582. Value = (global::UnitTest.Issues.TestProtos.NegativeEnum) input.ReadEnum();
  583. break;
  584. }
  585. case 18:
  586. case 16: {
  587. values_.AddEntriesFrom(ref input, _repeated_values_codec);
  588. break;
  589. }
  590. case 26:
  591. case 24: {
  592. packedValues_.AddEntriesFrom(ref input, _repeated_packedValues_codec);
  593. break;
  594. }
  595. }
  596. }
  597. }
  598. #endif
  599. }
  600. public sealed partial class DeprecatedChild : pb::IMessage<DeprecatedChild>
  601. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  602. , pb::IBufferMessage
  603. #endif
  604. {
  605. private static readonly pb::MessageParser<DeprecatedChild> _parser = new pb::MessageParser<DeprecatedChild>(() => new DeprecatedChild());
  606. private pb::UnknownFieldSet _unknownFields;
  607. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  608. public static pb::MessageParser<DeprecatedChild> Parser { get { return _parser; } }
  609. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  610. public static pbr::MessageDescriptor Descriptor {
  611. get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[2]; }
  612. }
  613. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  614. pbr::MessageDescriptor pb::IMessage.Descriptor {
  615. get { return Descriptor; }
  616. }
  617. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  618. public DeprecatedChild() {
  619. OnConstruction();
  620. }
  621. partial void OnConstruction();
  622. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  623. public DeprecatedChild(DeprecatedChild other) : this() {
  624. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  625. }
  626. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  627. public DeprecatedChild Clone() {
  628. return new DeprecatedChild(this);
  629. }
  630. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  631. public override bool Equals(object other) {
  632. return Equals(other as DeprecatedChild);
  633. }
  634. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  635. public bool Equals(DeprecatedChild other) {
  636. if (ReferenceEquals(other, null)) {
  637. return false;
  638. }
  639. if (ReferenceEquals(other, this)) {
  640. return true;
  641. }
  642. return Equals(_unknownFields, other._unknownFields);
  643. }
  644. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  645. public override int GetHashCode() {
  646. int hash = 1;
  647. if (_unknownFields != null) {
  648. hash ^= _unknownFields.GetHashCode();
  649. }
  650. return hash;
  651. }
  652. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  653. public override string ToString() {
  654. return pb::JsonFormatter.ToDiagnosticString(this);
  655. }
  656. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  657. public void WriteTo(pb::CodedOutputStream output) {
  658. if (_unknownFields != null) {
  659. _unknownFields.WriteTo(output);
  660. }
  661. }
  662. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  663. public int CalculateSize() {
  664. int size = 0;
  665. if (_unknownFields != null) {
  666. size += _unknownFields.CalculateSize();
  667. }
  668. return size;
  669. }
  670. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  671. public void MergeFrom(DeprecatedChild other) {
  672. if (other == null) {
  673. return;
  674. }
  675. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  676. }
  677. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  678. public void MergeFrom(pb::CodedInputStream input) {
  679. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  680. input.ReadRawMessage(this);
  681. #else
  682. uint tag;
  683. while ((tag = input.ReadTag()) != 0) {
  684. switch(tag) {
  685. default:
  686. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  687. break;
  688. }
  689. }
  690. #endif
  691. }
  692. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  693. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  694. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  695. uint tag;
  696. while ((tag = input.ReadTag()) != 0) {
  697. switch(tag) {
  698. default:
  699. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  700. break;
  701. }
  702. }
  703. }
  704. #endif
  705. }
  706. public sealed partial class DeprecatedFieldsMessage : pb::IMessage<DeprecatedFieldsMessage>
  707. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  708. , pb::IBufferMessage
  709. #endif
  710. {
  711. private static readonly pb::MessageParser<DeprecatedFieldsMessage> _parser = new pb::MessageParser<DeprecatedFieldsMessage>(() => new DeprecatedFieldsMessage());
  712. private pb::UnknownFieldSet _unknownFields;
  713. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  714. public static pb::MessageParser<DeprecatedFieldsMessage> Parser { get { return _parser; } }
  715. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  716. public static pbr::MessageDescriptor Descriptor {
  717. get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[3]; }
  718. }
  719. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  720. pbr::MessageDescriptor pb::IMessage.Descriptor {
  721. get { return Descriptor; }
  722. }
  723. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  724. public DeprecatedFieldsMessage() {
  725. OnConstruction();
  726. }
  727. partial void OnConstruction();
  728. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  729. public DeprecatedFieldsMessage(DeprecatedFieldsMessage other) : this() {
  730. primitiveValue_ = other.primitiveValue_;
  731. primitiveArray_ = other.primitiveArray_.Clone();
  732. messageValue_ = other.messageValue_ != null ? other.messageValue_.Clone() : null;
  733. messageArray_ = other.messageArray_.Clone();
  734. enumValue_ = other.enumValue_;
  735. enumArray_ = other.enumArray_.Clone();
  736. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  737. }
  738. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  739. public DeprecatedFieldsMessage Clone() {
  740. return new DeprecatedFieldsMessage(this);
  741. }
  742. /// <summary>Field number for the "PrimitiveValue" field.</summary>
  743. public const int PrimitiveValueFieldNumber = 1;
  744. private int primitiveValue_;
  745. [global::System.ObsoleteAttribute]
  746. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  747. public int PrimitiveValue {
  748. get { return primitiveValue_; }
  749. set {
  750. primitiveValue_ = value;
  751. }
  752. }
  753. /// <summary>Field number for the "PrimitiveArray" field.</summary>
  754. public const int PrimitiveArrayFieldNumber = 2;
  755. private static readonly pb::FieldCodec<int> _repeated_primitiveArray_codec
  756. = pb::FieldCodec.ForInt32(18);
  757. private readonly pbc::RepeatedField<int> primitiveArray_ = new pbc::RepeatedField<int>();
  758. [global::System.ObsoleteAttribute]
  759. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  760. public pbc::RepeatedField<int> PrimitiveArray {
  761. get { return primitiveArray_; }
  762. }
  763. /// <summary>Field number for the "MessageValue" field.</summary>
  764. public const int MessageValueFieldNumber = 3;
  765. private global::UnitTest.Issues.TestProtos.DeprecatedChild messageValue_;
  766. [global::System.ObsoleteAttribute]
  767. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  768. public global::UnitTest.Issues.TestProtos.DeprecatedChild MessageValue {
  769. get { return messageValue_; }
  770. set {
  771. messageValue_ = value;
  772. }
  773. }
  774. /// <summary>Field number for the "MessageArray" field.</summary>
  775. public const int MessageArrayFieldNumber = 4;
  776. private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.DeprecatedChild> _repeated_messageArray_codec
  777. = pb::FieldCodec.ForMessage(34, global::UnitTest.Issues.TestProtos.DeprecatedChild.Parser);
  778. private readonly pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedChild> messageArray_ = new pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedChild>();
  779. [global::System.ObsoleteAttribute]
  780. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  781. public pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedChild> MessageArray {
  782. get { return messageArray_; }
  783. }
  784. /// <summary>Field number for the "EnumValue" field.</summary>
  785. public const int EnumValueFieldNumber = 5;
  786. private global::UnitTest.Issues.TestProtos.DeprecatedEnum enumValue_ = global::UnitTest.Issues.TestProtos.DeprecatedEnum.DeprecatedZero;
  787. [global::System.ObsoleteAttribute]
  788. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  789. public global::UnitTest.Issues.TestProtos.DeprecatedEnum EnumValue {
  790. get { return enumValue_; }
  791. set {
  792. enumValue_ = value;
  793. }
  794. }
  795. /// <summary>Field number for the "EnumArray" field.</summary>
  796. public const int EnumArrayFieldNumber = 6;
  797. private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.DeprecatedEnum> _repeated_enumArray_codec
  798. = pb::FieldCodec.ForEnum(50, x => (int) x, x => (global::UnitTest.Issues.TestProtos.DeprecatedEnum) x);
  799. private readonly pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedEnum> enumArray_ = new pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedEnum>();
  800. [global::System.ObsoleteAttribute]
  801. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  802. public pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedEnum> EnumArray {
  803. get { return enumArray_; }
  804. }
  805. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  806. public override bool Equals(object other) {
  807. return Equals(other as DeprecatedFieldsMessage);
  808. }
  809. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  810. public bool Equals(DeprecatedFieldsMessage other) {
  811. if (ReferenceEquals(other, null)) {
  812. return false;
  813. }
  814. if (ReferenceEquals(other, this)) {
  815. return true;
  816. }
  817. if (PrimitiveValue != other.PrimitiveValue) return false;
  818. if(!primitiveArray_.Equals(other.primitiveArray_)) return false;
  819. if (!object.Equals(MessageValue, other.MessageValue)) return false;
  820. if(!messageArray_.Equals(other.messageArray_)) return false;
  821. if (EnumValue != other.EnumValue) return false;
  822. if(!enumArray_.Equals(other.enumArray_)) return false;
  823. return Equals(_unknownFields, other._unknownFields);
  824. }
  825. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  826. public override int GetHashCode() {
  827. int hash = 1;
  828. if (PrimitiveValue != 0) hash ^= PrimitiveValue.GetHashCode();
  829. hash ^= primitiveArray_.GetHashCode();
  830. if (messageValue_ != null) hash ^= MessageValue.GetHashCode();
  831. hash ^= messageArray_.GetHashCode();
  832. if (EnumValue != global::UnitTest.Issues.TestProtos.DeprecatedEnum.DeprecatedZero) hash ^= EnumValue.GetHashCode();
  833. hash ^= enumArray_.GetHashCode();
  834. if (_unknownFields != null) {
  835. hash ^= _unknownFields.GetHashCode();
  836. }
  837. return hash;
  838. }
  839. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  840. public override string ToString() {
  841. return pb::JsonFormatter.ToDiagnosticString(this);
  842. }
  843. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  844. public void WriteTo(pb::CodedOutputStream output) {
  845. if (PrimitiveValue != 0) {
  846. output.WriteRawTag(8);
  847. output.WriteInt32(PrimitiveValue);
  848. }
  849. primitiveArray_.WriteTo(output, _repeated_primitiveArray_codec);
  850. if (messageValue_ != null) {
  851. output.WriteRawTag(26);
  852. output.WriteMessage(MessageValue);
  853. }
  854. messageArray_.WriteTo(output, _repeated_messageArray_codec);
  855. if (EnumValue != global::UnitTest.Issues.TestProtos.DeprecatedEnum.DeprecatedZero) {
  856. output.WriteRawTag(40);
  857. output.WriteEnum((int) EnumValue);
  858. }
  859. enumArray_.WriteTo(output, _repeated_enumArray_codec);
  860. if (_unknownFields != null) {
  861. _unknownFields.WriteTo(output);
  862. }
  863. }
  864. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  865. public int CalculateSize() {
  866. int size = 0;
  867. if (PrimitiveValue != 0) {
  868. size += 1 + pb::CodedOutputStream.ComputeInt32Size(PrimitiveValue);
  869. }
  870. size += primitiveArray_.CalculateSize(_repeated_primitiveArray_codec);
  871. if (messageValue_ != null) {
  872. size += 1 + pb::CodedOutputStream.ComputeMessageSize(MessageValue);
  873. }
  874. size += messageArray_.CalculateSize(_repeated_messageArray_codec);
  875. if (EnumValue != global::UnitTest.Issues.TestProtos.DeprecatedEnum.DeprecatedZero) {
  876. size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) EnumValue);
  877. }
  878. size += enumArray_.CalculateSize(_repeated_enumArray_codec);
  879. if (_unknownFields != null) {
  880. size += _unknownFields.CalculateSize();
  881. }
  882. return size;
  883. }
  884. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  885. public void MergeFrom(DeprecatedFieldsMessage other) {
  886. if (other == null) {
  887. return;
  888. }
  889. if (other.PrimitiveValue != 0) {
  890. PrimitiveValue = other.PrimitiveValue;
  891. }
  892. primitiveArray_.Add(other.primitiveArray_);
  893. if (other.messageValue_ != null) {
  894. if (messageValue_ == null) {
  895. MessageValue = new global::UnitTest.Issues.TestProtos.DeprecatedChild();
  896. }
  897. MessageValue.MergeFrom(other.MessageValue);
  898. }
  899. messageArray_.Add(other.messageArray_);
  900. if (other.EnumValue != global::UnitTest.Issues.TestProtos.DeprecatedEnum.DeprecatedZero) {
  901. EnumValue = other.EnumValue;
  902. }
  903. enumArray_.Add(other.enumArray_);
  904. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  905. }
  906. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  907. public void MergeFrom(pb::CodedInputStream input) {
  908. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  909. input.ReadRawMessage(this);
  910. #else
  911. uint tag;
  912. while ((tag = input.ReadTag()) != 0) {
  913. switch(tag) {
  914. default:
  915. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  916. break;
  917. case 8: {
  918. PrimitiveValue = input.ReadInt32();
  919. break;
  920. }
  921. case 18:
  922. case 16: {
  923. primitiveArray_.AddEntriesFrom(input, _repeated_primitiveArray_codec);
  924. break;
  925. }
  926. case 26: {
  927. if (messageValue_ == null) {
  928. MessageValue = new global::UnitTest.Issues.TestProtos.DeprecatedChild();
  929. }
  930. input.ReadMessage(MessageValue);
  931. break;
  932. }
  933. case 34: {
  934. messageArray_.AddEntriesFrom(input, _repeated_messageArray_codec);
  935. break;
  936. }
  937. case 40: {
  938. EnumValue = (global::UnitTest.Issues.TestProtos.DeprecatedEnum) input.ReadEnum();
  939. break;
  940. }
  941. case 50:
  942. case 48: {
  943. enumArray_.AddEntriesFrom(input, _repeated_enumArray_codec);
  944. break;
  945. }
  946. }
  947. }
  948. #endif
  949. }
  950. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  951. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  952. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  953. uint tag;
  954. while ((tag = input.ReadTag()) != 0) {
  955. switch(tag) {
  956. default:
  957. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  958. break;
  959. case 8: {
  960. PrimitiveValue = input.ReadInt32();
  961. break;
  962. }
  963. case 18:
  964. case 16: {
  965. primitiveArray_.AddEntriesFrom(ref input, _repeated_primitiveArray_codec);
  966. break;
  967. }
  968. case 26: {
  969. if (messageValue_ == null) {
  970. MessageValue = new global::UnitTest.Issues.TestProtos.DeprecatedChild();
  971. }
  972. input.ReadMessage(MessageValue);
  973. break;
  974. }
  975. case 34: {
  976. messageArray_.AddEntriesFrom(ref input, _repeated_messageArray_codec);
  977. break;
  978. }
  979. case 40: {
  980. EnumValue = (global::UnitTest.Issues.TestProtos.DeprecatedEnum) input.ReadEnum();
  981. break;
  982. }
  983. case 50:
  984. case 48: {
  985. enumArray_.AddEntriesFrom(ref input, _repeated_enumArray_codec);
  986. break;
  987. }
  988. }
  989. }
  990. }
  991. #endif
  992. }
  993. /// <summary>
  994. /// Issue 45: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=45
  995. /// </summary>
  996. public sealed partial class ItemField : pb::IMessage<ItemField>
  997. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  998. , pb::IBufferMessage
  999. #endif
  1000. {
  1001. private static readonly pb::MessageParser<ItemField> _parser = new pb::MessageParser<ItemField>(() => new ItemField());
  1002. private pb::UnknownFieldSet _unknownFields;
  1003. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1004. public static pb::MessageParser<ItemField> Parser { get { return _parser; } }
  1005. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1006. public static pbr::MessageDescriptor Descriptor {
  1007. get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[4]; }
  1008. }
  1009. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1010. pbr::MessageDescriptor pb::IMessage.Descriptor {
  1011. get { return Descriptor; }
  1012. }
  1013. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1014. public ItemField() {
  1015. OnConstruction();
  1016. }
  1017. partial void OnConstruction();
  1018. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1019. public ItemField(ItemField other) : this() {
  1020. item_ = other.item_;
  1021. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  1022. }
  1023. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1024. public ItemField Clone() {
  1025. return new ItemField(this);
  1026. }
  1027. /// <summary>Field number for the "item" field.</summary>
  1028. public const int ItemFieldNumber = 1;
  1029. private int item_;
  1030. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1031. public int Item {
  1032. get { return item_; }
  1033. set {
  1034. item_ = value;
  1035. }
  1036. }
  1037. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1038. public override bool Equals(object other) {
  1039. return Equals(other as ItemField);
  1040. }
  1041. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1042. public bool Equals(ItemField other) {
  1043. if (ReferenceEquals(other, null)) {
  1044. return false;
  1045. }
  1046. if (ReferenceEquals(other, this)) {
  1047. return true;
  1048. }
  1049. if (Item != other.Item) return false;
  1050. return Equals(_unknownFields, other._unknownFields);
  1051. }
  1052. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1053. public override int GetHashCode() {
  1054. int hash = 1;
  1055. if (Item != 0) hash ^= Item.GetHashCode();
  1056. if (_unknownFields != null) {
  1057. hash ^= _unknownFields.GetHashCode();
  1058. }
  1059. return hash;
  1060. }
  1061. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1062. public override string ToString() {
  1063. return pb::JsonFormatter.ToDiagnosticString(this);
  1064. }
  1065. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1066. public void WriteTo(pb::CodedOutputStream output) {
  1067. if (Item != 0) {
  1068. output.WriteRawTag(8);
  1069. output.WriteInt32(Item);
  1070. }
  1071. if (_unknownFields != null) {
  1072. _unknownFields.WriteTo(output);
  1073. }
  1074. }
  1075. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1076. public int CalculateSize() {
  1077. int size = 0;
  1078. if (Item != 0) {
  1079. size += 1 + pb::CodedOutputStream.ComputeInt32Size(Item);
  1080. }
  1081. if (_unknownFields != null) {
  1082. size += _unknownFields.CalculateSize();
  1083. }
  1084. return size;
  1085. }
  1086. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1087. public void MergeFrom(ItemField other) {
  1088. if (other == null) {
  1089. return;
  1090. }
  1091. if (other.Item != 0) {
  1092. Item = other.Item;
  1093. }
  1094. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  1095. }
  1096. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1097. public void MergeFrom(pb::CodedInputStream input) {
  1098. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1099. input.ReadRawMessage(this);
  1100. #else
  1101. uint tag;
  1102. while ((tag = input.ReadTag()) != 0) {
  1103. switch(tag) {
  1104. default:
  1105. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  1106. break;
  1107. case 8: {
  1108. Item = input.ReadInt32();
  1109. break;
  1110. }
  1111. }
  1112. }
  1113. #endif
  1114. }
  1115. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1116. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1117. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  1118. uint tag;
  1119. while ((tag = input.ReadTag()) != 0) {
  1120. switch(tag) {
  1121. default:
  1122. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  1123. break;
  1124. case 8: {
  1125. Item = input.ReadInt32();
  1126. break;
  1127. }
  1128. }
  1129. }
  1130. }
  1131. #endif
  1132. }
  1133. public sealed partial class ReservedNames : pb::IMessage<ReservedNames>
  1134. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1135. , pb::IBufferMessage
  1136. #endif
  1137. {
  1138. private static readonly pb::MessageParser<ReservedNames> _parser = new pb::MessageParser<ReservedNames>(() => new ReservedNames());
  1139. private pb::UnknownFieldSet _unknownFields;
  1140. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1141. public static pb::MessageParser<ReservedNames> Parser { get { return _parser; } }
  1142. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1143. public static pbr::MessageDescriptor Descriptor {
  1144. get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[5]; }
  1145. }
  1146. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1147. pbr::MessageDescriptor pb::IMessage.Descriptor {
  1148. get { return Descriptor; }
  1149. }
  1150. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1151. public ReservedNames() {
  1152. OnConstruction();
  1153. }
  1154. partial void OnConstruction();
  1155. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1156. public ReservedNames(ReservedNames other) : this() {
  1157. types_ = other.types_;
  1158. descriptor_ = other.descriptor_;
  1159. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  1160. }
  1161. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1162. public ReservedNames Clone() {
  1163. return new ReservedNames(this);
  1164. }
  1165. /// <summary>Field number for the "types" field.</summary>
  1166. public const int Types_FieldNumber = 1;
  1167. private int types_;
  1168. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1169. public int Types_ {
  1170. get { return types_; }
  1171. set {
  1172. types_ = value;
  1173. }
  1174. }
  1175. /// <summary>Field number for the "descriptor" field.</summary>
  1176. public const int Descriptor_FieldNumber = 2;
  1177. private int descriptor_;
  1178. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1179. public int Descriptor_ {
  1180. get { return descriptor_; }
  1181. set {
  1182. descriptor_ = value;
  1183. }
  1184. }
  1185. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1186. public override bool Equals(object other) {
  1187. return Equals(other as ReservedNames);
  1188. }
  1189. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1190. public bool Equals(ReservedNames other) {
  1191. if (ReferenceEquals(other, null)) {
  1192. return false;
  1193. }
  1194. if (ReferenceEquals(other, this)) {
  1195. return true;
  1196. }
  1197. if (Types_ != other.Types_) return false;
  1198. if (Descriptor_ != other.Descriptor_) return false;
  1199. return Equals(_unknownFields, other._unknownFields);
  1200. }
  1201. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1202. public override int GetHashCode() {
  1203. int hash = 1;
  1204. if (Types_ != 0) hash ^= Types_.GetHashCode();
  1205. if (Descriptor_ != 0) hash ^= Descriptor_.GetHashCode();
  1206. if (_unknownFields != null) {
  1207. hash ^= _unknownFields.GetHashCode();
  1208. }
  1209. return hash;
  1210. }
  1211. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1212. public override string ToString() {
  1213. return pb::JsonFormatter.ToDiagnosticString(this);
  1214. }
  1215. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1216. public void WriteTo(pb::CodedOutputStream output) {
  1217. if (Types_ != 0) {
  1218. output.WriteRawTag(8);
  1219. output.WriteInt32(Types_);
  1220. }
  1221. if (Descriptor_ != 0) {
  1222. output.WriteRawTag(16);
  1223. output.WriteInt32(Descriptor_);
  1224. }
  1225. if (_unknownFields != null) {
  1226. _unknownFields.WriteTo(output);
  1227. }
  1228. }
  1229. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1230. public int CalculateSize() {
  1231. int size = 0;
  1232. if (Types_ != 0) {
  1233. size += 1 + pb::CodedOutputStream.ComputeInt32Size(Types_);
  1234. }
  1235. if (Descriptor_ != 0) {
  1236. size += 1 + pb::CodedOutputStream.ComputeInt32Size(Descriptor_);
  1237. }
  1238. if (_unknownFields != null) {
  1239. size += _unknownFields.CalculateSize();
  1240. }
  1241. return size;
  1242. }
  1243. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1244. public void MergeFrom(ReservedNames other) {
  1245. if (other == null) {
  1246. return;
  1247. }
  1248. if (other.Types_ != 0) {
  1249. Types_ = other.Types_;
  1250. }
  1251. if (other.Descriptor_ != 0) {
  1252. Descriptor_ = other.Descriptor_;
  1253. }
  1254. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  1255. }
  1256. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1257. public void MergeFrom(pb::CodedInputStream input) {
  1258. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1259. input.ReadRawMessage(this);
  1260. #else
  1261. uint tag;
  1262. while ((tag = input.ReadTag()) != 0) {
  1263. switch(tag) {
  1264. default:
  1265. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  1266. break;
  1267. case 8: {
  1268. Types_ = input.ReadInt32();
  1269. break;
  1270. }
  1271. case 16: {
  1272. Descriptor_ = input.ReadInt32();
  1273. break;
  1274. }
  1275. }
  1276. }
  1277. #endif
  1278. }
  1279. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1280. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1281. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  1282. uint tag;
  1283. while ((tag = input.ReadTag()) != 0) {
  1284. switch(tag) {
  1285. default:
  1286. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  1287. break;
  1288. case 8: {
  1289. Types_ = input.ReadInt32();
  1290. break;
  1291. }
  1292. case 16: {
  1293. Descriptor_ = input.ReadInt32();
  1294. break;
  1295. }
  1296. }
  1297. }
  1298. }
  1299. #endif
  1300. #region Nested types
  1301. /// <summary>Container for nested types declared in the ReservedNames message type.</summary>
  1302. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1303. public static partial class Types {
  1304. /// <summary>
  1305. /// Force a nested type called Types
  1306. /// </summary>
  1307. public sealed partial class SomeNestedType : pb::IMessage<SomeNestedType>
  1308. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1309. , pb::IBufferMessage
  1310. #endif
  1311. {
  1312. private static readonly pb::MessageParser<SomeNestedType> _parser = new pb::MessageParser<SomeNestedType>(() => new SomeNestedType());
  1313. private pb::UnknownFieldSet _unknownFields;
  1314. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1315. public static pb::MessageParser<SomeNestedType> Parser { get { return _parser; } }
  1316. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1317. public static pbr::MessageDescriptor Descriptor {
  1318. get { return global::UnitTest.Issues.TestProtos.ReservedNames.Descriptor.NestedTypes[0]; }
  1319. }
  1320. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1321. pbr::MessageDescriptor pb::IMessage.Descriptor {
  1322. get { return Descriptor; }
  1323. }
  1324. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1325. public SomeNestedType() {
  1326. OnConstruction();
  1327. }
  1328. partial void OnConstruction();
  1329. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1330. public SomeNestedType(SomeNestedType other) : this() {
  1331. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  1332. }
  1333. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1334. public SomeNestedType Clone() {
  1335. return new SomeNestedType(this);
  1336. }
  1337. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1338. public override bool Equals(object other) {
  1339. return Equals(other as SomeNestedType);
  1340. }
  1341. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1342. public bool Equals(SomeNestedType other) {
  1343. if (ReferenceEquals(other, null)) {
  1344. return false;
  1345. }
  1346. if (ReferenceEquals(other, this)) {
  1347. return true;
  1348. }
  1349. return Equals(_unknownFields, other._unknownFields);
  1350. }
  1351. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1352. public override int GetHashCode() {
  1353. int hash = 1;
  1354. if (_unknownFields != null) {
  1355. hash ^= _unknownFields.GetHashCode();
  1356. }
  1357. return hash;
  1358. }
  1359. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1360. public override string ToString() {
  1361. return pb::JsonFormatter.ToDiagnosticString(this);
  1362. }
  1363. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1364. public void WriteTo(pb::CodedOutputStream output) {
  1365. if (_unknownFields != null) {
  1366. _unknownFields.WriteTo(output);
  1367. }
  1368. }
  1369. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1370. public int CalculateSize() {
  1371. int size = 0;
  1372. if (_unknownFields != null) {
  1373. size += _unknownFields.CalculateSize();
  1374. }
  1375. return size;
  1376. }
  1377. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1378. public void MergeFrom(SomeNestedType other) {
  1379. if (other == null) {
  1380. return;
  1381. }
  1382. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  1383. }
  1384. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1385. public void MergeFrom(pb::CodedInputStream input) {
  1386. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1387. input.ReadRawMessage(this);
  1388. #else
  1389. uint tag;
  1390. while ((tag = input.ReadTag()) != 0) {
  1391. switch(tag) {
  1392. default:
  1393. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  1394. break;
  1395. }
  1396. }
  1397. #endif
  1398. }
  1399. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1400. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1401. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  1402. uint tag;
  1403. while ((tag = input.ReadTag()) != 0) {
  1404. switch(tag) {
  1405. default:
  1406. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  1407. break;
  1408. }
  1409. }
  1410. }
  1411. #endif
  1412. }
  1413. }
  1414. #endregion
  1415. }
  1416. /// <summary>
  1417. /// These fields are deliberately not declared in numeric
  1418. /// order, and the oneof fields aren't contiguous either.
  1419. /// This allows for reasonably robust tests of JSON output
  1420. /// ordering.
  1421. /// TestFieldOrderings in unittest_proto3.proto is similar,
  1422. /// but doesn't include oneofs.
  1423. /// TODO: Consider adding oneofs to TestFieldOrderings, although
  1424. /// that will require fixing other tests in multiple platforms.
  1425. /// Alternatively, consider just adding this to
  1426. /// unittest_proto3.proto if multiple platforms want it.
  1427. /// </summary>
  1428. public sealed partial class TestJsonFieldOrdering : pb::IMessage<TestJsonFieldOrdering>
  1429. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1430. , pb::IBufferMessage
  1431. #endif
  1432. {
  1433. private static readonly pb::MessageParser<TestJsonFieldOrdering> _parser = new pb::MessageParser<TestJsonFieldOrdering>(() => new TestJsonFieldOrdering());
  1434. private pb::UnknownFieldSet _unknownFields;
  1435. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1436. public static pb::MessageParser<TestJsonFieldOrdering> Parser { get { return _parser; } }
  1437. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1438. public static pbr::MessageDescriptor Descriptor {
  1439. get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[6]; }
  1440. }
  1441. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1442. pbr::MessageDescriptor pb::IMessage.Descriptor {
  1443. get { return Descriptor; }
  1444. }
  1445. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1446. public TestJsonFieldOrdering() {
  1447. OnConstruction();
  1448. }
  1449. partial void OnConstruction();
  1450. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1451. public TestJsonFieldOrdering(TestJsonFieldOrdering other) : this() {
  1452. plainInt32_ = other.plainInt32_;
  1453. plainString_ = other.plainString_;
  1454. switch (other.O1Case) {
  1455. case O1OneofCase.O1String:
  1456. O1String = other.O1String;
  1457. break;
  1458. case O1OneofCase.O1Int32:
  1459. O1Int32 = other.O1Int32;
  1460. break;
  1461. }
  1462. switch (other.O2Case) {
  1463. case O2OneofCase.O2Int32:
  1464. O2Int32 = other.O2Int32;
  1465. break;
  1466. case O2OneofCase.O2String:
  1467. O2String = other.O2String;
  1468. break;
  1469. }
  1470. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  1471. }
  1472. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1473. public TestJsonFieldOrdering Clone() {
  1474. return new TestJsonFieldOrdering(this);
  1475. }
  1476. /// <summary>Field number for the "plain_int32" field.</summary>
  1477. public const int PlainInt32FieldNumber = 4;
  1478. private int plainInt32_;
  1479. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1480. public int PlainInt32 {
  1481. get { return plainInt32_; }
  1482. set {
  1483. plainInt32_ = value;
  1484. }
  1485. }
  1486. /// <summary>Field number for the "o1_string" field.</summary>
  1487. public const int O1StringFieldNumber = 2;
  1488. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1489. public string O1String {
  1490. get { return o1Case_ == O1OneofCase.O1String ? (string) o1_ : ""; }
  1491. set {
  1492. o1_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  1493. o1Case_ = O1OneofCase.O1String;
  1494. }
  1495. }
  1496. /// <summary>Field number for the "o1_int32" field.</summary>
  1497. public const int O1Int32FieldNumber = 5;
  1498. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1499. public int O1Int32 {
  1500. get { return o1Case_ == O1OneofCase.O1Int32 ? (int) o1_ : 0; }
  1501. set {
  1502. o1_ = value;
  1503. o1Case_ = O1OneofCase.O1Int32;
  1504. }
  1505. }
  1506. /// <summary>Field number for the "plain_string" field.</summary>
  1507. public const int PlainStringFieldNumber = 1;
  1508. private string plainString_ = "";
  1509. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1510. public string PlainString {
  1511. get { return plainString_; }
  1512. set {
  1513. plainString_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  1514. }
  1515. }
  1516. /// <summary>Field number for the "o2_int32" field.</summary>
  1517. public const int O2Int32FieldNumber = 6;
  1518. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1519. public int O2Int32 {
  1520. get { return o2Case_ == O2OneofCase.O2Int32 ? (int) o2_ : 0; }
  1521. set {
  1522. o2_ = value;
  1523. o2Case_ = O2OneofCase.O2Int32;
  1524. }
  1525. }
  1526. /// <summary>Field number for the "o2_string" field.</summary>
  1527. public const int O2StringFieldNumber = 3;
  1528. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1529. public string O2String {
  1530. get { return o2Case_ == O2OneofCase.O2String ? (string) o2_ : ""; }
  1531. set {
  1532. o2_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  1533. o2Case_ = O2OneofCase.O2String;
  1534. }
  1535. }
  1536. private object o1_;
  1537. /// <summary>Enum of possible cases for the "o1" oneof.</summary>
  1538. public enum O1OneofCase {
  1539. None = 0,
  1540. O1String = 2,
  1541. O1Int32 = 5,
  1542. }
  1543. private O1OneofCase o1Case_ = O1OneofCase.None;
  1544. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1545. public O1OneofCase O1Case {
  1546. get { return o1Case_; }
  1547. }
  1548. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1549. public void ClearO1() {
  1550. o1Case_ = O1OneofCase.None;
  1551. o1_ = null;
  1552. }
  1553. private object o2_;
  1554. /// <summary>Enum of possible cases for the "o2" oneof.</summary>
  1555. public enum O2OneofCase {
  1556. None = 0,
  1557. O2Int32 = 6,
  1558. O2String = 3,
  1559. }
  1560. private O2OneofCase o2Case_ = O2OneofCase.None;
  1561. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1562. public O2OneofCase O2Case {
  1563. get { return o2Case_; }
  1564. }
  1565. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1566. public void ClearO2() {
  1567. o2Case_ = O2OneofCase.None;
  1568. o2_ = null;
  1569. }
  1570. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1571. public override bool Equals(object other) {
  1572. return Equals(other as TestJsonFieldOrdering);
  1573. }
  1574. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1575. public bool Equals(TestJsonFieldOrdering other) {
  1576. if (ReferenceEquals(other, null)) {
  1577. return false;
  1578. }
  1579. if (ReferenceEquals(other, this)) {
  1580. return true;
  1581. }
  1582. if (PlainInt32 != other.PlainInt32) return false;
  1583. if (O1String != other.O1String) return false;
  1584. if (O1Int32 != other.O1Int32) return false;
  1585. if (PlainString != other.PlainString) return false;
  1586. if (O2Int32 != other.O2Int32) return false;
  1587. if (O2String != other.O2String) return false;
  1588. if (O1Case != other.O1Case) return false;
  1589. if (O2Case != other.O2Case) return false;
  1590. return Equals(_unknownFields, other._unknownFields);
  1591. }
  1592. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1593. public override int GetHashCode() {
  1594. int hash = 1;
  1595. if (PlainInt32 != 0) hash ^= PlainInt32.GetHashCode();
  1596. if (o1Case_ == O1OneofCase.O1String) hash ^= O1String.GetHashCode();
  1597. if (o1Case_ == O1OneofCase.O1Int32) hash ^= O1Int32.GetHashCode();
  1598. if (PlainString.Length != 0) hash ^= PlainString.GetHashCode();
  1599. if (o2Case_ == O2OneofCase.O2Int32) hash ^= O2Int32.GetHashCode();
  1600. if (o2Case_ == O2OneofCase.O2String) hash ^= O2String.GetHashCode();
  1601. hash ^= (int) o1Case_;
  1602. hash ^= (int) o2Case_;
  1603. if (_unknownFields != null) {
  1604. hash ^= _unknownFields.GetHashCode();
  1605. }
  1606. return hash;
  1607. }
  1608. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1609. public override string ToString() {
  1610. return pb::JsonFormatter.ToDiagnosticString(this);
  1611. }
  1612. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1613. public void WriteTo(pb::CodedOutputStream output) {
  1614. if (PlainString.Length != 0) {
  1615. output.WriteRawTag(10);
  1616. output.WriteString(PlainString);
  1617. }
  1618. if (o1Case_ == O1OneofCase.O1String) {
  1619. output.WriteRawTag(18);
  1620. output.WriteString(O1String);
  1621. }
  1622. if (o2Case_ == O2OneofCase.O2String) {
  1623. output.WriteRawTag(26);
  1624. output.WriteString(O2String);
  1625. }
  1626. if (PlainInt32 != 0) {
  1627. output.WriteRawTag(32);
  1628. output.WriteInt32(PlainInt32);
  1629. }
  1630. if (o1Case_ == O1OneofCase.O1Int32) {
  1631. output.WriteRawTag(40);
  1632. output.WriteInt32(O1Int32);
  1633. }
  1634. if (o2Case_ == O2OneofCase.O2Int32) {
  1635. output.WriteRawTag(48);
  1636. output.WriteInt32(O2Int32);
  1637. }
  1638. if (_unknownFields != null) {
  1639. _unknownFields.WriteTo(output);
  1640. }
  1641. }
  1642. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1643. public int CalculateSize() {
  1644. int size = 0;
  1645. if (PlainInt32 != 0) {
  1646. size += 1 + pb::CodedOutputStream.ComputeInt32Size(PlainInt32);
  1647. }
  1648. if (o1Case_ == O1OneofCase.O1String) {
  1649. size += 1 + pb::CodedOutputStream.ComputeStringSize(O1String);
  1650. }
  1651. if (o1Case_ == O1OneofCase.O1Int32) {
  1652. size += 1 + pb::CodedOutputStream.ComputeInt32Size(O1Int32);
  1653. }
  1654. if (PlainString.Length != 0) {
  1655. size += 1 + pb::CodedOutputStream.ComputeStringSize(PlainString);
  1656. }
  1657. if (o2Case_ == O2OneofCase.O2Int32) {
  1658. size += 1 + pb::CodedOutputStream.ComputeInt32Size(O2Int32);
  1659. }
  1660. if (o2Case_ == O2OneofCase.O2String) {
  1661. size += 1 + pb::CodedOutputStream.ComputeStringSize(O2String);
  1662. }
  1663. if (_unknownFields != null) {
  1664. size += _unknownFields.CalculateSize();
  1665. }
  1666. return size;
  1667. }
  1668. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1669. public void MergeFrom(TestJsonFieldOrdering other) {
  1670. if (other == null) {
  1671. return;
  1672. }
  1673. if (other.PlainInt32 != 0) {
  1674. PlainInt32 = other.PlainInt32;
  1675. }
  1676. if (other.PlainString.Length != 0) {
  1677. PlainString = other.PlainString;
  1678. }
  1679. switch (other.O1Case) {
  1680. case O1OneofCase.O1String:
  1681. O1String = other.O1String;
  1682. break;
  1683. case O1OneofCase.O1Int32:
  1684. O1Int32 = other.O1Int32;
  1685. break;
  1686. }
  1687. switch (other.O2Case) {
  1688. case O2OneofCase.O2Int32:
  1689. O2Int32 = other.O2Int32;
  1690. break;
  1691. case O2OneofCase.O2String:
  1692. O2String = other.O2String;
  1693. break;
  1694. }
  1695. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  1696. }
  1697. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1698. public void MergeFrom(pb::CodedInputStream input) {
  1699. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1700. input.ReadRawMessage(this);
  1701. #else
  1702. uint tag;
  1703. while ((tag = input.ReadTag()) != 0) {
  1704. switch(tag) {
  1705. default:
  1706. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  1707. break;
  1708. case 10: {
  1709. PlainString = input.ReadString();
  1710. break;
  1711. }
  1712. case 18: {
  1713. O1String = input.ReadString();
  1714. break;
  1715. }
  1716. case 26: {
  1717. O2String = input.ReadString();
  1718. break;
  1719. }
  1720. case 32: {
  1721. PlainInt32 = input.ReadInt32();
  1722. break;
  1723. }
  1724. case 40: {
  1725. O1Int32 = input.ReadInt32();
  1726. break;
  1727. }
  1728. case 48: {
  1729. O2Int32 = input.ReadInt32();
  1730. break;
  1731. }
  1732. }
  1733. }
  1734. #endif
  1735. }
  1736. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1737. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1738. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  1739. uint tag;
  1740. while ((tag = input.ReadTag()) != 0) {
  1741. switch(tag) {
  1742. default:
  1743. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  1744. break;
  1745. case 10: {
  1746. PlainString = input.ReadString();
  1747. break;
  1748. }
  1749. case 18: {
  1750. O1String = input.ReadString();
  1751. break;
  1752. }
  1753. case 26: {
  1754. O2String = input.ReadString();
  1755. break;
  1756. }
  1757. case 32: {
  1758. PlainInt32 = input.ReadInt32();
  1759. break;
  1760. }
  1761. case 40: {
  1762. O1Int32 = input.ReadInt32();
  1763. break;
  1764. }
  1765. case 48: {
  1766. O2Int32 = input.ReadInt32();
  1767. break;
  1768. }
  1769. }
  1770. }
  1771. }
  1772. #endif
  1773. }
  1774. public sealed partial class TestJsonName : pb::IMessage<TestJsonName>
  1775. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1776. , pb::IBufferMessage
  1777. #endif
  1778. {
  1779. private static readonly pb::MessageParser<TestJsonName> _parser = new pb::MessageParser<TestJsonName>(() => new TestJsonName());
  1780. private pb::UnknownFieldSet _unknownFields;
  1781. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1782. public static pb::MessageParser<TestJsonName> Parser { get { return _parser; } }
  1783. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1784. public static pbr::MessageDescriptor Descriptor {
  1785. get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[7]; }
  1786. }
  1787. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1788. pbr::MessageDescriptor pb::IMessage.Descriptor {
  1789. get { return Descriptor; }
  1790. }
  1791. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1792. public TestJsonName() {
  1793. OnConstruction();
  1794. }
  1795. partial void OnConstruction();
  1796. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1797. public TestJsonName(TestJsonName other) : this() {
  1798. name_ = other.name_;
  1799. description_ = other.description_;
  1800. guid_ = other.guid_;
  1801. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  1802. }
  1803. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1804. public TestJsonName Clone() {
  1805. return new TestJsonName(this);
  1806. }
  1807. /// <summary>Field number for the "name" field.</summary>
  1808. public const int NameFieldNumber = 1;
  1809. private string name_ = "";
  1810. /// <summary>
  1811. /// Message for testing the effects for of the json_name option
  1812. /// </summary>
  1813. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1814. public string Name {
  1815. get { return name_; }
  1816. set {
  1817. name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  1818. }
  1819. }
  1820. /// <summary>Field number for the "description" field.</summary>
  1821. public const int DescriptionFieldNumber = 2;
  1822. private string description_ = "";
  1823. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1824. public string Description {
  1825. get { return description_; }
  1826. set {
  1827. description_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  1828. }
  1829. }
  1830. /// <summary>Field number for the "guid" field.</summary>
  1831. public const int GuidFieldNumber = 3;
  1832. private string guid_ = "";
  1833. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1834. public string Guid {
  1835. get { return guid_; }
  1836. set {
  1837. guid_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  1838. }
  1839. }
  1840. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1841. public override bool Equals(object other) {
  1842. return Equals(other as TestJsonName);
  1843. }
  1844. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1845. public bool Equals(TestJsonName other) {
  1846. if (ReferenceEquals(other, null)) {
  1847. return false;
  1848. }
  1849. if (ReferenceEquals(other, this)) {
  1850. return true;
  1851. }
  1852. if (Name != other.Name) return false;
  1853. if (Description != other.Description) return false;
  1854. if (Guid != other.Guid) return false;
  1855. return Equals(_unknownFields, other._unknownFields);
  1856. }
  1857. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1858. public override int GetHashCode() {
  1859. int hash = 1;
  1860. if (Name.Length != 0) hash ^= Name.GetHashCode();
  1861. if (Description.Length != 0) hash ^= Description.GetHashCode();
  1862. if (Guid.Length != 0) hash ^= Guid.GetHashCode();
  1863. if (_unknownFields != null) {
  1864. hash ^= _unknownFields.GetHashCode();
  1865. }
  1866. return hash;
  1867. }
  1868. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1869. public override string ToString() {
  1870. return pb::JsonFormatter.ToDiagnosticString(this);
  1871. }
  1872. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1873. public void WriteTo(pb::CodedOutputStream output) {
  1874. if (Name.Length != 0) {
  1875. output.WriteRawTag(10);
  1876. output.WriteString(Name);
  1877. }
  1878. if (Description.Length != 0) {
  1879. output.WriteRawTag(18);
  1880. output.WriteString(Description);
  1881. }
  1882. if (Guid.Length != 0) {
  1883. output.WriteRawTag(26);
  1884. output.WriteString(Guid);
  1885. }
  1886. if (_unknownFields != null) {
  1887. _unknownFields.WriteTo(output);
  1888. }
  1889. }
  1890. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1891. public int CalculateSize() {
  1892. int size = 0;
  1893. if (Name.Length != 0) {
  1894. size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
  1895. }
  1896. if (Description.Length != 0) {
  1897. size += 1 + pb::CodedOutputStream.ComputeStringSize(Description);
  1898. }
  1899. if (Guid.Length != 0) {
  1900. size += 1 + pb::CodedOutputStream.ComputeStringSize(Guid);
  1901. }
  1902. if (_unknownFields != null) {
  1903. size += _unknownFields.CalculateSize();
  1904. }
  1905. return size;
  1906. }
  1907. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1908. public void MergeFrom(TestJsonName other) {
  1909. if (other == null) {
  1910. return;
  1911. }
  1912. if (other.Name.Length != 0) {
  1913. Name = other.Name;
  1914. }
  1915. if (other.Description.Length != 0) {
  1916. Description = other.Description;
  1917. }
  1918. if (other.Guid.Length != 0) {
  1919. Guid = other.Guid;
  1920. }
  1921. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  1922. }
  1923. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1924. public void MergeFrom(pb::CodedInputStream input) {
  1925. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1926. input.ReadRawMessage(this);
  1927. #else
  1928. uint tag;
  1929. while ((tag = input.ReadTag()) != 0) {
  1930. switch(tag) {
  1931. default:
  1932. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  1933. break;
  1934. case 10: {
  1935. Name = input.ReadString();
  1936. break;
  1937. }
  1938. case 18: {
  1939. Description = input.ReadString();
  1940. break;
  1941. }
  1942. case 26: {
  1943. Guid = input.ReadString();
  1944. break;
  1945. }
  1946. }
  1947. }
  1948. #endif
  1949. }
  1950. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1951. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1952. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  1953. uint tag;
  1954. while ((tag = input.ReadTag()) != 0) {
  1955. switch(tag) {
  1956. default:
  1957. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  1958. break;
  1959. case 10: {
  1960. Name = input.ReadString();
  1961. break;
  1962. }
  1963. case 18: {
  1964. Description = input.ReadString();
  1965. break;
  1966. }
  1967. case 26: {
  1968. Guid = input.ReadString();
  1969. break;
  1970. }
  1971. }
  1972. }
  1973. }
  1974. #endif
  1975. }
  1976. /// <summary>
  1977. /// Issue 3200: When merging two messages which use the same
  1978. /// oneof case, which is itself a message type, the submessages should
  1979. /// be merged.
  1980. /// </summary>
  1981. public sealed partial class OneofMerging : pb::IMessage<OneofMerging>
  1982. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1983. , pb::IBufferMessage
  1984. #endif
  1985. {
  1986. private static readonly pb::MessageParser<OneofMerging> _parser = new pb::MessageParser<OneofMerging>(() => new OneofMerging());
  1987. private pb::UnknownFieldSet _unknownFields;
  1988. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1989. public static pb::MessageParser<OneofMerging> Parser { get { return _parser; } }
  1990. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1991. public static pbr::MessageDescriptor Descriptor {
  1992. get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[8]; }
  1993. }
  1994. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1995. pbr::MessageDescriptor pb::IMessage.Descriptor {
  1996. get { return Descriptor; }
  1997. }
  1998. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1999. public OneofMerging() {
  2000. OnConstruction();
  2001. }
  2002. partial void OnConstruction();
  2003. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2004. public OneofMerging(OneofMerging other) : this() {
  2005. switch (other.ValueCase) {
  2006. case ValueOneofCase.Text:
  2007. Text = other.Text;
  2008. break;
  2009. case ValueOneofCase.Nested:
  2010. Nested = other.Nested.Clone();
  2011. break;
  2012. }
  2013. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  2014. }
  2015. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2016. public OneofMerging Clone() {
  2017. return new OneofMerging(this);
  2018. }
  2019. /// <summary>Field number for the "text" field.</summary>
  2020. public const int TextFieldNumber = 1;
  2021. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2022. public string Text {
  2023. get { return valueCase_ == ValueOneofCase.Text ? (string) value_ : ""; }
  2024. set {
  2025. value_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  2026. valueCase_ = ValueOneofCase.Text;
  2027. }
  2028. }
  2029. /// <summary>Field number for the "nested" field.</summary>
  2030. public const int NestedFieldNumber = 2;
  2031. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2032. public global::UnitTest.Issues.TestProtos.OneofMerging.Types.Nested Nested {
  2033. get { return valueCase_ == ValueOneofCase.Nested ? (global::UnitTest.Issues.TestProtos.OneofMerging.Types.Nested) value_ : null; }
  2034. set {
  2035. value_ = value;
  2036. valueCase_ = value == null ? ValueOneofCase.None : ValueOneofCase.Nested;
  2037. }
  2038. }
  2039. private object value_;
  2040. /// <summary>Enum of possible cases for the "value" oneof.</summary>
  2041. public enum ValueOneofCase {
  2042. None = 0,
  2043. Text = 1,
  2044. Nested = 2,
  2045. }
  2046. private ValueOneofCase valueCase_ = ValueOneofCase.None;
  2047. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2048. public ValueOneofCase ValueCase {
  2049. get { return valueCase_; }
  2050. }
  2051. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2052. public void ClearValue() {
  2053. valueCase_ = ValueOneofCase.None;
  2054. value_ = null;
  2055. }
  2056. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2057. public override bool Equals(object other) {
  2058. return Equals(other as OneofMerging);
  2059. }
  2060. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2061. public bool Equals(OneofMerging other) {
  2062. if (ReferenceEquals(other, null)) {
  2063. return false;
  2064. }
  2065. if (ReferenceEquals(other, this)) {
  2066. return true;
  2067. }
  2068. if (Text != other.Text) return false;
  2069. if (!object.Equals(Nested, other.Nested)) return false;
  2070. if (ValueCase != other.ValueCase) return false;
  2071. return Equals(_unknownFields, other._unknownFields);
  2072. }
  2073. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2074. public override int GetHashCode() {
  2075. int hash = 1;
  2076. if (valueCase_ == ValueOneofCase.Text) hash ^= Text.GetHashCode();
  2077. if (valueCase_ == ValueOneofCase.Nested) hash ^= Nested.GetHashCode();
  2078. hash ^= (int) valueCase_;
  2079. if (_unknownFields != null) {
  2080. hash ^= _unknownFields.GetHashCode();
  2081. }
  2082. return hash;
  2083. }
  2084. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2085. public override string ToString() {
  2086. return pb::JsonFormatter.ToDiagnosticString(this);
  2087. }
  2088. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2089. public void WriteTo(pb::CodedOutputStream output) {
  2090. if (valueCase_ == ValueOneofCase.Text) {
  2091. output.WriteRawTag(10);
  2092. output.WriteString(Text);
  2093. }
  2094. if (valueCase_ == ValueOneofCase.Nested) {
  2095. output.WriteRawTag(18);
  2096. output.WriteMessage(Nested);
  2097. }
  2098. if (_unknownFields != null) {
  2099. _unknownFields.WriteTo(output);
  2100. }
  2101. }
  2102. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2103. public int CalculateSize() {
  2104. int size = 0;
  2105. if (valueCase_ == ValueOneofCase.Text) {
  2106. size += 1 + pb::CodedOutputStream.ComputeStringSize(Text);
  2107. }
  2108. if (valueCase_ == ValueOneofCase.Nested) {
  2109. size += 1 + pb::CodedOutputStream.ComputeMessageSize(Nested);
  2110. }
  2111. if (_unknownFields != null) {
  2112. size += _unknownFields.CalculateSize();
  2113. }
  2114. return size;
  2115. }
  2116. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2117. public void MergeFrom(OneofMerging other) {
  2118. if (other == null) {
  2119. return;
  2120. }
  2121. switch (other.ValueCase) {
  2122. case ValueOneofCase.Text:
  2123. Text = other.Text;
  2124. break;
  2125. case ValueOneofCase.Nested:
  2126. if (Nested == null) {
  2127. Nested = new global::UnitTest.Issues.TestProtos.OneofMerging.Types.Nested();
  2128. }
  2129. Nested.MergeFrom(other.Nested);
  2130. break;
  2131. }
  2132. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  2133. }
  2134. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2135. public void MergeFrom(pb::CodedInputStream input) {
  2136. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  2137. input.ReadRawMessage(this);
  2138. #else
  2139. uint tag;
  2140. while ((tag = input.ReadTag()) != 0) {
  2141. switch(tag) {
  2142. default:
  2143. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  2144. break;
  2145. case 10: {
  2146. Text = input.ReadString();
  2147. break;
  2148. }
  2149. case 18: {
  2150. global::UnitTest.Issues.TestProtos.OneofMerging.Types.Nested subBuilder = new global::UnitTest.Issues.TestProtos.OneofMerging.Types.Nested();
  2151. if (valueCase_ == ValueOneofCase.Nested) {
  2152. subBuilder.MergeFrom(Nested);
  2153. }
  2154. input.ReadMessage(subBuilder);
  2155. Nested = subBuilder;
  2156. break;
  2157. }
  2158. }
  2159. }
  2160. #endif
  2161. }
  2162. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  2163. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2164. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  2165. uint tag;
  2166. while ((tag = input.ReadTag()) != 0) {
  2167. switch(tag) {
  2168. default:
  2169. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  2170. break;
  2171. case 10: {
  2172. Text = input.ReadString();
  2173. break;
  2174. }
  2175. case 18: {
  2176. global::UnitTest.Issues.TestProtos.OneofMerging.Types.Nested subBuilder = new global::UnitTest.Issues.TestProtos.OneofMerging.Types.Nested();
  2177. if (valueCase_ == ValueOneofCase.Nested) {
  2178. subBuilder.MergeFrom(Nested);
  2179. }
  2180. input.ReadMessage(subBuilder);
  2181. Nested = subBuilder;
  2182. break;
  2183. }
  2184. }
  2185. }
  2186. }
  2187. #endif
  2188. #region Nested types
  2189. /// <summary>Container for nested types declared in the OneofMerging message type.</summary>
  2190. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2191. public static partial class Types {
  2192. public sealed partial class Nested : pb::IMessage<Nested>
  2193. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  2194. , pb::IBufferMessage
  2195. #endif
  2196. {
  2197. private static readonly pb::MessageParser<Nested> _parser = new pb::MessageParser<Nested>(() => new Nested());
  2198. private pb::UnknownFieldSet _unknownFields;
  2199. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2200. public static pb::MessageParser<Nested> Parser { get { return _parser; } }
  2201. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2202. public static pbr::MessageDescriptor Descriptor {
  2203. get { return global::UnitTest.Issues.TestProtos.OneofMerging.Descriptor.NestedTypes[0]; }
  2204. }
  2205. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2206. pbr::MessageDescriptor pb::IMessage.Descriptor {
  2207. get { return Descriptor; }
  2208. }
  2209. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2210. public Nested() {
  2211. OnConstruction();
  2212. }
  2213. partial void OnConstruction();
  2214. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2215. public Nested(Nested other) : this() {
  2216. x_ = other.x_;
  2217. y_ = other.y_;
  2218. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  2219. }
  2220. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2221. public Nested Clone() {
  2222. return new Nested(this);
  2223. }
  2224. /// <summary>Field number for the "x" field.</summary>
  2225. public const int XFieldNumber = 1;
  2226. private int x_;
  2227. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2228. public int X {
  2229. get { return x_; }
  2230. set {
  2231. x_ = value;
  2232. }
  2233. }
  2234. /// <summary>Field number for the "y" field.</summary>
  2235. public const int YFieldNumber = 2;
  2236. private int y_;
  2237. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2238. public int Y {
  2239. get { return y_; }
  2240. set {
  2241. y_ = value;
  2242. }
  2243. }
  2244. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2245. public override bool Equals(object other) {
  2246. return Equals(other as Nested);
  2247. }
  2248. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2249. public bool Equals(Nested other) {
  2250. if (ReferenceEquals(other, null)) {
  2251. return false;
  2252. }
  2253. if (ReferenceEquals(other, this)) {
  2254. return true;
  2255. }
  2256. if (X != other.X) return false;
  2257. if (Y != other.Y) return false;
  2258. return Equals(_unknownFields, other._unknownFields);
  2259. }
  2260. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2261. public override int GetHashCode() {
  2262. int hash = 1;
  2263. if (X != 0) hash ^= X.GetHashCode();
  2264. if (Y != 0) hash ^= Y.GetHashCode();
  2265. if (_unknownFields != null) {
  2266. hash ^= _unknownFields.GetHashCode();
  2267. }
  2268. return hash;
  2269. }
  2270. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2271. public override string ToString() {
  2272. return pb::JsonFormatter.ToDiagnosticString(this);
  2273. }
  2274. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2275. public void WriteTo(pb::CodedOutputStream output) {
  2276. if (X != 0) {
  2277. output.WriteRawTag(8);
  2278. output.WriteInt32(X);
  2279. }
  2280. if (Y != 0) {
  2281. output.WriteRawTag(16);
  2282. output.WriteInt32(Y);
  2283. }
  2284. if (_unknownFields != null) {
  2285. _unknownFields.WriteTo(output);
  2286. }
  2287. }
  2288. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2289. public int CalculateSize() {
  2290. int size = 0;
  2291. if (X != 0) {
  2292. size += 1 + pb::CodedOutputStream.ComputeInt32Size(X);
  2293. }
  2294. if (Y != 0) {
  2295. size += 1 + pb::CodedOutputStream.ComputeInt32Size(Y);
  2296. }
  2297. if (_unknownFields != null) {
  2298. size += _unknownFields.CalculateSize();
  2299. }
  2300. return size;
  2301. }
  2302. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2303. public void MergeFrom(Nested other) {
  2304. if (other == null) {
  2305. return;
  2306. }
  2307. if (other.X != 0) {
  2308. X = other.X;
  2309. }
  2310. if (other.Y != 0) {
  2311. Y = other.Y;
  2312. }
  2313. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  2314. }
  2315. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2316. public void MergeFrom(pb::CodedInputStream input) {
  2317. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  2318. input.ReadRawMessage(this);
  2319. #else
  2320. uint tag;
  2321. while ((tag = input.ReadTag()) != 0) {
  2322. switch(tag) {
  2323. default:
  2324. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  2325. break;
  2326. case 8: {
  2327. X = input.ReadInt32();
  2328. break;
  2329. }
  2330. case 16: {
  2331. Y = input.ReadInt32();
  2332. break;
  2333. }
  2334. }
  2335. }
  2336. #endif
  2337. }
  2338. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  2339. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2340. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  2341. uint tag;
  2342. while ((tag = input.ReadTag()) != 0) {
  2343. switch(tag) {
  2344. default:
  2345. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  2346. break;
  2347. case 8: {
  2348. X = input.ReadInt32();
  2349. break;
  2350. }
  2351. case 16: {
  2352. Y = input.ReadInt32();
  2353. break;
  2354. }
  2355. }
  2356. }
  2357. }
  2358. #endif
  2359. }
  2360. }
  2361. #endregion
  2362. }
  2363. #endregion
  2364. }
  2365. #endregion Designer generated code