UnittestIssues.cs 121 KB

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