UnittestIssues.cs 113 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311
  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. "ChV1bml0dGVzdF9pc3N1ZXMucHJvdG8SD3VuaXR0ZXN0X2lzc3VlcxocZ29v",
  24. "Z2xlL3Byb3RvYnVmL3N0cnVjdC5wcm90byInCghJc3N1ZTMwNxobCgpOZXN0",
  25. "ZWRPbmNlGg0KC05lc3RlZFR3aWNlIrABChNOZWdhdGl2ZUVudW1NZXNzYWdl",
  26. "EiwKBXZhbHVlGAEgASgOMh0udW5pdHRlc3RfaXNzdWVzLk5lZ2F0aXZlRW51",
  27. "bRIxCgZ2YWx1ZXMYAiADKA4yHS51bml0dGVzdF9pc3N1ZXMuTmVnYXRpdmVF",
  28. "bnVtQgIQABI4Cg1wYWNrZWRfdmFsdWVzGAMgAygOMh0udW5pdHRlc3RfaXNz",
  29. "dWVzLk5lZ2F0aXZlRW51bUICEAEiEQoPRGVwcmVjYXRlZENoaWxkIrkCChdE",
  30. "ZXByZWNhdGVkRmllbGRzTWVzc2FnZRIaCg5QcmltaXRpdmVWYWx1ZRgBIAEo",
  31. "BUICGAESGgoOUHJpbWl0aXZlQXJyYXkYAiADKAVCAhgBEjoKDE1lc3NhZ2VW",
  32. "YWx1ZRgDIAEoCzIgLnVuaXR0ZXN0X2lzc3Vlcy5EZXByZWNhdGVkQ2hpbGRC",
  33. "AhgBEjoKDE1lc3NhZ2VBcnJheRgEIAMoCzIgLnVuaXR0ZXN0X2lzc3Vlcy5E",
  34. "ZXByZWNhdGVkQ2hpbGRCAhgBEjYKCUVudW1WYWx1ZRgFIAEoDjIfLnVuaXR0",
  35. "ZXN0X2lzc3Vlcy5EZXByZWNhdGVkRW51bUICGAESNgoJRW51bUFycmF5GAYg",
  36. "AygOMh8udW5pdHRlc3RfaXNzdWVzLkRlcHJlY2F0ZWRFbnVtQgIYASIZCglJ",
  37. "dGVtRmllbGQSDAoEaXRlbRgBIAEoBSJECg1SZXNlcnZlZE5hbWVzEg0KBXR5",
  38. "cGVzGAEgASgFEhIKCmRlc2NyaXB0b3IYAiABKAUaEAoOU29tZU5lc3RlZFR5",
  39. "cGUioAEKFVRlc3RKc29uRmllbGRPcmRlcmluZxITCgtwbGFpbl9pbnQzMhgE",
  40. "IAEoBRITCglvMV9zdHJpbmcYAiABKAlIABISCghvMV9pbnQzMhgFIAEoBUgA",
  41. "EhQKDHBsYWluX3N0cmluZxgBIAEoCRISCghvMl9pbnQzMhgGIAEoBUgBEhMK",
  42. "CW8yX3N0cmluZxgDIAEoCUgBQgQKAm8xQgQKAm8yIksKDFRlc3RKc29uTmFt",
  43. "ZRIMCgRuYW1lGAEgASgJEhkKC2Rlc2NyaXB0aW9uGAIgASgJUgRkZXNjEhIK",
  44. "BGd1aWQYAyABKAlSBGV4aWQifwoMT25lb2ZNZXJnaW5nEg4KBHRleHQYASAB",
  45. "KAlIABI2CgZuZXN0ZWQYAiABKAsyJC51bml0dGVzdF9pc3N1ZXMuT25lb2ZN",
  46. "ZXJnaW5nLk5lc3RlZEgAGh4KBk5lc3RlZBIJCgF4GAEgASgFEgkKAXkYAiAB",
  47. "KAVCBwoFdmFsdWUiawoWTnVsbFZhbHVlT3V0c2lkZVN0cnVjdBIWCgxzdHJp",
  48. "bmdfdmFsdWUYASABKAlIABIwCgpudWxsX3ZhbHVlGAIgASgOMhouZ29vZ2xl",
  49. "LnByb3RvYnVmLk51bGxWYWx1ZUgAQgcKBXZhbHVlIkUKE051bGxWYWx1ZU5v",
  50. "dEluT25lb2YSLgoKbnVsbF92YWx1ZRgCIAEoDjIaLmdvb2dsZS5wcm90b2J1",
  51. "Zi5OdWxsVmFsdWUqVQoMTmVnYXRpdmVFbnVtEhYKEk5FR0FUSVZFX0VOVU1f",
  52. "WkVSTxAAEhYKCUZpdmVCZWxvdxD7//////////8BEhUKCE1pbnVzT25lEP//",
  53. "/////////wEqLgoORGVwcmVjYXRlZEVudW0SEwoPREVQUkVDQVRFRF9aRVJP",
  54. "EAASBwoDb25lEAFCHaoCGlVuaXRUZXN0Lklzc3Vlcy5UZXN0UHJvdG9zYgZw",
  55. "cm90bzM="));
  56. descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
  57. new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.StructReflection.Descriptor, },
  58. new pbr::GeneratedClrTypeInfo(new[] {typeof(global::UnitTest.Issues.TestProtos.NegativeEnum), typeof(global::UnitTest.Issues.TestProtos.DeprecatedEnum), }, null, new pbr::GeneratedClrTypeInfo[] {
  59. 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)})}),
  60. new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.NegativeEnumMessage), global::UnitTest.Issues.TestProtos.NegativeEnumMessage.Parser, new[]{ "Value", "Values", "PackedValues" }, null, null, null, null),
  61. new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.DeprecatedChild), global::UnitTest.Issues.TestProtos.DeprecatedChild.Parser, null, null, null, null, null),
  62. 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),
  63. new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.ItemField), global::UnitTest.Issues.TestProtos.ItemField.Parser, new[]{ "Item" }, null, null, null, null),
  64. 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)}),
  65. 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),
  66. new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.TestJsonName), global::UnitTest.Issues.TestProtos.TestJsonName.Parser, new[]{ "Name", "Description", "Guid" }, null, null, null, null),
  67. 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)}),
  68. new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.NullValueOutsideStruct), global::UnitTest.Issues.TestProtos.NullValueOutsideStruct.Parser, new[]{ "StringValue", "NullValue" }, new[]{ "Value" }, null, null, null),
  69. new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.NullValueNotInOneof), global::UnitTest.Issues.TestProtos.NullValueNotInOneof.Parser, new[]{ "NullValue" }, null, null, null, null)
  70. }));
  71. }
  72. #endregion
  73. }
  74. #region Enums
  75. public enum NegativeEnum {
  76. [pbr::OriginalName("NEGATIVE_ENUM_ZERO")] Zero = 0,
  77. [pbr::OriginalName("FiveBelow")] FiveBelow = -5,
  78. [pbr::OriginalName("MinusOne")] MinusOne = -1,
  79. }
  80. public enum DeprecatedEnum {
  81. [pbr::OriginalName("DEPRECATED_ZERO")] DeprecatedZero = 0,
  82. [pbr::OriginalName("one")] One = 1,
  83. }
  84. #endregion
  85. #region Messages
  86. /// <summary>
  87. /// Issue 307: when generating doubly-nested types, any references
  88. /// should be of the form A.Types.B.Types.C.
  89. /// </summary>
  90. public sealed partial class Issue307 : pb::IMessage<Issue307>
  91. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  92. , pb::IBufferMessage
  93. #endif
  94. {
  95. private static readonly pb::MessageParser<Issue307> _parser = new pb::MessageParser<Issue307>(() => new Issue307());
  96. private pb::UnknownFieldSet _unknownFields;
  97. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  98. public static pb::MessageParser<Issue307> Parser { get { return _parser; } }
  99. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  100. public static pbr::MessageDescriptor Descriptor {
  101. get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[0]; }
  102. }
  103. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  104. pbr::MessageDescriptor pb::IMessage.Descriptor {
  105. get { return Descriptor; }
  106. }
  107. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  108. public Issue307() {
  109. OnConstruction();
  110. }
  111. partial void OnConstruction();
  112. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  113. public Issue307(Issue307 other) : this() {
  114. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  115. }
  116. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  117. public Issue307 Clone() {
  118. return new Issue307(this);
  119. }
  120. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  121. public override bool Equals(object other) {
  122. return Equals(other as Issue307);
  123. }
  124. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  125. public bool Equals(Issue307 other) {
  126. if (ReferenceEquals(other, null)) {
  127. return false;
  128. }
  129. if (ReferenceEquals(other, this)) {
  130. return true;
  131. }
  132. return Equals(_unknownFields, other._unknownFields);
  133. }
  134. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  135. public override int GetHashCode() {
  136. int hash = 1;
  137. if (_unknownFields != null) {
  138. hash ^= _unknownFields.GetHashCode();
  139. }
  140. return hash;
  141. }
  142. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  143. public override string ToString() {
  144. return pb::JsonFormatter.ToDiagnosticString(this);
  145. }
  146. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  147. public void WriteTo(pb::CodedOutputStream output) {
  148. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  149. output.WriteRawMessage(this);
  150. #else
  151. if (_unknownFields != null) {
  152. _unknownFields.WriteTo(output);
  153. }
  154. #endif
  155. }
  156. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  157. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  158. void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
  159. if (_unknownFields != null) {
  160. _unknownFields.WriteTo(ref output);
  161. }
  162. }
  163. #endif
  164. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  165. public int CalculateSize() {
  166. int size = 0;
  167. if (_unknownFields != null) {
  168. size += _unknownFields.CalculateSize();
  169. }
  170. return size;
  171. }
  172. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  173. public void MergeFrom(Issue307 other) {
  174. if (other == null) {
  175. return;
  176. }
  177. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  178. }
  179. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  180. public void MergeFrom(pb::CodedInputStream input) {
  181. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  182. input.ReadRawMessage(this);
  183. #else
  184. uint tag;
  185. while ((tag = input.ReadTag()) != 0) {
  186. switch(tag) {
  187. default:
  188. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  189. break;
  190. }
  191. }
  192. #endif
  193. }
  194. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  195. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  196. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  197. uint tag;
  198. while ((tag = input.ReadTag()) != 0) {
  199. switch(tag) {
  200. default:
  201. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  202. break;
  203. }
  204. }
  205. }
  206. #endif
  207. #region Nested types
  208. /// <summary>Container for nested types declared in the Issue307 message type.</summary>
  209. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  210. public static partial class Types {
  211. public sealed partial class NestedOnce : pb::IMessage<NestedOnce>
  212. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  213. , pb::IBufferMessage
  214. #endif
  215. {
  216. private static readonly pb::MessageParser<NestedOnce> _parser = new pb::MessageParser<NestedOnce>(() => new NestedOnce());
  217. private pb::UnknownFieldSet _unknownFields;
  218. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  219. public static pb::MessageParser<NestedOnce> Parser { get { return _parser; } }
  220. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  221. public static pbr::MessageDescriptor Descriptor {
  222. get { return global::UnitTest.Issues.TestProtos.Issue307.Descriptor.NestedTypes[0]; }
  223. }
  224. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  225. pbr::MessageDescriptor pb::IMessage.Descriptor {
  226. get { return Descriptor; }
  227. }
  228. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  229. public NestedOnce() {
  230. OnConstruction();
  231. }
  232. partial void OnConstruction();
  233. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  234. public NestedOnce(NestedOnce other) : this() {
  235. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  236. }
  237. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  238. public NestedOnce Clone() {
  239. return new NestedOnce(this);
  240. }
  241. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  242. public override bool Equals(object other) {
  243. return Equals(other as NestedOnce);
  244. }
  245. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  246. public bool Equals(NestedOnce other) {
  247. if (ReferenceEquals(other, null)) {
  248. return false;
  249. }
  250. if (ReferenceEquals(other, this)) {
  251. return true;
  252. }
  253. return Equals(_unknownFields, other._unknownFields);
  254. }
  255. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  256. public override int GetHashCode() {
  257. int hash = 1;
  258. if (_unknownFields != null) {
  259. hash ^= _unknownFields.GetHashCode();
  260. }
  261. return hash;
  262. }
  263. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  264. public override string ToString() {
  265. return pb::JsonFormatter.ToDiagnosticString(this);
  266. }
  267. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  268. public void WriteTo(pb::CodedOutputStream output) {
  269. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  270. output.WriteRawMessage(this);
  271. #else
  272. if (_unknownFields != null) {
  273. _unknownFields.WriteTo(output);
  274. }
  275. #endif
  276. }
  277. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  278. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  279. void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
  280. if (_unknownFields != null) {
  281. _unknownFields.WriteTo(ref output);
  282. }
  283. }
  284. #endif
  285. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  286. public int CalculateSize() {
  287. int size = 0;
  288. if (_unknownFields != null) {
  289. size += _unknownFields.CalculateSize();
  290. }
  291. return size;
  292. }
  293. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  294. public void MergeFrom(NestedOnce other) {
  295. if (other == null) {
  296. return;
  297. }
  298. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  299. }
  300. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  301. public void MergeFrom(pb::CodedInputStream input) {
  302. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  303. input.ReadRawMessage(this);
  304. #else
  305. uint tag;
  306. while ((tag = input.ReadTag()) != 0) {
  307. switch(tag) {
  308. default:
  309. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  310. break;
  311. }
  312. }
  313. #endif
  314. }
  315. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  316. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  317. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  318. uint tag;
  319. while ((tag = input.ReadTag()) != 0) {
  320. switch(tag) {
  321. default:
  322. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  323. break;
  324. }
  325. }
  326. }
  327. #endif
  328. #region Nested types
  329. /// <summary>Container for nested types declared in the NestedOnce message type.</summary>
  330. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  331. public static partial class Types {
  332. public sealed partial class NestedTwice : pb::IMessage<NestedTwice>
  333. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  334. , pb::IBufferMessage
  335. #endif
  336. {
  337. private static readonly pb::MessageParser<NestedTwice> _parser = new pb::MessageParser<NestedTwice>(() => new NestedTwice());
  338. private pb::UnknownFieldSet _unknownFields;
  339. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  340. public static pb::MessageParser<NestedTwice> Parser { get { return _parser; } }
  341. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  342. public static pbr::MessageDescriptor Descriptor {
  343. get { return global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce.Descriptor.NestedTypes[0]; }
  344. }
  345. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  346. pbr::MessageDescriptor pb::IMessage.Descriptor {
  347. get { return Descriptor; }
  348. }
  349. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  350. public NestedTwice() {
  351. OnConstruction();
  352. }
  353. partial void OnConstruction();
  354. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  355. public NestedTwice(NestedTwice other) : this() {
  356. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  357. }
  358. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  359. public NestedTwice Clone() {
  360. return new NestedTwice(this);
  361. }
  362. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  363. public override bool Equals(object other) {
  364. return Equals(other as NestedTwice);
  365. }
  366. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  367. public bool Equals(NestedTwice other) {
  368. if (ReferenceEquals(other, null)) {
  369. return false;
  370. }
  371. if (ReferenceEquals(other, this)) {
  372. return true;
  373. }
  374. return Equals(_unknownFields, other._unknownFields);
  375. }
  376. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  377. public override int GetHashCode() {
  378. int hash = 1;
  379. if (_unknownFields != null) {
  380. hash ^= _unknownFields.GetHashCode();
  381. }
  382. return hash;
  383. }
  384. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  385. public override string ToString() {
  386. return pb::JsonFormatter.ToDiagnosticString(this);
  387. }
  388. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  389. public void WriteTo(pb::CodedOutputStream output) {
  390. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  391. output.WriteRawMessage(this);
  392. #else
  393. if (_unknownFields != null) {
  394. _unknownFields.WriteTo(output);
  395. }
  396. #endif
  397. }
  398. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  399. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  400. void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
  401. if (_unknownFields != null) {
  402. _unknownFields.WriteTo(ref output);
  403. }
  404. }
  405. #endif
  406. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  407. public int CalculateSize() {
  408. int size = 0;
  409. if (_unknownFields != null) {
  410. size += _unknownFields.CalculateSize();
  411. }
  412. return size;
  413. }
  414. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  415. public void MergeFrom(NestedTwice other) {
  416. if (other == null) {
  417. return;
  418. }
  419. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  420. }
  421. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  422. public void MergeFrom(pb::CodedInputStream input) {
  423. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  424. input.ReadRawMessage(this);
  425. #else
  426. uint tag;
  427. while ((tag = input.ReadTag()) != 0) {
  428. switch(tag) {
  429. default:
  430. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  431. break;
  432. }
  433. }
  434. #endif
  435. }
  436. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  437. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  438. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  439. uint tag;
  440. while ((tag = input.ReadTag()) != 0) {
  441. switch(tag) {
  442. default:
  443. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  444. break;
  445. }
  446. }
  447. }
  448. #endif
  449. }
  450. }
  451. #endregion
  452. }
  453. }
  454. #endregion
  455. }
  456. public sealed partial class NegativeEnumMessage : pb::IMessage<NegativeEnumMessage>
  457. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  458. , pb::IBufferMessage
  459. #endif
  460. {
  461. private static readonly pb::MessageParser<NegativeEnumMessage> _parser = new pb::MessageParser<NegativeEnumMessage>(() => new NegativeEnumMessage());
  462. private pb::UnknownFieldSet _unknownFields;
  463. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  464. public static pb::MessageParser<NegativeEnumMessage> Parser { get { return _parser; } }
  465. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  466. public static pbr::MessageDescriptor Descriptor {
  467. get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[1]; }
  468. }
  469. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  470. pbr::MessageDescriptor pb::IMessage.Descriptor {
  471. get { return Descriptor; }
  472. }
  473. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  474. public NegativeEnumMessage() {
  475. OnConstruction();
  476. }
  477. partial void OnConstruction();
  478. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  479. public NegativeEnumMessage(NegativeEnumMessage other) : this() {
  480. value_ = other.value_;
  481. values_ = other.values_.Clone();
  482. packedValues_ = other.packedValues_.Clone();
  483. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  484. }
  485. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  486. public NegativeEnumMessage Clone() {
  487. return new NegativeEnumMessage(this);
  488. }
  489. /// <summary>Field number for the "value" field.</summary>
  490. public const int ValueFieldNumber = 1;
  491. private global::UnitTest.Issues.TestProtos.NegativeEnum value_ = global::UnitTest.Issues.TestProtos.NegativeEnum.Zero;
  492. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  493. public global::UnitTest.Issues.TestProtos.NegativeEnum Value {
  494. get { return value_; }
  495. set {
  496. value_ = value;
  497. }
  498. }
  499. /// <summary>Field number for the "values" field.</summary>
  500. public const int ValuesFieldNumber = 2;
  501. private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.NegativeEnum> _repeated_values_codec
  502. = pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::UnitTest.Issues.TestProtos.NegativeEnum) x);
  503. private readonly pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum> values_ = new pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum>();
  504. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  505. public pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum> Values {
  506. get { return values_; }
  507. }
  508. /// <summary>Field number for the "packed_values" field.</summary>
  509. public const int PackedValuesFieldNumber = 3;
  510. private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.NegativeEnum> _repeated_packedValues_codec
  511. = pb::FieldCodec.ForEnum(26, x => (int) x, x => (global::UnitTest.Issues.TestProtos.NegativeEnum) x);
  512. private readonly pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum> packedValues_ = new pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum>();
  513. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  514. public pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum> PackedValues {
  515. get { return packedValues_; }
  516. }
  517. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  518. public override bool Equals(object other) {
  519. return Equals(other as NegativeEnumMessage);
  520. }
  521. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  522. public bool Equals(NegativeEnumMessage other) {
  523. if (ReferenceEquals(other, null)) {
  524. return false;
  525. }
  526. if (ReferenceEquals(other, this)) {
  527. return true;
  528. }
  529. if (Value != other.Value) return false;
  530. if(!values_.Equals(other.values_)) return false;
  531. if(!packedValues_.Equals(other.packedValues_)) return false;
  532. return Equals(_unknownFields, other._unknownFields);
  533. }
  534. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  535. public override int GetHashCode() {
  536. int hash = 1;
  537. if (Value != global::UnitTest.Issues.TestProtos.NegativeEnum.Zero) hash ^= Value.GetHashCode();
  538. hash ^= values_.GetHashCode();
  539. hash ^= packedValues_.GetHashCode();
  540. if (_unknownFields != null) {
  541. hash ^= _unknownFields.GetHashCode();
  542. }
  543. return hash;
  544. }
  545. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  546. public override string ToString() {
  547. return pb::JsonFormatter.ToDiagnosticString(this);
  548. }
  549. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  550. public void WriteTo(pb::CodedOutputStream output) {
  551. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  552. output.WriteRawMessage(this);
  553. #else
  554. if (Value != global::UnitTest.Issues.TestProtos.NegativeEnum.Zero) {
  555. output.WriteRawTag(8);
  556. output.WriteEnum((int) Value);
  557. }
  558. values_.WriteTo(output, _repeated_values_codec);
  559. packedValues_.WriteTo(output, _repeated_packedValues_codec);
  560. if (_unknownFields != null) {
  561. _unknownFields.WriteTo(output);
  562. }
  563. #endif
  564. }
  565. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  566. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  567. void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
  568. if (Value != global::UnitTest.Issues.TestProtos.NegativeEnum.Zero) {
  569. output.WriteRawTag(8);
  570. output.WriteEnum((int) Value);
  571. }
  572. values_.WriteTo(ref output, _repeated_values_codec);
  573. packedValues_.WriteTo(ref output, _repeated_packedValues_codec);
  574. if (_unknownFields != null) {
  575. _unknownFields.WriteTo(ref output);
  576. }
  577. }
  578. #endif
  579. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  580. public int CalculateSize() {
  581. int size = 0;
  582. if (Value != global::UnitTest.Issues.TestProtos.NegativeEnum.Zero) {
  583. size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Value);
  584. }
  585. size += values_.CalculateSize(_repeated_values_codec);
  586. size += packedValues_.CalculateSize(_repeated_packedValues_codec);
  587. if (_unknownFields != null) {
  588. size += _unknownFields.CalculateSize();
  589. }
  590. return size;
  591. }
  592. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  593. public void MergeFrom(NegativeEnumMessage other) {
  594. if (other == null) {
  595. return;
  596. }
  597. if (other.Value != global::UnitTest.Issues.TestProtos.NegativeEnum.Zero) {
  598. Value = other.Value;
  599. }
  600. values_.Add(other.values_);
  601. packedValues_.Add(other.packedValues_);
  602. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  603. }
  604. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  605. public void MergeFrom(pb::CodedInputStream input) {
  606. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  607. input.ReadRawMessage(this);
  608. #else
  609. uint tag;
  610. while ((tag = input.ReadTag()) != 0) {
  611. switch(tag) {
  612. default:
  613. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  614. break;
  615. case 8: {
  616. Value = (global::UnitTest.Issues.TestProtos.NegativeEnum) input.ReadEnum();
  617. break;
  618. }
  619. case 18:
  620. case 16: {
  621. values_.AddEntriesFrom(input, _repeated_values_codec);
  622. break;
  623. }
  624. case 26:
  625. case 24: {
  626. packedValues_.AddEntriesFrom(input, _repeated_packedValues_codec);
  627. break;
  628. }
  629. }
  630. }
  631. #endif
  632. }
  633. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  634. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  635. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  636. uint tag;
  637. while ((tag = input.ReadTag()) != 0) {
  638. switch(tag) {
  639. default:
  640. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  641. break;
  642. case 8: {
  643. Value = (global::UnitTest.Issues.TestProtos.NegativeEnum) input.ReadEnum();
  644. break;
  645. }
  646. case 18:
  647. case 16: {
  648. values_.AddEntriesFrom(ref input, _repeated_values_codec);
  649. break;
  650. }
  651. case 26:
  652. case 24: {
  653. packedValues_.AddEntriesFrom(ref input, _repeated_packedValues_codec);
  654. break;
  655. }
  656. }
  657. }
  658. }
  659. #endif
  660. }
  661. public sealed partial class DeprecatedChild : pb::IMessage<DeprecatedChild>
  662. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  663. , pb::IBufferMessage
  664. #endif
  665. {
  666. private static readonly pb::MessageParser<DeprecatedChild> _parser = new pb::MessageParser<DeprecatedChild>(() => new DeprecatedChild());
  667. private pb::UnknownFieldSet _unknownFields;
  668. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  669. public static pb::MessageParser<DeprecatedChild> Parser { get { return _parser; } }
  670. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  671. public static pbr::MessageDescriptor Descriptor {
  672. get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[2]; }
  673. }
  674. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  675. pbr::MessageDescriptor pb::IMessage.Descriptor {
  676. get { return Descriptor; }
  677. }
  678. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  679. public DeprecatedChild() {
  680. OnConstruction();
  681. }
  682. partial void OnConstruction();
  683. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  684. public DeprecatedChild(DeprecatedChild other) : this() {
  685. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  686. }
  687. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  688. public DeprecatedChild Clone() {
  689. return new DeprecatedChild(this);
  690. }
  691. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  692. public override bool Equals(object other) {
  693. return Equals(other as DeprecatedChild);
  694. }
  695. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  696. public bool Equals(DeprecatedChild other) {
  697. if (ReferenceEquals(other, null)) {
  698. return false;
  699. }
  700. if (ReferenceEquals(other, this)) {
  701. return true;
  702. }
  703. return Equals(_unknownFields, other._unknownFields);
  704. }
  705. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  706. public override int GetHashCode() {
  707. int hash = 1;
  708. if (_unknownFields != null) {
  709. hash ^= _unknownFields.GetHashCode();
  710. }
  711. return hash;
  712. }
  713. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  714. public override string ToString() {
  715. return pb::JsonFormatter.ToDiagnosticString(this);
  716. }
  717. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  718. public void WriteTo(pb::CodedOutputStream output) {
  719. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  720. output.WriteRawMessage(this);
  721. #else
  722. if (_unknownFields != null) {
  723. _unknownFields.WriteTo(output);
  724. }
  725. #endif
  726. }
  727. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  728. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  729. void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
  730. if (_unknownFields != null) {
  731. _unknownFields.WriteTo(ref output);
  732. }
  733. }
  734. #endif
  735. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  736. public int CalculateSize() {
  737. int size = 0;
  738. if (_unknownFields != null) {
  739. size += _unknownFields.CalculateSize();
  740. }
  741. return size;
  742. }
  743. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  744. public void MergeFrom(DeprecatedChild other) {
  745. if (other == null) {
  746. return;
  747. }
  748. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  749. }
  750. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  751. public void MergeFrom(pb::CodedInputStream input) {
  752. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  753. input.ReadRawMessage(this);
  754. #else
  755. uint tag;
  756. while ((tag = input.ReadTag()) != 0) {
  757. switch(tag) {
  758. default:
  759. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  760. break;
  761. }
  762. }
  763. #endif
  764. }
  765. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  766. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  767. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  768. uint tag;
  769. while ((tag = input.ReadTag()) != 0) {
  770. switch(tag) {
  771. default:
  772. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  773. break;
  774. }
  775. }
  776. }
  777. #endif
  778. }
  779. public sealed partial class DeprecatedFieldsMessage : pb::IMessage<DeprecatedFieldsMessage>
  780. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  781. , pb::IBufferMessage
  782. #endif
  783. {
  784. private static readonly pb::MessageParser<DeprecatedFieldsMessage> _parser = new pb::MessageParser<DeprecatedFieldsMessage>(() => new DeprecatedFieldsMessage());
  785. private pb::UnknownFieldSet _unknownFields;
  786. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  787. public static pb::MessageParser<DeprecatedFieldsMessage> Parser { get { return _parser; } }
  788. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  789. public static pbr::MessageDescriptor Descriptor {
  790. get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[3]; }
  791. }
  792. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  793. pbr::MessageDescriptor pb::IMessage.Descriptor {
  794. get { return Descriptor; }
  795. }
  796. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  797. public DeprecatedFieldsMessage() {
  798. OnConstruction();
  799. }
  800. partial void OnConstruction();
  801. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  802. public DeprecatedFieldsMessage(DeprecatedFieldsMessage other) : this() {
  803. primitiveValue_ = other.primitiveValue_;
  804. primitiveArray_ = other.primitiveArray_.Clone();
  805. messageValue_ = other.messageValue_ != null ? other.messageValue_.Clone() : null;
  806. messageArray_ = other.messageArray_.Clone();
  807. enumValue_ = other.enumValue_;
  808. enumArray_ = other.enumArray_.Clone();
  809. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  810. }
  811. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  812. public DeprecatedFieldsMessage Clone() {
  813. return new DeprecatedFieldsMessage(this);
  814. }
  815. /// <summary>Field number for the "PrimitiveValue" field.</summary>
  816. public const int PrimitiveValueFieldNumber = 1;
  817. private int primitiveValue_;
  818. [global::System.ObsoleteAttribute]
  819. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  820. public int PrimitiveValue {
  821. get { return primitiveValue_; }
  822. set {
  823. primitiveValue_ = value;
  824. }
  825. }
  826. /// <summary>Field number for the "PrimitiveArray" field.</summary>
  827. public const int PrimitiveArrayFieldNumber = 2;
  828. private static readonly pb::FieldCodec<int> _repeated_primitiveArray_codec
  829. = pb::FieldCodec.ForInt32(18);
  830. private readonly pbc::RepeatedField<int> primitiveArray_ = new pbc::RepeatedField<int>();
  831. [global::System.ObsoleteAttribute]
  832. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  833. public pbc::RepeatedField<int> PrimitiveArray {
  834. get { return primitiveArray_; }
  835. }
  836. /// <summary>Field number for the "MessageValue" field.</summary>
  837. public const int MessageValueFieldNumber = 3;
  838. private global::UnitTest.Issues.TestProtos.DeprecatedChild messageValue_;
  839. [global::System.ObsoleteAttribute]
  840. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  841. public global::UnitTest.Issues.TestProtos.DeprecatedChild MessageValue {
  842. get { return messageValue_; }
  843. set {
  844. messageValue_ = value;
  845. }
  846. }
  847. /// <summary>Field number for the "MessageArray" field.</summary>
  848. public const int MessageArrayFieldNumber = 4;
  849. private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.DeprecatedChild> _repeated_messageArray_codec
  850. = pb::FieldCodec.ForMessage(34, global::UnitTest.Issues.TestProtos.DeprecatedChild.Parser);
  851. private readonly pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedChild> messageArray_ = new pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedChild>();
  852. [global::System.ObsoleteAttribute]
  853. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  854. public pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedChild> MessageArray {
  855. get { return messageArray_; }
  856. }
  857. /// <summary>Field number for the "EnumValue" field.</summary>
  858. public const int EnumValueFieldNumber = 5;
  859. private global::UnitTest.Issues.TestProtos.DeprecatedEnum enumValue_ = global::UnitTest.Issues.TestProtos.DeprecatedEnum.DeprecatedZero;
  860. [global::System.ObsoleteAttribute]
  861. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  862. public global::UnitTest.Issues.TestProtos.DeprecatedEnum EnumValue {
  863. get { return enumValue_; }
  864. set {
  865. enumValue_ = value;
  866. }
  867. }
  868. /// <summary>Field number for the "EnumArray" field.</summary>
  869. public const int EnumArrayFieldNumber = 6;
  870. private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.DeprecatedEnum> _repeated_enumArray_codec
  871. = pb::FieldCodec.ForEnum(50, x => (int) x, x => (global::UnitTest.Issues.TestProtos.DeprecatedEnum) x);
  872. private readonly pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedEnum> enumArray_ = new pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedEnum>();
  873. [global::System.ObsoleteAttribute]
  874. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  875. public pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedEnum> EnumArray {
  876. get { return enumArray_; }
  877. }
  878. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  879. public override bool Equals(object other) {
  880. return Equals(other as DeprecatedFieldsMessage);
  881. }
  882. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  883. public bool Equals(DeprecatedFieldsMessage other) {
  884. if (ReferenceEquals(other, null)) {
  885. return false;
  886. }
  887. if (ReferenceEquals(other, this)) {
  888. return true;
  889. }
  890. if (PrimitiveValue != other.PrimitiveValue) return false;
  891. if(!primitiveArray_.Equals(other.primitiveArray_)) return false;
  892. if (!object.Equals(MessageValue, other.MessageValue)) return false;
  893. if(!messageArray_.Equals(other.messageArray_)) return false;
  894. if (EnumValue != other.EnumValue) return false;
  895. if(!enumArray_.Equals(other.enumArray_)) return false;
  896. return Equals(_unknownFields, other._unknownFields);
  897. }
  898. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  899. public override int GetHashCode() {
  900. int hash = 1;
  901. if (PrimitiveValue != 0) hash ^= PrimitiveValue.GetHashCode();
  902. hash ^= primitiveArray_.GetHashCode();
  903. if (messageValue_ != null) hash ^= MessageValue.GetHashCode();
  904. hash ^= messageArray_.GetHashCode();
  905. if (EnumValue != global::UnitTest.Issues.TestProtos.DeprecatedEnum.DeprecatedZero) hash ^= EnumValue.GetHashCode();
  906. hash ^= enumArray_.GetHashCode();
  907. if (_unknownFields != null) {
  908. hash ^= _unknownFields.GetHashCode();
  909. }
  910. return hash;
  911. }
  912. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  913. public override string ToString() {
  914. return pb::JsonFormatter.ToDiagnosticString(this);
  915. }
  916. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  917. public void WriteTo(pb::CodedOutputStream output) {
  918. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  919. output.WriteRawMessage(this);
  920. #else
  921. if (PrimitiveValue != 0) {
  922. output.WriteRawTag(8);
  923. output.WriteInt32(PrimitiveValue);
  924. }
  925. primitiveArray_.WriteTo(output, _repeated_primitiveArray_codec);
  926. if (messageValue_ != null) {
  927. output.WriteRawTag(26);
  928. output.WriteMessage(MessageValue);
  929. }
  930. messageArray_.WriteTo(output, _repeated_messageArray_codec);
  931. if (EnumValue != global::UnitTest.Issues.TestProtos.DeprecatedEnum.DeprecatedZero) {
  932. output.WriteRawTag(40);
  933. output.WriteEnum((int) EnumValue);
  934. }
  935. enumArray_.WriteTo(output, _repeated_enumArray_codec);
  936. if (_unknownFields != null) {
  937. _unknownFields.WriteTo(output);
  938. }
  939. #endif
  940. }
  941. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  942. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  943. void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
  944. if (PrimitiveValue != 0) {
  945. output.WriteRawTag(8);
  946. output.WriteInt32(PrimitiveValue);
  947. }
  948. primitiveArray_.WriteTo(ref output, _repeated_primitiveArray_codec);
  949. if (messageValue_ != null) {
  950. output.WriteRawTag(26);
  951. output.WriteMessage(MessageValue);
  952. }
  953. messageArray_.WriteTo(ref output, _repeated_messageArray_codec);
  954. if (EnumValue != global::UnitTest.Issues.TestProtos.DeprecatedEnum.DeprecatedZero) {
  955. output.WriteRawTag(40);
  956. output.WriteEnum((int) EnumValue);
  957. }
  958. enumArray_.WriteTo(ref output, _repeated_enumArray_codec);
  959. if (_unknownFields != null) {
  960. _unknownFields.WriteTo(ref output);
  961. }
  962. }
  963. #endif
  964. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  965. public int CalculateSize() {
  966. int size = 0;
  967. if (PrimitiveValue != 0) {
  968. size += 1 + pb::CodedOutputStream.ComputeInt32Size(PrimitiveValue);
  969. }
  970. size += primitiveArray_.CalculateSize(_repeated_primitiveArray_codec);
  971. if (messageValue_ != null) {
  972. size += 1 + pb::CodedOutputStream.ComputeMessageSize(MessageValue);
  973. }
  974. size += messageArray_.CalculateSize(_repeated_messageArray_codec);
  975. if (EnumValue != global::UnitTest.Issues.TestProtos.DeprecatedEnum.DeprecatedZero) {
  976. size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) EnumValue);
  977. }
  978. size += enumArray_.CalculateSize(_repeated_enumArray_codec);
  979. if (_unknownFields != null) {
  980. size += _unknownFields.CalculateSize();
  981. }
  982. return size;
  983. }
  984. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  985. public void MergeFrom(DeprecatedFieldsMessage other) {
  986. if (other == null) {
  987. return;
  988. }
  989. if (other.PrimitiveValue != 0) {
  990. PrimitiveValue = other.PrimitiveValue;
  991. }
  992. primitiveArray_.Add(other.primitiveArray_);
  993. if (other.messageValue_ != null) {
  994. if (messageValue_ == null) {
  995. MessageValue = new global::UnitTest.Issues.TestProtos.DeprecatedChild();
  996. }
  997. MessageValue.MergeFrom(other.MessageValue);
  998. }
  999. messageArray_.Add(other.messageArray_);
  1000. if (other.EnumValue != global::UnitTest.Issues.TestProtos.DeprecatedEnum.DeprecatedZero) {
  1001. EnumValue = other.EnumValue;
  1002. }
  1003. enumArray_.Add(other.enumArray_);
  1004. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  1005. }
  1006. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1007. public void MergeFrom(pb::CodedInputStream input) {
  1008. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1009. input.ReadRawMessage(this);
  1010. #else
  1011. uint tag;
  1012. while ((tag = input.ReadTag()) != 0) {
  1013. switch(tag) {
  1014. default:
  1015. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  1016. break;
  1017. case 8: {
  1018. PrimitiveValue = input.ReadInt32();
  1019. break;
  1020. }
  1021. case 18:
  1022. case 16: {
  1023. primitiveArray_.AddEntriesFrom(input, _repeated_primitiveArray_codec);
  1024. break;
  1025. }
  1026. case 26: {
  1027. if (messageValue_ == null) {
  1028. MessageValue = new global::UnitTest.Issues.TestProtos.DeprecatedChild();
  1029. }
  1030. input.ReadMessage(MessageValue);
  1031. break;
  1032. }
  1033. case 34: {
  1034. messageArray_.AddEntriesFrom(input, _repeated_messageArray_codec);
  1035. break;
  1036. }
  1037. case 40: {
  1038. EnumValue = (global::UnitTest.Issues.TestProtos.DeprecatedEnum) input.ReadEnum();
  1039. break;
  1040. }
  1041. case 50:
  1042. case 48: {
  1043. enumArray_.AddEntriesFrom(input, _repeated_enumArray_codec);
  1044. break;
  1045. }
  1046. }
  1047. }
  1048. #endif
  1049. }
  1050. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1051. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1052. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  1053. uint tag;
  1054. while ((tag = input.ReadTag()) != 0) {
  1055. switch(tag) {
  1056. default:
  1057. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  1058. break;
  1059. case 8: {
  1060. PrimitiveValue = input.ReadInt32();
  1061. break;
  1062. }
  1063. case 18:
  1064. case 16: {
  1065. primitiveArray_.AddEntriesFrom(ref input, _repeated_primitiveArray_codec);
  1066. break;
  1067. }
  1068. case 26: {
  1069. if (messageValue_ == null) {
  1070. MessageValue = new global::UnitTest.Issues.TestProtos.DeprecatedChild();
  1071. }
  1072. input.ReadMessage(MessageValue);
  1073. break;
  1074. }
  1075. case 34: {
  1076. messageArray_.AddEntriesFrom(ref input, _repeated_messageArray_codec);
  1077. break;
  1078. }
  1079. case 40: {
  1080. EnumValue = (global::UnitTest.Issues.TestProtos.DeprecatedEnum) input.ReadEnum();
  1081. break;
  1082. }
  1083. case 50:
  1084. case 48: {
  1085. enumArray_.AddEntriesFrom(ref input, _repeated_enumArray_codec);
  1086. break;
  1087. }
  1088. }
  1089. }
  1090. }
  1091. #endif
  1092. }
  1093. /// <summary>
  1094. /// Issue 45: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=45
  1095. /// </summary>
  1096. public sealed partial class ItemField : pb::IMessage<ItemField>
  1097. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1098. , pb::IBufferMessage
  1099. #endif
  1100. {
  1101. private static readonly pb::MessageParser<ItemField> _parser = new pb::MessageParser<ItemField>(() => new ItemField());
  1102. private pb::UnknownFieldSet _unknownFields;
  1103. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1104. public static pb::MessageParser<ItemField> Parser { get { return _parser; } }
  1105. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1106. public static pbr::MessageDescriptor Descriptor {
  1107. get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[4]; }
  1108. }
  1109. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1110. pbr::MessageDescriptor pb::IMessage.Descriptor {
  1111. get { return Descriptor; }
  1112. }
  1113. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1114. public ItemField() {
  1115. OnConstruction();
  1116. }
  1117. partial void OnConstruction();
  1118. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1119. public ItemField(ItemField other) : this() {
  1120. item_ = other.item_;
  1121. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  1122. }
  1123. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1124. public ItemField Clone() {
  1125. return new ItemField(this);
  1126. }
  1127. /// <summary>Field number for the "item" field.</summary>
  1128. public const int ItemFieldNumber = 1;
  1129. private int item_;
  1130. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1131. public int Item {
  1132. get { return item_; }
  1133. set {
  1134. item_ = value;
  1135. }
  1136. }
  1137. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1138. public override bool Equals(object other) {
  1139. return Equals(other as ItemField);
  1140. }
  1141. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1142. public bool Equals(ItemField other) {
  1143. if (ReferenceEquals(other, null)) {
  1144. return false;
  1145. }
  1146. if (ReferenceEquals(other, this)) {
  1147. return true;
  1148. }
  1149. if (Item != other.Item) return false;
  1150. return Equals(_unknownFields, other._unknownFields);
  1151. }
  1152. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1153. public override int GetHashCode() {
  1154. int hash = 1;
  1155. if (Item != 0) hash ^= Item.GetHashCode();
  1156. if (_unknownFields != null) {
  1157. hash ^= _unknownFields.GetHashCode();
  1158. }
  1159. return hash;
  1160. }
  1161. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1162. public override string ToString() {
  1163. return pb::JsonFormatter.ToDiagnosticString(this);
  1164. }
  1165. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1166. public void WriteTo(pb::CodedOutputStream output) {
  1167. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1168. output.WriteRawMessage(this);
  1169. #else
  1170. if (Item != 0) {
  1171. output.WriteRawTag(8);
  1172. output.WriteInt32(Item);
  1173. }
  1174. if (_unknownFields != null) {
  1175. _unknownFields.WriteTo(output);
  1176. }
  1177. #endif
  1178. }
  1179. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1180. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1181. void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
  1182. if (Item != 0) {
  1183. output.WriteRawTag(8);
  1184. output.WriteInt32(Item);
  1185. }
  1186. if (_unknownFields != null) {
  1187. _unknownFields.WriteTo(ref output);
  1188. }
  1189. }
  1190. #endif
  1191. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1192. public int CalculateSize() {
  1193. int size = 0;
  1194. if (Item != 0) {
  1195. size += 1 + pb::CodedOutputStream.ComputeInt32Size(Item);
  1196. }
  1197. if (_unknownFields != null) {
  1198. size += _unknownFields.CalculateSize();
  1199. }
  1200. return size;
  1201. }
  1202. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1203. public void MergeFrom(ItemField other) {
  1204. if (other == null) {
  1205. return;
  1206. }
  1207. if (other.Item != 0) {
  1208. Item = other.Item;
  1209. }
  1210. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  1211. }
  1212. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1213. public void MergeFrom(pb::CodedInputStream input) {
  1214. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1215. input.ReadRawMessage(this);
  1216. #else
  1217. uint tag;
  1218. while ((tag = input.ReadTag()) != 0) {
  1219. switch(tag) {
  1220. default:
  1221. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  1222. break;
  1223. case 8: {
  1224. Item = input.ReadInt32();
  1225. break;
  1226. }
  1227. }
  1228. }
  1229. #endif
  1230. }
  1231. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1232. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1233. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  1234. uint tag;
  1235. while ((tag = input.ReadTag()) != 0) {
  1236. switch(tag) {
  1237. default:
  1238. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  1239. break;
  1240. case 8: {
  1241. Item = input.ReadInt32();
  1242. break;
  1243. }
  1244. }
  1245. }
  1246. }
  1247. #endif
  1248. }
  1249. public sealed partial class ReservedNames : pb::IMessage<ReservedNames>
  1250. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1251. , pb::IBufferMessage
  1252. #endif
  1253. {
  1254. private static readonly pb::MessageParser<ReservedNames> _parser = new pb::MessageParser<ReservedNames>(() => new ReservedNames());
  1255. private pb::UnknownFieldSet _unknownFields;
  1256. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1257. public static pb::MessageParser<ReservedNames> Parser { get { return _parser; } }
  1258. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1259. public static pbr::MessageDescriptor Descriptor {
  1260. get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[5]; }
  1261. }
  1262. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1263. pbr::MessageDescriptor pb::IMessage.Descriptor {
  1264. get { return Descriptor; }
  1265. }
  1266. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1267. public ReservedNames() {
  1268. OnConstruction();
  1269. }
  1270. partial void OnConstruction();
  1271. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1272. public ReservedNames(ReservedNames other) : this() {
  1273. types_ = other.types_;
  1274. descriptor_ = other.descriptor_;
  1275. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  1276. }
  1277. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1278. public ReservedNames Clone() {
  1279. return new ReservedNames(this);
  1280. }
  1281. /// <summary>Field number for the "types" field.</summary>
  1282. public const int Types_FieldNumber = 1;
  1283. private int types_;
  1284. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1285. public int Types_ {
  1286. get { return types_; }
  1287. set {
  1288. types_ = value;
  1289. }
  1290. }
  1291. /// <summary>Field number for the "descriptor" field.</summary>
  1292. public const int Descriptor_FieldNumber = 2;
  1293. private int descriptor_;
  1294. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1295. public int Descriptor_ {
  1296. get { return descriptor_; }
  1297. set {
  1298. descriptor_ = value;
  1299. }
  1300. }
  1301. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1302. public override bool Equals(object other) {
  1303. return Equals(other as ReservedNames);
  1304. }
  1305. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1306. public bool Equals(ReservedNames other) {
  1307. if (ReferenceEquals(other, null)) {
  1308. return false;
  1309. }
  1310. if (ReferenceEquals(other, this)) {
  1311. return true;
  1312. }
  1313. if (Types_ != other.Types_) return false;
  1314. if (Descriptor_ != other.Descriptor_) return false;
  1315. return Equals(_unknownFields, other._unknownFields);
  1316. }
  1317. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1318. public override int GetHashCode() {
  1319. int hash = 1;
  1320. if (Types_ != 0) hash ^= Types_.GetHashCode();
  1321. if (Descriptor_ != 0) hash ^= Descriptor_.GetHashCode();
  1322. if (_unknownFields != null) {
  1323. hash ^= _unknownFields.GetHashCode();
  1324. }
  1325. return hash;
  1326. }
  1327. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1328. public override string ToString() {
  1329. return pb::JsonFormatter.ToDiagnosticString(this);
  1330. }
  1331. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1332. public void WriteTo(pb::CodedOutputStream output) {
  1333. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1334. output.WriteRawMessage(this);
  1335. #else
  1336. if (Types_ != 0) {
  1337. output.WriteRawTag(8);
  1338. output.WriteInt32(Types_);
  1339. }
  1340. if (Descriptor_ != 0) {
  1341. output.WriteRawTag(16);
  1342. output.WriteInt32(Descriptor_);
  1343. }
  1344. if (_unknownFields != null) {
  1345. _unknownFields.WriteTo(output);
  1346. }
  1347. #endif
  1348. }
  1349. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1350. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1351. void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
  1352. if (Types_ != 0) {
  1353. output.WriteRawTag(8);
  1354. output.WriteInt32(Types_);
  1355. }
  1356. if (Descriptor_ != 0) {
  1357. output.WriteRawTag(16);
  1358. output.WriteInt32(Descriptor_);
  1359. }
  1360. if (_unknownFields != null) {
  1361. _unknownFields.WriteTo(ref output);
  1362. }
  1363. }
  1364. #endif
  1365. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1366. public int CalculateSize() {
  1367. int size = 0;
  1368. if (Types_ != 0) {
  1369. size += 1 + pb::CodedOutputStream.ComputeInt32Size(Types_);
  1370. }
  1371. if (Descriptor_ != 0) {
  1372. size += 1 + pb::CodedOutputStream.ComputeInt32Size(Descriptor_);
  1373. }
  1374. if (_unknownFields != null) {
  1375. size += _unknownFields.CalculateSize();
  1376. }
  1377. return size;
  1378. }
  1379. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1380. public void MergeFrom(ReservedNames other) {
  1381. if (other == null) {
  1382. return;
  1383. }
  1384. if (other.Types_ != 0) {
  1385. Types_ = other.Types_;
  1386. }
  1387. if (other.Descriptor_ != 0) {
  1388. Descriptor_ = other.Descriptor_;
  1389. }
  1390. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  1391. }
  1392. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1393. public void MergeFrom(pb::CodedInputStream input) {
  1394. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1395. input.ReadRawMessage(this);
  1396. #else
  1397. uint tag;
  1398. while ((tag = input.ReadTag()) != 0) {
  1399. switch(tag) {
  1400. default:
  1401. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  1402. break;
  1403. case 8: {
  1404. Types_ = input.ReadInt32();
  1405. break;
  1406. }
  1407. case 16: {
  1408. Descriptor_ = input.ReadInt32();
  1409. break;
  1410. }
  1411. }
  1412. }
  1413. #endif
  1414. }
  1415. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1416. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1417. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  1418. uint tag;
  1419. while ((tag = input.ReadTag()) != 0) {
  1420. switch(tag) {
  1421. default:
  1422. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  1423. break;
  1424. case 8: {
  1425. Types_ = input.ReadInt32();
  1426. break;
  1427. }
  1428. case 16: {
  1429. Descriptor_ = input.ReadInt32();
  1430. break;
  1431. }
  1432. }
  1433. }
  1434. }
  1435. #endif
  1436. #region Nested types
  1437. /// <summary>Container for nested types declared in the ReservedNames message type.</summary>
  1438. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1439. public static partial class Types {
  1440. /// <summary>
  1441. /// Force a nested type called Types
  1442. /// </summary>
  1443. public sealed partial class SomeNestedType : pb::IMessage<SomeNestedType>
  1444. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1445. , pb::IBufferMessage
  1446. #endif
  1447. {
  1448. private static readonly pb::MessageParser<SomeNestedType> _parser = new pb::MessageParser<SomeNestedType>(() => new SomeNestedType());
  1449. private pb::UnknownFieldSet _unknownFields;
  1450. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1451. public static pb::MessageParser<SomeNestedType> Parser { get { return _parser; } }
  1452. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1453. public static pbr::MessageDescriptor Descriptor {
  1454. get { return global::UnitTest.Issues.TestProtos.ReservedNames.Descriptor.NestedTypes[0]; }
  1455. }
  1456. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1457. pbr::MessageDescriptor pb::IMessage.Descriptor {
  1458. get { return Descriptor; }
  1459. }
  1460. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1461. public SomeNestedType() {
  1462. OnConstruction();
  1463. }
  1464. partial void OnConstruction();
  1465. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1466. public SomeNestedType(SomeNestedType other) : this() {
  1467. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  1468. }
  1469. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1470. public SomeNestedType Clone() {
  1471. return new SomeNestedType(this);
  1472. }
  1473. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1474. public override bool Equals(object other) {
  1475. return Equals(other as SomeNestedType);
  1476. }
  1477. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1478. public bool Equals(SomeNestedType other) {
  1479. if (ReferenceEquals(other, null)) {
  1480. return false;
  1481. }
  1482. if (ReferenceEquals(other, this)) {
  1483. return true;
  1484. }
  1485. return Equals(_unknownFields, other._unknownFields);
  1486. }
  1487. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1488. public override int GetHashCode() {
  1489. int hash = 1;
  1490. if (_unknownFields != null) {
  1491. hash ^= _unknownFields.GetHashCode();
  1492. }
  1493. return hash;
  1494. }
  1495. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1496. public override string ToString() {
  1497. return pb::JsonFormatter.ToDiagnosticString(this);
  1498. }
  1499. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1500. public void WriteTo(pb::CodedOutputStream output) {
  1501. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1502. output.WriteRawMessage(this);
  1503. #else
  1504. if (_unknownFields != null) {
  1505. _unknownFields.WriteTo(output);
  1506. }
  1507. #endif
  1508. }
  1509. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1510. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1511. void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
  1512. if (_unknownFields != null) {
  1513. _unknownFields.WriteTo(ref output);
  1514. }
  1515. }
  1516. #endif
  1517. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1518. public int CalculateSize() {
  1519. int size = 0;
  1520. if (_unknownFields != null) {
  1521. size += _unknownFields.CalculateSize();
  1522. }
  1523. return size;
  1524. }
  1525. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1526. public void MergeFrom(SomeNestedType other) {
  1527. if (other == null) {
  1528. return;
  1529. }
  1530. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  1531. }
  1532. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1533. public void MergeFrom(pb::CodedInputStream input) {
  1534. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1535. input.ReadRawMessage(this);
  1536. #else
  1537. uint tag;
  1538. while ((tag = input.ReadTag()) != 0) {
  1539. switch(tag) {
  1540. default:
  1541. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  1542. break;
  1543. }
  1544. }
  1545. #endif
  1546. }
  1547. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1548. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1549. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  1550. uint tag;
  1551. while ((tag = input.ReadTag()) != 0) {
  1552. switch(tag) {
  1553. default:
  1554. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  1555. break;
  1556. }
  1557. }
  1558. }
  1559. #endif
  1560. }
  1561. }
  1562. #endregion
  1563. }
  1564. /// <summary>
  1565. /// These fields are deliberately not declared in numeric
  1566. /// order, and the oneof fields aren't contiguous either.
  1567. /// This allows for reasonably robust tests of JSON output
  1568. /// ordering.
  1569. /// TestFieldOrderings in unittest_proto3.proto is similar,
  1570. /// but doesn't include oneofs.
  1571. /// TODO: Consider adding oneofs to TestFieldOrderings, although
  1572. /// that will require fixing other tests in multiple platforms.
  1573. /// Alternatively, consider just adding this to
  1574. /// unittest_proto3.proto if multiple platforms want it.
  1575. /// </summary>
  1576. public sealed partial class TestJsonFieldOrdering : pb::IMessage<TestJsonFieldOrdering>
  1577. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1578. , pb::IBufferMessage
  1579. #endif
  1580. {
  1581. private static readonly pb::MessageParser<TestJsonFieldOrdering> _parser = new pb::MessageParser<TestJsonFieldOrdering>(() => new TestJsonFieldOrdering());
  1582. private pb::UnknownFieldSet _unknownFields;
  1583. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1584. public static pb::MessageParser<TestJsonFieldOrdering> Parser { get { return _parser; } }
  1585. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1586. public static pbr::MessageDescriptor Descriptor {
  1587. get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[6]; }
  1588. }
  1589. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1590. pbr::MessageDescriptor pb::IMessage.Descriptor {
  1591. get { return Descriptor; }
  1592. }
  1593. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1594. public TestJsonFieldOrdering() {
  1595. OnConstruction();
  1596. }
  1597. partial void OnConstruction();
  1598. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1599. public TestJsonFieldOrdering(TestJsonFieldOrdering other) : this() {
  1600. plainInt32_ = other.plainInt32_;
  1601. plainString_ = other.plainString_;
  1602. switch (other.O1Case) {
  1603. case O1OneofCase.O1String:
  1604. O1String = other.O1String;
  1605. break;
  1606. case O1OneofCase.O1Int32:
  1607. O1Int32 = other.O1Int32;
  1608. break;
  1609. }
  1610. switch (other.O2Case) {
  1611. case O2OneofCase.O2Int32:
  1612. O2Int32 = other.O2Int32;
  1613. break;
  1614. case O2OneofCase.O2String:
  1615. O2String = other.O2String;
  1616. break;
  1617. }
  1618. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  1619. }
  1620. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1621. public TestJsonFieldOrdering Clone() {
  1622. return new TestJsonFieldOrdering(this);
  1623. }
  1624. /// <summary>Field number for the "plain_int32" field.</summary>
  1625. public const int PlainInt32FieldNumber = 4;
  1626. private int plainInt32_;
  1627. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1628. public int PlainInt32 {
  1629. get { return plainInt32_; }
  1630. set {
  1631. plainInt32_ = value;
  1632. }
  1633. }
  1634. /// <summary>Field number for the "o1_string" field.</summary>
  1635. public const int O1StringFieldNumber = 2;
  1636. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1637. public string O1String {
  1638. get { return o1Case_ == O1OneofCase.O1String ? (string) o1_ : ""; }
  1639. set {
  1640. o1_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  1641. o1Case_ = O1OneofCase.O1String;
  1642. }
  1643. }
  1644. /// <summary>Field number for the "o1_int32" field.</summary>
  1645. public const int O1Int32FieldNumber = 5;
  1646. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1647. public int O1Int32 {
  1648. get { return o1Case_ == O1OneofCase.O1Int32 ? (int) o1_ : 0; }
  1649. set {
  1650. o1_ = value;
  1651. o1Case_ = O1OneofCase.O1Int32;
  1652. }
  1653. }
  1654. /// <summary>Field number for the "plain_string" field.</summary>
  1655. public const int PlainStringFieldNumber = 1;
  1656. private string plainString_ = "";
  1657. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1658. public string PlainString {
  1659. get { return plainString_; }
  1660. set {
  1661. plainString_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  1662. }
  1663. }
  1664. /// <summary>Field number for the "o2_int32" field.</summary>
  1665. public const int O2Int32FieldNumber = 6;
  1666. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1667. public int O2Int32 {
  1668. get { return o2Case_ == O2OneofCase.O2Int32 ? (int) o2_ : 0; }
  1669. set {
  1670. o2_ = value;
  1671. o2Case_ = O2OneofCase.O2Int32;
  1672. }
  1673. }
  1674. /// <summary>Field number for the "o2_string" field.</summary>
  1675. public const int O2StringFieldNumber = 3;
  1676. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1677. public string O2String {
  1678. get { return o2Case_ == O2OneofCase.O2String ? (string) o2_ : ""; }
  1679. set {
  1680. o2_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  1681. o2Case_ = O2OneofCase.O2String;
  1682. }
  1683. }
  1684. private object o1_;
  1685. /// <summary>Enum of possible cases for the "o1" oneof.</summary>
  1686. public enum O1OneofCase {
  1687. None = 0,
  1688. O1String = 2,
  1689. O1Int32 = 5,
  1690. }
  1691. private O1OneofCase o1Case_ = O1OneofCase.None;
  1692. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1693. public O1OneofCase O1Case {
  1694. get { return o1Case_; }
  1695. }
  1696. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1697. public void ClearO1() {
  1698. o1Case_ = O1OneofCase.None;
  1699. o1_ = null;
  1700. }
  1701. private object o2_;
  1702. /// <summary>Enum of possible cases for the "o2" oneof.</summary>
  1703. public enum O2OneofCase {
  1704. None = 0,
  1705. O2Int32 = 6,
  1706. O2String = 3,
  1707. }
  1708. private O2OneofCase o2Case_ = O2OneofCase.None;
  1709. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1710. public O2OneofCase O2Case {
  1711. get { return o2Case_; }
  1712. }
  1713. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1714. public void ClearO2() {
  1715. o2Case_ = O2OneofCase.None;
  1716. o2_ = null;
  1717. }
  1718. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1719. public override bool Equals(object other) {
  1720. return Equals(other as TestJsonFieldOrdering);
  1721. }
  1722. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1723. public bool Equals(TestJsonFieldOrdering other) {
  1724. if (ReferenceEquals(other, null)) {
  1725. return false;
  1726. }
  1727. if (ReferenceEquals(other, this)) {
  1728. return true;
  1729. }
  1730. if (PlainInt32 != other.PlainInt32) return false;
  1731. if (O1String != other.O1String) return false;
  1732. if (O1Int32 != other.O1Int32) return false;
  1733. if (PlainString != other.PlainString) return false;
  1734. if (O2Int32 != other.O2Int32) return false;
  1735. if (O2String != other.O2String) return false;
  1736. if (O1Case != other.O1Case) return false;
  1737. if (O2Case != other.O2Case) return false;
  1738. return Equals(_unknownFields, other._unknownFields);
  1739. }
  1740. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1741. public override int GetHashCode() {
  1742. int hash = 1;
  1743. if (PlainInt32 != 0) hash ^= PlainInt32.GetHashCode();
  1744. if (o1Case_ == O1OneofCase.O1String) hash ^= O1String.GetHashCode();
  1745. if (o1Case_ == O1OneofCase.O1Int32) hash ^= O1Int32.GetHashCode();
  1746. if (PlainString.Length != 0) hash ^= PlainString.GetHashCode();
  1747. if (o2Case_ == O2OneofCase.O2Int32) hash ^= O2Int32.GetHashCode();
  1748. if (o2Case_ == O2OneofCase.O2String) hash ^= O2String.GetHashCode();
  1749. hash ^= (int) o1Case_;
  1750. hash ^= (int) o2Case_;
  1751. if (_unknownFields != null) {
  1752. hash ^= _unknownFields.GetHashCode();
  1753. }
  1754. return hash;
  1755. }
  1756. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1757. public override string ToString() {
  1758. return pb::JsonFormatter.ToDiagnosticString(this);
  1759. }
  1760. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1761. public void WriteTo(pb::CodedOutputStream output) {
  1762. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1763. output.WriteRawMessage(this);
  1764. #else
  1765. if (PlainString.Length != 0) {
  1766. output.WriteRawTag(10);
  1767. output.WriteString(PlainString);
  1768. }
  1769. if (o1Case_ == O1OneofCase.O1String) {
  1770. output.WriteRawTag(18);
  1771. output.WriteString(O1String);
  1772. }
  1773. if (o2Case_ == O2OneofCase.O2String) {
  1774. output.WriteRawTag(26);
  1775. output.WriteString(O2String);
  1776. }
  1777. if (PlainInt32 != 0) {
  1778. output.WriteRawTag(32);
  1779. output.WriteInt32(PlainInt32);
  1780. }
  1781. if (o1Case_ == O1OneofCase.O1Int32) {
  1782. output.WriteRawTag(40);
  1783. output.WriteInt32(O1Int32);
  1784. }
  1785. if (o2Case_ == O2OneofCase.O2Int32) {
  1786. output.WriteRawTag(48);
  1787. output.WriteInt32(O2Int32);
  1788. }
  1789. if (_unknownFields != null) {
  1790. _unknownFields.WriteTo(output);
  1791. }
  1792. #endif
  1793. }
  1794. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1795. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1796. void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
  1797. if (PlainString.Length != 0) {
  1798. output.WriteRawTag(10);
  1799. output.WriteString(PlainString);
  1800. }
  1801. if (o1Case_ == O1OneofCase.O1String) {
  1802. output.WriteRawTag(18);
  1803. output.WriteString(O1String);
  1804. }
  1805. if (o2Case_ == O2OneofCase.O2String) {
  1806. output.WriteRawTag(26);
  1807. output.WriteString(O2String);
  1808. }
  1809. if (PlainInt32 != 0) {
  1810. output.WriteRawTag(32);
  1811. output.WriteInt32(PlainInt32);
  1812. }
  1813. if (o1Case_ == O1OneofCase.O1Int32) {
  1814. output.WriteRawTag(40);
  1815. output.WriteInt32(O1Int32);
  1816. }
  1817. if (o2Case_ == O2OneofCase.O2Int32) {
  1818. output.WriteRawTag(48);
  1819. output.WriteInt32(O2Int32);
  1820. }
  1821. if (_unknownFields != null) {
  1822. _unknownFields.WriteTo(ref output);
  1823. }
  1824. }
  1825. #endif
  1826. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1827. public int CalculateSize() {
  1828. int size = 0;
  1829. if (PlainInt32 != 0) {
  1830. size += 1 + pb::CodedOutputStream.ComputeInt32Size(PlainInt32);
  1831. }
  1832. if (o1Case_ == O1OneofCase.O1String) {
  1833. size += 1 + pb::CodedOutputStream.ComputeStringSize(O1String);
  1834. }
  1835. if (o1Case_ == O1OneofCase.O1Int32) {
  1836. size += 1 + pb::CodedOutputStream.ComputeInt32Size(O1Int32);
  1837. }
  1838. if (PlainString.Length != 0) {
  1839. size += 1 + pb::CodedOutputStream.ComputeStringSize(PlainString);
  1840. }
  1841. if (o2Case_ == O2OneofCase.O2Int32) {
  1842. size += 1 + pb::CodedOutputStream.ComputeInt32Size(O2Int32);
  1843. }
  1844. if (o2Case_ == O2OneofCase.O2String) {
  1845. size += 1 + pb::CodedOutputStream.ComputeStringSize(O2String);
  1846. }
  1847. if (_unknownFields != null) {
  1848. size += _unknownFields.CalculateSize();
  1849. }
  1850. return size;
  1851. }
  1852. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1853. public void MergeFrom(TestJsonFieldOrdering other) {
  1854. if (other == null) {
  1855. return;
  1856. }
  1857. if (other.PlainInt32 != 0) {
  1858. PlainInt32 = other.PlainInt32;
  1859. }
  1860. if (other.PlainString.Length != 0) {
  1861. PlainString = other.PlainString;
  1862. }
  1863. switch (other.O1Case) {
  1864. case O1OneofCase.O1String:
  1865. O1String = other.O1String;
  1866. break;
  1867. case O1OneofCase.O1Int32:
  1868. O1Int32 = other.O1Int32;
  1869. break;
  1870. }
  1871. switch (other.O2Case) {
  1872. case O2OneofCase.O2Int32:
  1873. O2Int32 = other.O2Int32;
  1874. break;
  1875. case O2OneofCase.O2String:
  1876. O2String = other.O2String;
  1877. break;
  1878. }
  1879. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  1880. }
  1881. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1882. public void MergeFrom(pb::CodedInputStream input) {
  1883. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1884. input.ReadRawMessage(this);
  1885. #else
  1886. uint tag;
  1887. while ((tag = input.ReadTag()) != 0) {
  1888. switch(tag) {
  1889. default:
  1890. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  1891. break;
  1892. case 10: {
  1893. PlainString = input.ReadString();
  1894. break;
  1895. }
  1896. case 18: {
  1897. O1String = input.ReadString();
  1898. break;
  1899. }
  1900. case 26: {
  1901. O2String = input.ReadString();
  1902. break;
  1903. }
  1904. case 32: {
  1905. PlainInt32 = input.ReadInt32();
  1906. break;
  1907. }
  1908. case 40: {
  1909. O1Int32 = input.ReadInt32();
  1910. break;
  1911. }
  1912. case 48: {
  1913. O2Int32 = input.ReadInt32();
  1914. break;
  1915. }
  1916. }
  1917. }
  1918. #endif
  1919. }
  1920. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1921. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1922. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  1923. uint tag;
  1924. while ((tag = input.ReadTag()) != 0) {
  1925. switch(tag) {
  1926. default:
  1927. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  1928. break;
  1929. case 10: {
  1930. PlainString = input.ReadString();
  1931. break;
  1932. }
  1933. case 18: {
  1934. O1String = input.ReadString();
  1935. break;
  1936. }
  1937. case 26: {
  1938. O2String = input.ReadString();
  1939. break;
  1940. }
  1941. case 32: {
  1942. PlainInt32 = input.ReadInt32();
  1943. break;
  1944. }
  1945. case 40: {
  1946. O1Int32 = input.ReadInt32();
  1947. break;
  1948. }
  1949. case 48: {
  1950. O2Int32 = input.ReadInt32();
  1951. break;
  1952. }
  1953. }
  1954. }
  1955. }
  1956. #endif
  1957. }
  1958. public sealed partial class TestJsonName : pb::IMessage<TestJsonName>
  1959. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1960. , pb::IBufferMessage
  1961. #endif
  1962. {
  1963. private static readonly pb::MessageParser<TestJsonName> _parser = new pb::MessageParser<TestJsonName>(() => new TestJsonName());
  1964. private pb::UnknownFieldSet _unknownFields;
  1965. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1966. public static pb::MessageParser<TestJsonName> Parser { get { return _parser; } }
  1967. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1968. public static pbr::MessageDescriptor Descriptor {
  1969. get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[7]; }
  1970. }
  1971. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1972. pbr::MessageDescriptor pb::IMessage.Descriptor {
  1973. get { return Descriptor; }
  1974. }
  1975. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1976. public TestJsonName() {
  1977. OnConstruction();
  1978. }
  1979. partial void OnConstruction();
  1980. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1981. public TestJsonName(TestJsonName other) : this() {
  1982. name_ = other.name_;
  1983. description_ = other.description_;
  1984. guid_ = other.guid_;
  1985. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  1986. }
  1987. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1988. public TestJsonName Clone() {
  1989. return new TestJsonName(this);
  1990. }
  1991. /// <summary>Field number for the "name" field.</summary>
  1992. public const int NameFieldNumber = 1;
  1993. private string name_ = "";
  1994. /// <summary>
  1995. /// Message for testing the effects for of the json_name option
  1996. /// </summary>
  1997. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1998. public string Name {
  1999. get { return name_; }
  2000. set {
  2001. name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  2002. }
  2003. }
  2004. /// <summary>Field number for the "description" field.</summary>
  2005. public const int DescriptionFieldNumber = 2;
  2006. private string description_ = "";
  2007. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2008. public string Description {
  2009. get { return description_; }
  2010. set {
  2011. description_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  2012. }
  2013. }
  2014. /// <summary>Field number for the "guid" field.</summary>
  2015. public const int GuidFieldNumber = 3;
  2016. private string guid_ = "";
  2017. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2018. public string Guid {
  2019. get { return guid_; }
  2020. set {
  2021. guid_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  2022. }
  2023. }
  2024. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2025. public override bool Equals(object other) {
  2026. return Equals(other as TestJsonName);
  2027. }
  2028. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2029. public bool Equals(TestJsonName other) {
  2030. if (ReferenceEquals(other, null)) {
  2031. return false;
  2032. }
  2033. if (ReferenceEquals(other, this)) {
  2034. return true;
  2035. }
  2036. if (Name != other.Name) return false;
  2037. if (Description != other.Description) return false;
  2038. if (Guid != other.Guid) return false;
  2039. return Equals(_unknownFields, other._unknownFields);
  2040. }
  2041. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2042. public override int GetHashCode() {
  2043. int hash = 1;
  2044. if (Name.Length != 0) hash ^= Name.GetHashCode();
  2045. if (Description.Length != 0) hash ^= Description.GetHashCode();
  2046. if (Guid.Length != 0) hash ^= Guid.GetHashCode();
  2047. if (_unknownFields != null) {
  2048. hash ^= _unknownFields.GetHashCode();
  2049. }
  2050. return hash;
  2051. }
  2052. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2053. public override string ToString() {
  2054. return pb::JsonFormatter.ToDiagnosticString(this);
  2055. }
  2056. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2057. public void WriteTo(pb::CodedOutputStream output) {
  2058. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  2059. output.WriteRawMessage(this);
  2060. #else
  2061. if (Name.Length != 0) {
  2062. output.WriteRawTag(10);
  2063. output.WriteString(Name);
  2064. }
  2065. if (Description.Length != 0) {
  2066. output.WriteRawTag(18);
  2067. output.WriteString(Description);
  2068. }
  2069. if (Guid.Length != 0) {
  2070. output.WriteRawTag(26);
  2071. output.WriteString(Guid);
  2072. }
  2073. if (_unknownFields != null) {
  2074. _unknownFields.WriteTo(output);
  2075. }
  2076. #endif
  2077. }
  2078. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  2079. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2080. void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
  2081. if (Name.Length != 0) {
  2082. output.WriteRawTag(10);
  2083. output.WriteString(Name);
  2084. }
  2085. if (Description.Length != 0) {
  2086. output.WriteRawTag(18);
  2087. output.WriteString(Description);
  2088. }
  2089. if (Guid.Length != 0) {
  2090. output.WriteRawTag(26);
  2091. output.WriteString(Guid);
  2092. }
  2093. if (_unknownFields != null) {
  2094. _unknownFields.WriteTo(ref output);
  2095. }
  2096. }
  2097. #endif
  2098. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2099. public int CalculateSize() {
  2100. int size = 0;
  2101. if (Name.Length != 0) {
  2102. size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
  2103. }
  2104. if (Description.Length != 0) {
  2105. size += 1 + pb::CodedOutputStream.ComputeStringSize(Description);
  2106. }
  2107. if (Guid.Length != 0) {
  2108. size += 1 + pb::CodedOutputStream.ComputeStringSize(Guid);
  2109. }
  2110. if (_unknownFields != null) {
  2111. size += _unknownFields.CalculateSize();
  2112. }
  2113. return size;
  2114. }
  2115. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2116. public void MergeFrom(TestJsonName other) {
  2117. if (other == null) {
  2118. return;
  2119. }
  2120. if (other.Name.Length != 0) {
  2121. Name = other.Name;
  2122. }
  2123. if (other.Description.Length != 0) {
  2124. Description = other.Description;
  2125. }
  2126. if (other.Guid.Length != 0) {
  2127. Guid = other.Guid;
  2128. }
  2129. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  2130. }
  2131. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2132. public void MergeFrom(pb::CodedInputStream input) {
  2133. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  2134. input.ReadRawMessage(this);
  2135. #else
  2136. uint tag;
  2137. while ((tag = input.ReadTag()) != 0) {
  2138. switch(tag) {
  2139. default:
  2140. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  2141. break;
  2142. case 10: {
  2143. Name = input.ReadString();
  2144. break;
  2145. }
  2146. case 18: {
  2147. Description = input.ReadString();
  2148. break;
  2149. }
  2150. case 26: {
  2151. Guid = input.ReadString();
  2152. break;
  2153. }
  2154. }
  2155. }
  2156. #endif
  2157. }
  2158. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  2159. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2160. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  2161. uint tag;
  2162. while ((tag = input.ReadTag()) != 0) {
  2163. switch(tag) {
  2164. default:
  2165. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  2166. break;
  2167. case 10: {
  2168. Name = input.ReadString();
  2169. break;
  2170. }
  2171. case 18: {
  2172. Description = input.ReadString();
  2173. break;
  2174. }
  2175. case 26: {
  2176. Guid = input.ReadString();
  2177. break;
  2178. }
  2179. }
  2180. }
  2181. }
  2182. #endif
  2183. }
  2184. /// <summary>
  2185. /// Issue 3200: When merging two messages which use the same
  2186. /// oneof case, which is itself a message type, the submessages should
  2187. /// be merged.
  2188. /// </summary>
  2189. public sealed partial class OneofMerging : pb::IMessage<OneofMerging>
  2190. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  2191. , pb::IBufferMessage
  2192. #endif
  2193. {
  2194. private static readonly pb::MessageParser<OneofMerging> _parser = new pb::MessageParser<OneofMerging>(() => new OneofMerging());
  2195. private pb::UnknownFieldSet _unknownFields;
  2196. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2197. public static pb::MessageParser<OneofMerging> Parser { get { return _parser; } }
  2198. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2199. public static pbr::MessageDescriptor Descriptor {
  2200. get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[8]; }
  2201. }
  2202. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2203. pbr::MessageDescriptor pb::IMessage.Descriptor {
  2204. get { return Descriptor; }
  2205. }
  2206. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2207. public OneofMerging() {
  2208. OnConstruction();
  2209. }
  2210. partial void OnConstruction();
  2211. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2212. public OneofMerging(OneofMerging other) : this() {
  2213. switch (other.ValueCase) {
  2214. case ValueOneofCase.Text:
  2215. Text = other.Text;
  2216. break;
  2217. case ValueOneofCase.Nested:
  2218. Nested = other.Nested.Clone();
  2219. break;
  2220. }
  2221. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  2222. }
  2223. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2224. public OneofMerging Clone() {
  2225. return new OneofMerging(this);
  2226. }
  2227. /// <summary>Field number for the "text" field.</summary>
  2228. public const int TextFieldNumber = 1;
  2229. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2230. public string Text {
  2231. get { return valueCase_ == ValueOneofCase.Text ? (string) value_ : ""; }
  2232. set {
  2233. value_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  2234. valueCase_ = ValueOneofCase.Text;
  2235. }
  2236. }
  2237. /// <summary>Field number for the "nested" field.</summary>
  2238. public const int NestedFieldNumber = 2;
  2239. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2240. public global::UnitTest.Issues.TestProtos.OneofMerging.Types.Nested Nested {
  2241. get { return valueCase_ == ValueOneofCase.Nested ? (global::UnitTest.Issues.TestProtos.OneofMerging.Types.Nested) value_ : null; }
  2242. set {
  2243. value_ = value;
  2244. valueCase_ = value == null ? ValueOneofCase.None : ValueOneofCase.Nested;
  2245. }
  2246. }
  2247. private object value_;
  2248. /// <summary>Enum of possible cases for the "value" oneof.</summary>
  2249. public enum ValueOneofCase {
  2250. None = 0,
  2251. Text = 1,
  2252. Nested = 2,
  2253. }
  2254. private ValueOneofCase valueCase_ = ValueOneofCase.None;
  2255. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2256. public ValueOneofCase ValueCase {
  2257. get { return valueCase_; }
  2258. }
  2259. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2260. public void ClearValue() {
  2261. valueCase_ = ValueOneofCase.None;
  2262. value_ = null;
  2263. }
  2264. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2265. public override bool Equals(object other) {
  2266. return Equals(other as OneofMerging);
  2267. }
  2268. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2269. public bool Equals(OneofMerging other) {
  2270. if (ReferenceEquals(other, null)) {
  2271. return false;
  2272. }
  2273. if (ReferenceEquals(other, this)) {
  2274. return true;
  2275. }
  2276. if (Text != other.Text) return false;
  2277. if (!object.Equals(Nested, other.Nested)) return false;
  2278. if (ValueCase != other.ValueCase) return false;
  2279. return Equals(_unknownFields, other._unknownFields);
  2280. }
  2281. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2282. public override int GetHashCode() {
  2283. int hash = 1;
  2284. if (valueCase_ == ValueOneofCase.Text) hash ^= Text.GetHashCode();
  2285. if (valueCase_ == ValueOneofCase.Nested) hash ^= Nested.GetHashCode();
  2286. hash ^= (int) valueCase_;
  2287. if (_unknownFields != null) {
  2288. hash ^= _unknownFields.GetHashCode();
  2289. }
  2290. return hash;
  2291. }
  2292. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2293. public override string ToString() {
  2294. return pb::JsonFormatter.ToDiagnosticString(this);
  2295. }
  2296. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2297. public void WriteTo(pb::CodedOutputStream output) {
  2298. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  2299. output.WriteRawMessage(this);
  2300. #else
  2301. if (valueCase_ == ValueOneofCase.Text) {
  2302. output.WriteRawTag(10);
  2303. output.WriteString(Text);
  2304. }
  2305. if (valueCase_ == ValueOneofCase.Nested) {
  2306. output.WriteRawTag(18);
  2307. output.WriteMessage(Nested);
  2308. }
  2309. if (_unknownFields != null) {
  2310. _unknownFields.WriteTo(output);
  2311. }
  2312. #endif
  2313. }
  2314. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  2315. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2316. void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
  2317. if (valueCase_ == ValueOneofCase.Text) {
  2318. output.WriteRawTag(10);
  2319. output.WriteString(Text);
  2320. }
  2321. if (valueCase_ == ValueOneofCase.Nested) {
  2322. output.WriteRawTag(18);
  2323. output.WriteMessage(Nested);
  2324. }
  2325. if (_unknownFields != null) {
  2326. _unknownFields.WriteTo(ref output);
  2327. }
  2328. }
  2329. #endif
  2330. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2331. public int CalculateSize() {
  2332. int size = 0;
  2333. if (valueCase_ == ValueOneofCase.Text) {
  2334. size += 1 + pb::CodedOutputStream.ComputeStringSize(Text);
  2335. }
  2336. if (valueCase_ == ValueOneofCase.Nested) {
  2337. size += 1 + pb::CodedOutputStream.ComputeMessageSize(Nested);
  2338. }
  2339. if (_unknownFields != null) {
  2340. size += _unknownFields.CalculateSize();
  2341. }
  2342. return size;
  2343. }
  2344. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2345. public void MergeFrom(OneofMerging other) {
  2346. if (other == null) {
  2347. return;
  2348. }
  2349. switch (other.ValueCase) {
  2350. case ValueOneofCase.Text:
  2351. Text = other.Text;
  2352. break;
  2353. case ValueOneofCase.Nested:
  2354. if (Nested == null) {
  2355. Nested = new global::UnitTest.Issues.TestProtos.OneofMerging.Types.Nested();
  2356. }
  2357. Nested.MergeFrom(other.Nested);
  2358. break;
  2359. }
  2360. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  2361. }
  2362. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2363. public void MergeFrom(pb::CodedInputStream input) {
  2364. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  2365. input.ReadRawMessage(this);
  2366. #else
  2367. uint tag;
  2368. while ((tag = input.ReadTag()) != 0) {
  2369. switch(tag) {
  2370. default:
  2371. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  2372. break;
  2373. case 10: {
  2374. Text = input.ReadString();
  2375. break;
  2376. }
  2377. case 18: {
  2378. global::UnitTest.Issues.TestProtos.OneofMerging.Types.Nested subBuilder = new global::UnitTest.Issues.TestProtos.OneofMerging.Types.Nested();
  2379. if (valueCase_ == ValueOneofCase.Nested) {
  2380. subBuilder.MergeFrom(Nested);
  2381. }
  2382. input.ReadMessage(subBuilder);
  2383. Nested = subBuilder;
  2384. break;
  2385. }
  2386. }
  2387. }
  2388. #endif
  2389. }
  2390. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  2391. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2392. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  2393. uint tag;
  2394. while ((tag = input.ReadTag()) != 0) {
  2395. switch(tag) {
  2396. default:
  2397. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  2398. break;
  2399. case 10: {
  2400. Text = input.ReadString();
  2401. break;
  2402. }
  2403. case 18: {
  2404. global::UnitTest.Issues.TestProtos.OneofMerging.Types.Nested subBuilder = new global::UnitTest.Issues.TestProtos.OneofMerging.Types.Nested();
  2405. if (valueCase_ == ValueOneofCase.Nested) {
  2406. subBuilder.MergeFrom(Nested);
  2407. }
  2408. input.ReadMessage(subBuilder);
  2409. Nested = subBuilder;
  2410. break;
  2411. }
  2412. }
  2413. }
  2414. }
  2415. #endif
  2416. #region Nested types
  2417. /// <summary>Container for nested types declared in the OneofMerging message type.</summary>
  2418. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2419. public static partial class Types {
  2420. public sealed partial class Nested : pb::IMessage<Nested>
  2421. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  2422. , pb::IBufferMessage
  2423. #endif
  2424. {
  2425. private static readonly pb::MessageParser<Nested> _parser = new pb::MessageParser<Nested>(() => new Nested());
  2426. private pb::UnknownFieldSet _unknownFields;
  2427. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2428. public static pb::MessageParser<Nested> Parser { get { return _parser; } }
  2429. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2430. public static pbr::MessageDescriptor Descriptor {
  2431. get { return global::UnitTest.Issues.TestProtos.OneofMerging.Descriptor.NestedTypes[0]; }
  2432. }
  2433. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2434. pbr::MessageDescriptor pb::IMessage.Descriptor {
  2435. get { return Descriptor; }
  2436. }
  2437. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2438. public Nested() {
  2439. OnConstruction();
  2440. }
  2441. partial void OnConstruction();
  2442. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2443. public Nested(Nested other) : this() {
  2444. x_ = other.x_;
  2445. y_ = other.y_;
  2446. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  2447. }
  2448. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2449. public Nested Clone() {
  2450. return new Nested(this);
  2451. }
  2452. /// <summary>Field number for the "x" field.</summary>
  2453. public const int XFieldNumber = 1;
  2454. private int x_;
  2455. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2456. public int X {
  2457. get { return x_; }
  2458. set {
  2459. x_ = value;
  2460. }
  2461. }
  2462. /// <summary>Field number for the "y" field.</summary>
  2463. public const int YFieldNumber = 2;
  2464. private int y_;
  2465. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2466. public int Y {
  2467. get { return y_; }
  2468. set {
  2469. y_ = value;
  2470. }
  2471. }
  2472. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2473. public override bool Equals(object other) {
  2474. return Equals(other as Nested);
  2475. }
  2476. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2477. public bool Equals(Nested other) {
  2478. if (ReferenceEquals(other, null)) {
  2479. return false;
  2480. }
  2481. if (ReferenceEquals(other, this)) {
  2482. return true;
  2483. }
  2484. if (X != other.X) return false;
  2485. if (Y != other.Y) return false;
  2486. return Equals(_unknownFields, other._unknownFields);
  2487. }
  2488. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2489. public override int GetHashCode() {
  2490. int hash = 1;
  2491. if (X != 0) hash ^= X.GetHashCode();
  2492. if (Y != 0) hash ^= Y.GetHashCode();
  2493. if (_unknownFields != null) {
  2494. hash ^= _unknownFields.GetHashCode();
  2495. }
  2496. return hash;
  2497. }
  2498. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2499. public override string ToString() {
  2500. return pb::JsonFormatter.ToDiagnosticString(this);
  2501. }
  2502. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2503. public void WriteTo(pb::CodedOutputStream output) {
  2504. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  2505. output.WriteRawMessage(this);
  2506. #else
  2507. if (X != 0) {
  2508. output.WriteRawTag(8);
  2509. output.WriteInt32(X);
  2510. }
  2511. if (Y != 0) {
  2512. output.WriteRawTag(16);
  2513. output.WriteInt32(Y);
  2514. }
  2515. if (_unknownFields != null) {
  2516. _unknownFields.WriteTo(output);
  2517. }
  2518. #endif
  2519. }
  2520. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  2521. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2522. void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
  2523. if (X != 0) {
  2524. output.WriteRawTag(8);
  2525. output.WriteInt32(X);
  2526. }
  2527. if (Y != 0) {
  2528. output.WriteRawTag(16);
  2529. output.WriteInt32(Y);
  2530. }
  2531. if (_unknownFields != null) {
  2532. _unknownFields.WriteTo(ref output);
  2533. }
  2534. }
  2535. #endif
  2536. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2537. public int CalculateSize() {
  2538. int size = 0;
  2539. if (X != 0) {
  2540. size += 1 + pb::CodedOutputStream.ComputeInt32Size(X);
  2541. }
  2542. if (Y != 0) {
  2543. size += 1 + pb::CodedOutputStream.ComputeInt32Size(Y);
  2544. }
  2545. if (_unknownFields != null) {
  2546. size += _unknownFields.CalculateSize();
  2547. }
  2548. return size;
  2549. }
  2550. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2551. public void MergeFrom(Nested other) {
  2552. if (other == null) {
  2553. return;
  2554. }
  2555. if (other.X != 0) {
  2556. X = other.X;
  2557. }
  2558. if (other.Y != 0) {
  2559. Y = other.Y;
  2560. }
  2561. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  2562. }
  2563. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2564. public void MergeFrom(pb::CodedInputStream input) {
  2565. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  2566. input.ReadRawMessage(this);
  2567. #else
  2568. uint tag;
  2569. while ((tag = input.ReadTag()) != 0) {
  2570. switch(tag) {
  2571. default:
  2572. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  2573. break;
  2574. case 8: {
  2575. X = input.ReadInt32();
  2576. break;
  2577. }
  2578. case 16: {
  2579. Y = input.ReadInt32();
  2580. break;
  2581. }
  2582. }
  2583. }
  2584. #endif
  2585. }
  2586. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  2587. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2588. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  2589. uint tag;
  2590. while ((tag = input.ReadTag()) != 0) {
  2591. switch(tag) {
  2592. default:
  2593. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  2594. break;
  2595. case 8: {
  2596. X = input.ReadInt32();
  2597. break;
  2598. }
  2599. case 16: {
  2600. Y = input.ReadInt32();
  2601. break;
  2602. }
  2603. }
  2604. }
  2605. }
  2606. #endif
  2607. }
  2608. }
  2609. #endregion
  2610. }
  2611. public sealed partial class NullValueOutsideStruct : pb::IMessage<NullValueOutsideStruct>
  2612. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  2613. , pb::IBufferMessage
  2614. #endif
  2615. {
  2616. private static readonly pb::MessageParser<NullValueOutsideStruct> _parser = new pb::MessageParser<NullValueOutsideStruct>(() => new NullValueOutsideStruct());
  2617. private pb::UnknownFieldSet _unknownFields;
  2618. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2619. public static pb::MessageParser<NullValueOutsideStruct> Parser { get { return _parser; } }
  2620. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2621. public static pbr::MessageDescriptor Descriptor {
  2622. get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[9]; }
  2623. }
  2624. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2625. pbr::MessageDescriptor pb::IMessage.Descriptor {
  2626. get { return Descriptor; }
  2627. }
  2628. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2629. public NullValueOutsideStruct() {
  2630. OnConstruction();
  2631. }
  2632. partial void OnConstruction();
  2633. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2634. public NullValueOutsideStruct(NullValueOutsideStruct other) : this() {
  2635. switch (other.ValueCase) {
  2636. case ValueOneofCase.StringValue:
  2637. StringValue = other.StringValue;
  2638. break;
  2639. case ValueOneofCase.NullValue:
  2640. NullValue = other.NullValue;
  2641. break;
  2642. }
  2643. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  2644. }
  2645. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2646. public NullValueOutsideStruct Clone() {
  2647. return new NullValueOutsideStruct(this);
  2648. }
  2649. /// <summary>Field number for the "string_value" field.</summary>
  2650. public const int StringValueFieldNumber = 1;
  2651. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2652. public string StringValue {
  2653. get { return valueCase_ == ValueOneofCase.StringValue ? (string) value_ : ""; }
  2654. set {
  2655. value_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  2656. valueCase_ = ValueOneofCase.StringValue;
  2657. }
  2658. }
  2659. /// <summary>Field number for the "null_value" field.</summary>
  2660. public const int NullValueFieldNumber = 2;
  2661. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2662. public global::Google.Protobuf.WellKnownTypes.NullValue NullValue {
  2663. get { return valueCase_ == ValueOneofCase.NullValue ? (global::Google.Protobuf.WellKnownTypes.NullValue) value_ : global::Google.Protobuf.WellKnownTypes.NullValue.NullValue; }
  2664. set {
  2665. value_ = value;
  2666. valueCase_ = ValueOneofCase.NullValue;
  2667. }
  2668. }
  2669. private object value_;
  2670. /// <summary>Enum of possible cases for the "value" oneof.</summary>
  2671. public enum ValueOneofCase {
  2672. None = 0,
  2673. StringValue = 1,
  2674. NullValue = 2,
  2675. }
  2676. private ValueOneofCase valueCase_ = ValueOneofCase.None;
  2677. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2678. public ValueOneofCase ValueCase {
  2679. get { return valueCase_; }
  2680. }
  2681. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2682. public void ClearValue() {
  2683. valueCase_ = ValueOneofCase.None;
  2684. value_ = null;
  2685. }
  2686. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2687. public override bool Equals(object other) {
  2688. return Equals(other as NullValueOutsideStruct);
  2689. }
  2690. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2691. public bool Equals(NullValueOutsideStruct other) {
  2692. if (ReferenceEquals(other, null)) {
  2693. return false;
  2694. }
  2695. if (ReferenceEquals(other, this)) {
  2696. return true;
  2697. }
  2698. if (StringValue != other.StringValue) return false;
  2699. if (NullValue != other.NullValue) return false;
  2700. if (ValueCase != other.ValueCase) return false;
  2701. return Equals(_unknownFields, other._unknownFields);
  2702. }
  2703. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2704. public override int GetHashCode() {
  2705. int hash = 1;
  2706. if (valueCase_ == ValueOneofCase.StringValue) hash ^= StringValue.GetHashCode();
  2707. if (valueCase_ == ValueOneofCase.NullValue) hash ^= NullValue.GetHashCode();
  2708. hash ^= (int) valueCase_;
  2709. if (_unknownFields != null) {
  2710. hash ^= _unknownFields.GetHashCode();
  2711. }
  2712. return hash;
  2713. }
  2714. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2715. public override string ToString() {
  2716. return pb::JsonFormatter.ToDiagnosticString(this);
  2717. }
  2718. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2719. public void WriteTo(pb::CodedOutputStream output) {
  2720. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  2721. output.WriteRawMessage(this);
  2722. #else
  2723. if (valueCase_ == ValueOneofCase.StringValue) {
  2724. output.WriteRawTag(10);
  2725. output.WriteString(StringValue);
  2726. }
  2727. if (valueCase_ == ValueOneofCase.NullValue) {
  2728. output.WriteRawTag(16);
  2729. output.WriteEnum((int) NullValue);
  2730. }
  2731. if (_unknownFields != null) {
  2732. _unknownFields.WriteTo(output);
  2733. }
  2734. #endif
  2735. }
  2736. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  2737. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2738. void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
  2739. if (valueCase_ == ValueOneofCase.StringValue) {
  2740. output.WriteRawTag(10);
  2741. output.WriteString(StringValue);
  2742. }
  2743. if (valueCase_ == ValueOneofCase.NullValue) {
  2744. output.WriteRawTag(16);
  2745. output.WriteEnum((int) NullValue);
  2746. }
  2747. if (_unknownFields != null) {
  2748. _unknownFields.WriteTo(ref output);
  2749. }
  2750. }
  2751. #endif
  2752. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2753. public int CalculateSize() {
  2754. int size = 0;
  2755. if (valueCase_ == ValueOneofCase.StringValue) {
  2756. size += 1 + pb::CodedOutputStream.ComputeStringSize(StringValue);
  2757. }
  2758. if (valueCase_ == ValueOneofCase.NullValue) {
  2759. size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) NullValue);
  2760. }
  2761. if (_unknownFields != null) {
  2762. size += _unknownFields.CalculateSize();
  2763. }
  2764. return size;
  2765. }
  2766. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2767. public void MergeFrom(NullValueOutsideStruct other) {
  2768. if (other == null) {
  2769. return;
  2770. }
  2771. switch (other.ValueCase) {
  2772. case ValueOneofCase.StringValue:
  2773. StringValue = other.StringValue;
  2774. break;
  2775. case ValueOneofCase.NullValue:
  2776. NullValue = other.NullValue;
  2777. break;
  2778. }
  2779. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  2780. }
  2781. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2782. public void MergeFrom(pb::CodedInputStream input) {
  2783. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  2784. input.ReadRawMessage(this);
  2785. #else
  2786. uint tag;
  2787. while ((tag = input.ReadTag()) != 0) {
  2788. switch(tag) {
  2789. default:
  2790. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  2791. break;
  2792. case 10: {
  2793. StringValue = input.ReadString();
  2794. break;
  2795. }
  2796. case 16: {
  2797. value_ = input.ReadEnum();
  2798. valueCase_ = ValueOneofCase.NullValue;
  2799. break;
  2800. }
  2801. }
  2802. }
  2803. #endif
  2804. }
  2805. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  2806. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2807. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  2808. uint tag;
  2809. while ((tag = input.ReadTag()) != 0) {
  2810. switch(tag) {
  2811. default:
  2812. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  2813. break;
  2814. case 10: {
  2815. StringValue = input.ReadString();
  2816. break;
  2817. }
  2818. case 16: {
  2819. value_ = input.ReadEnum();
  2820. valueCase_ = ValueOneofCase.NullValue;
  2821. break;
  2822. }
  2823. }
  2824. }
  2825. }
  2826. #endif
  2827. }
  2828. public sealed partial class NullValueNotInOneof : pb::IMessage<NullValueNotInOneof>
  2829. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  2830. , pb::IBufferMessage
  2831. #endif
  2832. {
  2833. private static readonly pb::MessageParser<NullValueNotInOneof> _parser = new pb::MessageParser<NullValueNotInOneof>(() => new NullValueNotInOneof());
  2834. private pb::UnknownFieldSet _unknownFields;
  2835. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2836. public static pb::MessageParser<NullValueNotInOneof> Parser { get { return _parser; } }
  2837. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2838. public static pbr::MessageDescriptor Descriptor {
  2839. get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[10]; }
  2840. }
  2841. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2842. pbr::MessageDescriptor pb::IMessage.Descriptor {
  2843. get { return Descriptor; }
  2844. }
  2845. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2846. public NullValueNotInOneof() {
  2847. OnConstruction();
  2848. }
  2849. partial void OnConstruction();
  2850. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2851. public NullValueNotInOneof(NullValueNotInOneof other) : this() {
  2852. nullValue_ = other.nullValue_;
  2853. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  2854. }
  2855. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2856. public NullValueNotInOneof Clone() {
  2857. return new NullValueNotInOneof(this);
  2858. }
  2859. /// <summary>Field number for the "null_value" field.</summary>
  2860. public const int NullValueFieldNumber = 2;
  2861. private global::Google.Protobuf.WellKnownTypes.NullValue nullValue_ = global::Google.Protobuf.WellKnownTypes.NullValue.NullValue;
  2862. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2863. public global::Google.Protobuf.WellKnownTypes.NullValue NullValue {
  2864. get { return nullValue_; }
  2865. set {
  2866. nullValue_ = value;
  2867. }
  2868. }
  2869. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2870. public override bool Equals(object other) {
  2871. return Equals(other as NullValueNotInOneof);
  2872. }
  2873. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2874. public bool Equals(NullValueNotInOneof other) {
  2875. if (ReferenceEquals(other, null)) {
  2876. return false;
  2877. }
  2878. if (ReferenceEquals(other, this)) {
  2879. return true;
  2880. }
  2881. if (NullValue != other.NullValue) return false;
  2882. return Equals(_unknownFields, other._unknownFields);
  2883. }
  2884. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2885. public override int GetHashCode() {
  2886. int hash = 1;
  2887. if (NullValue != global::Google.Protobuf.WellKnownTypes.NullValue.NullValue) hash ^= NullValue.GetHashCode();
  2888. if (_unknownFields != null) {
  2889. hash ^= _unknownFields.GetHashCode();
  2890. }
  2891. return hash;
  2892. }
  2893. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2894. public override string ToString() {
  2895. return pb::JsonFormatter.ToDiagnosticString(this);
  2896. }
  2897. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2898. public void WriteTo(pb::CodedOutputStream output) {
  2899. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  2900. output.WriteRawMessage(this);
  2901. #else
  2902. if (NullValue != global::Google.Protobuf.WellKnownTypes.NullValue.NullValue) {
  2903. output.WriteRawTag(16);
  2904. output.WriteEnum((int) NullValue);
  2905. }
  2906. if (_unknownFields != null) {
  2907. _unknownFields.WriteTo(output);
  2908. }
  2909. #endif
  2910. }
  2911. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  2912. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2913. void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
  2914. if (NullValue != global::Google.Protobuf.WellKnownTypes.NullValue.NullValue) {
  2915. output.WriteRawTag(16);
  2916. output.WriteEnum((int) NullValue);
  2917. }
  2918. if (_unknownFields != null) {
  2919. _unknownFields.WriteTo(ref output);
  2920. }
  2921. }
  2922. #endif
  2923. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2924. public int CalculateSize() {
  2925. int size = 0;
  2926. if (NullValue != global::Google.Protobuf.WellKnownTypes.NullValue.NullValue) {
  2927. size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) NullValue);
  2928. }
  2929. if (_unknownFields != null) {
  2930. size += _unknownFields.CalculateSize();
  2931. }
  2932. return size;
  2933. }
  2934. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2935. public void MergeFrom(NullValueNotInOneof other) {
  2936. if (other == null) {
  2937. return;
  2938. }
  2939. if (other.NullValue != global::Google.Protobuf.WellKnownTypes.NullValue.NullValue) {
  2940. NullValue = other.NullValue;
  2941. }
  2942. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  2943. }
  2944. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2945. public void MergeFrom(pb::CodedInputStream input) {
  2946. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  2947. input.ReadRawMessage(this);
  2948. #else
  2949. uint tag;
  2950. while ((tag = input.ReadTag()) != 0) {
  2951. switch(tag) {
  2952. default:
  2953. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  2954. break;
  2955. case 16: {
  2956. NullValue = (global::Google.Protobuf.WellKnownTypes.NullValue) input.ReadEnum();
  2957. break;
  2958. }
  2959. }
  2960. }
  2961. #endif
  2962. }
  2963. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  2964. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  2965. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  2966. uint tag;
  2967. while ((tag = input.ReadTag()) != 0) {
  2968. switch(tag) {
  2969. default:
  2970. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  2971. break;
  2972. case 16: {
  2973. NullValue = (global::Google.Protobuf.WellKnownTypes.NullValue) input.ReadEnum();
  2974. break;
  2975. }
  2976. }
  2977. }
  2978. }
  2979. #endif
  2980. }
  2981. #endregion
  2982. }
  2983. #endregion Designer generated code