UnittestIssues.cs 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: unittest_issues.proto
  3. #pragma warning disable 1591, 0612, 3021
  4. #region Designer generated code
  5. using pb = global::Google.Protobuf;
  6. using pbc = global::Google.Protobuf.Collections;
  7. using pbr = global::Google.Protobuf.Reflection;
  8. using scg = global::System.Collections.Generic;
  9. namespace UnitTest.Issues.TestProtos {
  10. /// <summary>Holder for reflection information generated from unittest_issues.proto</summary>
  11. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  12. public static partial class UnittestIssuesReflection {
  13. #region Descriptor
  14. /// <summary>File descriptor for unittest_issues.proto</summary>
  15. public static pbr::FileDescriptor Descriptor {
  16. get { return descriptor; }
  17. }
  18. private static pbr::FileDescriptor descriptor;
  19. static UnittestIssuesReflection() {
  20. byte[] descriptorData = global::System.Convert.FromBase64String(
  21. string.Concat(
  22. "ChV1bml0dGVzdF9pc3N1ZXMucHJvdG8SD3VuaXR0ZXN0X2lzc3VlcyInCghJ",
  23. "c3N1ZTMwNxobCgpOZXN0ZWRPbmNlGg0KC05lc3RlZFR3aWNlIrABChNOZWdh",
  24. "dGl2ZUVudW1NZXNzYWdlEiwKBXZhbHVlGAEgASgOMh0udW5pdHRlc3RfaXNz",
  25. "dWVzLk5lZ2F0aXZlRW51bRIxCgZ2YWx1ZXMYAiADKA4yHS51bml0dGVzdF9p",
  26. "c3N1ZXMuTmVnYXRpdmVFbnVtQgIQABI4Cg1wYWNrZWRfdmFsdWVzGAMgAygO",
  27. "Mh0udW5pdHRlc3RfaXNzdWVzLk5lZ2F0aXZlRW51bUICEAEiEQoPRGVwcmVj",
  28. "YXRlZENoaWxkIrkCChdEZXByZWNhdGVkRmllbGRzTWVzc2FnZRIaCg5Qcmlt",
  29. "aXRpdmVWYWx1ZRgBIAEoBUICGAESGgoOUHJpbWl0aXZlQXJyYXkYAiADKAVC",
  30. "AhgBEjoKDE1lc3NhZ2VWYWx1ZRgDIAEoCzIgLnVuaXR0ZXN0X2lzc3Vlcy5E",
  31. "ZXByZWNhdGVkQ2hpbGRCAhgBEjoKDE1lc3NhZ2VBcnJheRgEIAMoCzIgLnVu",
  32. "aXR0ZXN0X2lzc3Vlcy5EZXByZWNhdGVkQ2hpbGRCAhgBEjYKCUVudW1WYWx1",
  33. "ZRgFIAEoDjIfLnVuaXR0ZXN0X2lzc3Vlcy5EZXByZWNhdGVkRW51bUICGAES",
  34. "NgoJRW51bUFycmF5GAYgAygOMh8udW5pdHRlc3RfaXNzdWVzLkRlcHJlY2F0",
  35. "ZWRFbnVtQgIYASIZCglJdGVtRmllbGQSDAoEaXRlbRgBIAEoBSJECg1SZXNl",
  36. "cnZlZE5hbWVzEg0KBXR5cGVzGAEgASgFEhIKCmRlc2NyaXB0b3IYAiABKAUa",
  37. "EAoOU29tZU5lc3RlZFR5cGUioAEKFVRlc3RKc29uRmllbGRPcmRlcmluZxIT",
  38. "CgtwbGFpbl9pbnQzMhgEIAEoBRITCglvMV9zdHJpbmcYAiABKAlIABISCghv",
  39. "MV9pbnQzMhgFIAEoBUgAEhQKDHBsYWluX3N0cmluZxgBIAEoCRISCghvMl9p",
  40. "bnQzMhgGIAEoBUgBEhMKCW8yX3N0cmluZxgDIAEoCUgBQgQKAm8xQgQKAm8y",
  41. "IksKDFRlc3RKc29uTmFtZRIMCgRuYW1lGAEgASgJEhkKC2Rlc2NyaXB0aW9u",
  42. "GAIgASgJUgRkZXNjEhIKBGd1aWQYAyABKAlSBGV4aWQqVQoMTmVnYXRpdmVF",
  43. "bnVtEhYKEk5FR0FUSVZFX0VOVU1fWkVSTxAAEhYKCUZpdmVCZWxvdxD7////",
  44. "//////8BEhUKCE1pbnVzT25lEP///////////wEqLgoORGVwcmVjYXRlZEVu",
  45. "dW0SEwoPREVQUkVDQVRFRF9aRVJPEAASBwoDb25lEAFCH0gBqgIaVW5pdFRl",
  46. "c3QuSXNzdWVzLlRlc3RQcm90b3NiBnByb3RvMw=="));
  47. descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
  48. new pbr::FileDescriptor[] { },
  49. new pbr::GeneratedClrTypeInfo(new[] {typeof(global::UnitTest.Issues.TestProtos.NegativeEnum), typeof(global::UnitTest.Issues.TestProtos.DeprecatedEnum), }, new pbr::GeneratedClrTypeInfo[] {
  50. new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.Issue307), global::UnitTest.Issues.TestProtos.Issue307.Parser, 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, 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)})}),
  51. new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.NegativeEnumMessage), global::UnitTest.Issues.TestProtos.NegativeEnumMessage.Parser, new[]{ "Value", "Values", "PackedValues" }, null, null, null),
  52. new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.DeprecatedChild), global::UnitTest.Issues.TestProtos.DeprecatedChild.Parser, null, null, null, null),
  53. 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),
  54. new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.ItemField), global::UnitTest.Issues.TestProtos.ItemField.Parser, new[]{ "Item" }, null, null, null),
  55. new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.ReservedNames), global::UnitTest.Issues.TestProtos.ReservedNames.Parser, new[]{ "Types_", "Descriptor_" }, 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)}),
  56. 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),
  57. new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.TestJsonName), global::UnitTest.Issues.TestProtos.TestJsonName.Parser, new[]{ "Name", "Description", "Guid" }, null, null, null)
  58. }));
  59. }
  60. #endregion
  61. }
  62. #region Enums
  63. public enum NegativeEnum {
  64. [pbr::OriginalName("NEGATIVE_ENUM_ZERO")] Zero = 0,
  65. [pbr::OriginalName("FiveBelow")] FiveBelow = -5,
  66. [pbr::OriginalName("MinusOne")] MinusOne = -1,
  67. }
  68. public enum DeprecatedEnum {
  69. [pbr::OriginalName("DEPRECATED_ZERO")] DeprecatedZero = 0,
  70. [pbr::OriginalName("one")] One = 1,
  71. }
  72. #endregion
  73. #region Messages
  74. /// <summary>
  75. /// Issue 307: when generating doubly-nested types, any references
  76. /// should be of the form A.Types.B.Types.C.
  77. /// </summary>
  78. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  79. public sealed partial class Issue307 : pb::IMessage<Issue307> {
  80. private static readonly pb::MessageParser<Issue307> _parser = new pb::MessageParser<Issue307>(() => new Issue307());
  81. public static pb::MessageParser<Issue307> Parser { get { return _parser; } }
  82. public static pbr::MessageDescriptor Descriptor {
  83. get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[0]; }
  84. }
  85. pbr::MessageDescriptor pb::IMessage.Descriptor {
  86. get { return Descriptor; }
  87. }
  88. public Issue307() {
  89. OnConstruction();
  90. }
  91. partial void OnConstruction();
  92. public Issue307(Issue307 other) : this() {
  93. }
  94. public Issue307 Clone() {
  95. return new Issue307(this);
  96. }
  97. public override bool Equals(object other) {
  98. return Equals(other as Issue307);
  99. }
  100. public bool Equals(Issue307 other) {
  101. if (ReferenceEquals(other, null)) {
  102. return false;
  103. }
  104. if (ReferenceEquals(other, this)) {
  105. return true;
  106. }
  107. return true;
  108. }
  109. public override int GetHashCode() {
  110. int hash = 1;
  111. return hash;
  112. }
  113. public override string ToString() {
  114. return pb::JsonFormatter.ToDiagnosticString(this);
  115. }
  116. public void WriteTo(pb::CodedOutputStream output) {
  117. }
  118. public int CalculateSize() {
  119. int size = 0;
  120. return size;
  121. }
  122. public void MergeFrom(Issue307 other) {
  123. if (other == null) {
  124. return;
  125. }
  126. }
  127. public void MergeFrom(pb::CodedInputStream input) {
  128. uint tag;
  129. while ((tag = input.ReadTag()) != 0) {
  130. switch(tag) {
  131. default:
  132. input.SkipLastField();
  133. break;
  134. }
  135. }
  136. }
  137. #region Nested types
  138. /// <summary>Container for nested types declared in the Issue307 message type.</summary>
  139. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  140. public static partial class Types {
  141. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  142. public sealed partial class NestedOnce : pb::IMessage<NestedOnce> {
  143. private static readonly pb::MessageParser<NestedOnce> _parser = new pb::MessageParser<NestedOnce>(() => new NestedOnce());
  144. public static pb::MessageParser<NestedOnce> Parser { get { return _parser; } }
  145. public static pbr::MessageDescriptor Descriptor {
  146. get { return global::UnitTest.Issues.TestProtos.Issue307.Descriptor.NestedTypes[0]; }
  147. }
  148. pbr::MessageDescriptor pb::IMessage.Descriptor {
  149. get { return Descriptor; }
  150. }
  151. public NestedOnce() {
  152. OnConstruction();
  153. }
  154. partial void OnConstruction();
  155. public NestedOnce(NestedOnce other) : this() {
  156. }
  157. public NestedOnce Clone() {
  158. return new NestedOnce(this);
  159. }
  160. public override bool Equals(object other) {
  161. return Equals(other as NestedOnce);
  162. }
  163. public bool Equals(NestedOnce other) {
  164. if (ReferenceEquals(other, null)) {
  165. return false;
  166. }
  167. if (ReferenceEquals(other, this)) {
  168. return true;
  169. }
  170. return true;
  171. }
  172. public override int GetHashCode() {
  173. int hash = 1;
  174. return hash;
  175. }
  176. public override string ToString() {
  177. return pb::JsonFormatter.ToDiagnosticString(this);
  178. }
  179. public void WriteTo(pb::CodedOutputStream output) {
  180. }
  181. public int CalculateSize() {
  182. int size = 0;
  183. return size;
  184. }
  185. public void MergeFrom(NestedOnce other) {
  186. if (other == null) {
  187. return;
  188. }
  189. }
  190. public void MergeFrom(pb::CodedInputStream input) {
  191. uint tag;
  192. while ((tag = input.ReadTag()) != 0) {
  193. switch(tag) {
  194. default:
  195. input.SkipLastField();
  196. break;
  197. }
  198. }
  199. }
  200. #region Nested types
  201. /// <summary>Container for nested types declared in the NestedOnce message type.</summary>
  202. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  203. public static partial class Types {
  204. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  205. public sealed partial class NestedTwice : pb::IMessage<NestedTwice> {
  206. private static readonly pb::MessageParser<NestedTwice> _parser = new pb::MessageParser<NestedTwice>(() => new NestedTwice());
  207. public static pb::MessageParser<NestedTwice> Parser { get { return _parser; } }
  208. public static pbr::MessageDescriptor Descriptor {
  209. get { return global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce.Descriptor.NestedTypes[0]; }
  210. }
  211. pbr::MessageDescriptor pb::IMessage.Descriptor {
  212. get { return Descriptor; }
  213. }
  214. public NestedTwice() {
  215. OnConstruction();
  216. }
  217. partial void OnConstruction();
  218. public NestedTwice(NestedTwice other) : this() {
  219. }
  220. public NestedTwice Clone() {
  221. return new NestedTwice(this);
  222. }
  223. public override bool Equals(object other) {
  224. return Equals(other as NestedTwice);
  225. }
  226. public bool Equals(NestedTwice other) {
  227. if (ReferenceEquals(other, null)) {
  228. return false;
  229. }
  230. if (ReferenceEquals(other, this)) {
  231. return true;
  232. }
  233. return true;
  234. }
  235. public override int GetHashCode() {
  236. int hash = 1;
  237. return hash;
  238. }
  239. public override string ToString() {
  240. return pb::JsonFormatter.ToDiagnosticString(this);
  241. }
  242. public void WriteTo(pb::CodedOutputStream output) {
  243. }
  244. public int CalculateSize() {
  245. int size = 0;
  246. return size;
  247. }
  248. public void MergeFrom(NestedTwice other) {
  249. if (other == null) {
  250. return;
  251. }
  252. }
  253. public void MergeFrom(pb::CodedInputStream input) {
  254. uint tag;
  255. while ((tag = input.ReadTag()) != 0) {
  256. switch(tag) {
  257. default:
  258. input.SkipLastField();
  259. break;
  260. }
  261. }
  262. }
  263. }
  264. }
  265. #endregion
  266. }
  267. }
  268. #endregion
  269. }
  270. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  271. public sealed partial class NegativeEnumMessage : pb::IMessage<NegativeEnumMessage> {
  272. private static readonly pb::MessageParser<NegativeEnumMessage> _parser = new pb::MessageParser<NegativeEnumMessage>(() => new NegativeEnumMessage());
  273. public static pb::MessageParser<NegativeEnumMessage> Parser { get { return _parser; } }
  274. public static pbr::MessageDescriptor Descriptor {
  275. get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[1]; }
  276. }
  277. pbr::MessageDescriptor pb::IMessage.Descriptor {
  278. get { return Descriptor; }
  279. }
  280. public NegativeEnumMessage() {
  281. OnConstruction();
  282. }
  283. partial void OnConstruction();
  284. public NegativeEnumMessage(NegativeEnumMessage other) : this() {
  285. value_ = other.value_;
  286. values_ = other.values_.Clone();
  287. packedValues_ = other.packedValues_.Clone();
  288. }
  289. public NegativeEnumMessage Clone() {
  290. return new NegativeEnumMessage(this);
  291. }
  292. /// <summary>Field number for the "value" field.</summary>
  293. public const int ValueFieldNumber = 1;
  294. private global::UnitTest.Issues.TestProtos.NegativeEnum value_ = 0;
  295. public global::UnitTest.Issues.TestProtos.NegativeEnum Value {
  296. get { return value_; }
  297. set {
  298. value_ = value;
  299. }
  300. }
  301. /// <summary>Field number for the "values" field.</summary>
  302. public const int ValuesFieldNumber = 2;
  303. private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.NegativeEnum> _repeated_values_codec
  304. = pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::UnitTest.Issues.TestProtos.NegativeEnum) x);
  305. private readonly pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum> values_ = new pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum>();
  306. public pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum> Values {
  307. get { return values_; }
  308. }
  309. /// <summary>Field number for the "packed_values" field.</summary>
  310. public const int PackedValuesFieldNumber = 3;
  311. private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.NegativeEnum> _repeated_packedValues_codec
  312. = pb::FieldCodec.ForEnum(26, x => (int) x, x => (global::UnitTest.Issues.TestProtos.NegativeEnum) x);
  313. private readonly pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum> packedValues_ = new pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum>();
  314. public pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum> PackedValues {
  315. get { return packedValues_; }
  316. }
  317. public override bool Equals(object other) {
  318. return Equals(other as NegativeEnumMessage);
  319. }
  320. public bool Equals(NegativeEnumMessage other) {
  321. if (ReferenceEquals(other, null)) {
  322. return false;
  323. }
  324. if (ReferenceEquals(other, this)) {
  325. return true;
  326. }
  327. if (Value != other.Value) return false;
  328. if(!values_.Equals(other.values_)) return false;
  329. if(!packedValues_.Equals(other.packedValues_)) return false;
  330. return true;
  331. }
  332. public override int GetHashCode() {
  333. int hash = 1;
  334. if (Value != 0) hash ^= Value.GetHashCode();
  335. hash ^= values_.GetHashCode();
  336. hash ^= packedValues_.GetHashCode();
  337. return hash;
  338. }
  339. public override string ToString() {
  340. return pb::JsonFormatter.ToDiagnosticString(this);
  341. }
  342. public void WriteTo(pb::CodedOutputStream output) {
  343. if (Value != 0) {
  344. output.WriteRawTag(8);
  345. output.WriteEnum((int) Value);
  346. }
  347. values_.WriteTo(output, _repeated_values_codec);
  348. packedValues_.WriteTo(output, _repeated_packedValues_codec);
  349. }
  350. public int CalculateSize() {
  351. int size = 0;
  352. if (Value != 0) {
  353. size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Value);
  354. }
  355. size += values_.CalculateSize(_repeated_values_codec);
  356. size += packedValues_.CalculateSize(_repeated_packedValues_codec);
  357. return size;
  358. }
  359. public void MergeFrom(NegativeEnumMessage other) {
  360. if (other == null) {
  361. return;
  362. }
  363. if (other.Value != 0) {
  364. Value = other.Value;
  365. }
  366. values_.Add(other.values_);
  367. packedValues_.Add(other.packedValues_);
  368. }
  369. public void MergeFrom(pb::CodedInputStream input) {
  370. uint tag;
  371. while ((tag = input.ReadTag()) != 0) {
  372. switch(tag) {
  373. default:
  374. input.SkipLastField();
  375. break;
  376. case 8: {
  377. value_ = (global::UnitTest.Issues.TestProtos.NegativeEnum) input.ReadEnum();
  378. break;
  379. }
  380. case 18:
  381. case 16: {
  382. values_.AddEntriesFrom(input, _repeated_values_codec);
  383. break;
  384. }
  385. case 26:
  386. case 24: {
  387. packedValues_.AddEntriesFrom(input, _repeated_packedValues_codec);
  388. break;
  389. }
  390. }
  391. }
  392. }
  393. }
  394. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  395. public sealed partial class DeprecatedChild : pb::IMessage<DeprecatedChild> {
  396. private static readonly pb::MessageParser<DeprecatedChild> _parser = new pb::MessageParser<DeprecatedChild>(() => new DeprecatedChild());
  397. public static pb::MessageParser<DeprecatedChild> Parser { get { return _parser; } }
  398. public static pbr::MessageDescriptor Descriptor {
  399. get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[2]; }
  400. }
  401. pbr::MessageDescriptor pb::IMessage.Descriptor {
  402. get { return Descriptor; }
  403. }
  404. public DeprecatedChild() {
  405. OnConstruction();
  406. }
  407. partial void OnConstruction();
  408. public DeprecatedChild(DeprecatedChild other) : this() {
  409. }
  410. public DeprecatedChild Clone() {
  411. return new DeprecatedChild(this);
  412. }
  413. public override bool Equals(object other) {
  414. return Equals(other as DeprecatedChild);
  415. }
  416. public bool Equals(DeprecatedChild other) {
  417. if (ReferenceEquals(other, null)) {
  418. return false;
  419. }
  420. if (ReferenceEquals(other, this)) {
  421. return true;
  422. }
  423. return true;
  424. }
  425. public override int GetHashCode() {
  426. int hash = 1;
  427. return hash;
  428. }
  429. public override string ToString() {
  430. return pb::JsonFormatter.ToDiagnosticString(this);
  431. }
  432. public void WriteTo(pb::CodedOutputStream output) {
  433. }
  434. public int CalculateSize() {
  435. int size = 0;
  436. return size;
  437. }
  438. public void MergeFrom(DeprecatedChild other) {
  439. if (other == null) {
  440. return;
  441. }
  442. }
  443. public void MergeFrom(pb::CodedInputStream input) {
  444. uint tag;
  445. while ((tag = input.ReadTag()) != 0) {
  446. switch(tag) {
  447. default:
  448. input.SkipLastField();
  449. break;
  450. }
  451. }
  452. }
  453. }
  454. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  455. public sealed partial class DeprecatedFieldsMessage : pb::IMessage<DeprecatedFieldsMessage> {
  456. private static readonly pb::MessageParser<DeprecatedFieldsMessage> _parser = new pb::MessageParser<DeprecatedFieldsMessage>(() => new DeprecatedFieldsMessage());
  457. public static pb::MessageParser<DeprecatedFieldsMessage> Parser { get { return _parser; } }
  458. public static pbr::MessageDescriptor Descriptor {
  459. get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[3]; }
  460. }
  461. pbr::MessageDescriptor pb::IMessage.Descriptor {
  462. get { return Descriptor; }
  463. }
  464. public DeprecatedFieldsMessage() {
  465. OnConstruction();
  466. }
  467. partial void OnConstruction();
  468. public DeprecatedFieldsMessage(DeprecatedFieldsMessage other) : this() {
  469. primitiveValue_ = other.primitiveValue_;
  470. primitiveArray_ = other.primitiveArray_.Clone();
  471. MessageValue = other.messageValue_ != null ? other.MessageValue.Clone() : null;
  472. messageArray_ = other.messageArray_.Clone();
  473. enumValue_ = other.enumValue_;
  474. enumArray_ = other.enumArray_.Clone();
  475. }
  476. public DeprecatedFieldsMessage Clone() {
  477. return new DeprecatedFieldsMessage(this);
  478. }
  479. /// <summary>Field number for the "PrimitiveValue" field.</summary>
  480. public const int PrimitiveValueFieldNumber = 1;
  481. private int primitiveValue_;
  482. [global::System.ObsoleteAttribute()]
  483. public int PrimitiveValue {
  484. get { return primitiveValue_; }
  485. set {
  486. primitiveValue_ = value;
  487. }
  488. }
  489. /// <summary>Field number for the "PrimitiveArray" field.</summary>
  490. public const int PrimitiveArrayFieldNumber = 2;
  491. private static readonly pb::FieldCodec<int> _repeated_primitiveArray_codec
  492. = pb::FieldCodec.ForInt32(18);
  493. private readonly pbc::RepeatedField<int> primitiveArray_ = new pbc::RepeatedField<int>();
  494. [global::System.ObsoleteAttribute()]
  495. public pbc::RepeatedField<int> PrimitiveArray {
  496. get { return primitiveArray_; }
  497. }
  498. /// <summary>Field number for the "MessageValue" field.</summary>
  499. public const int MessageValueFieldNumber = 3;
  500. private global::UnitTest.Issues.TestProtos.DeprecatedChild messageValue_;
  501. [global::System.ObsoleteAttribute()]
  502. public global::UnitTest.Issues.TestProtos.DeprecatedChild MessageValue {
  503. get { return messageValue_; }
  504. set {
  505. messageValue_ = value;
  506. }
  507. }
  508. /// <summary>Field number for the "MessageArray" field.</summary>
  509. public const int MessageArrayFieldNumber = 4;
  510. private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.DeprecatedChild> _repeated_messageArray_codec
  511. = pb::FieldCodec.ForMessage(34, global::UnitTest.Issues.TestProtos.DeprecatedChild.Parser);
  512. private readonly pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedChild> messageArray_ = new pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedChild>();
  513. [global::System.ObsoleteAttribute()]
  514. public pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedChild> MessageArray {
  515. get { return messageArray_; }
  516. }
  517. /// <summary>Field number for the "EnumValue" field.</summary>
  518. public const int EnumValueFieldNumber = 5;
  519. private global::UnitTest.Issues.TestProtos.DeprecatedEnum enumValue_ = 0;
  520. [global::System.ObsoleteAttribute()]
  521. public global::UnitTest.Issues.TestProtos.DeprecatedEnum EnumValue {
  522. get { return enumValue_; }
  523. set {
  524. enumValue_ = value;
  525. }
  526. }
  527. /// <summary>Field number for the "EnumArray" field.</summary>
  528. public const int EnumArrayFieldNumber = 6;
  529. private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.DeprecatedEnum> _repeated_enumArray_codec
  530. = pb::FieldCodec.ForEnum(50, x => (int) x, x => (global::UnitTest.Issues.TestProtos.DeprecatedEnum) x);
  531. private readonly pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedEnum> enumArray_ = new pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedEnum>();
  532. [global::System.ObsoleteAttribute()]
  533. public pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedEnum> EnumArray {
  534. get { return enumArray_; }
  535. }
  536. public override bool Equals(object other) {
  537. return Equals(other as DeprecatedFieldsMessage);
  538. }
  539. public bool Equals(DeprecatedFieldsMessage other) {
  540. if (ReferenceEquals(other, null)) {
  541. return false;
  542. }
  543. if (ReferenceEquals(other, this)) {
  544. return true;
  545. }
  546. if (PrimitiveValue != other.PrimitiveValue) return false;
  547. if(!primitiveArray_.Equals(other.primitiveArray_)) return false;
  548. if (!object.Equals(MessageValue, other.MessageValue)) return false;
  549. if(!messageArray_.Equals(other.messageArray_)) return false;
  550. if (EnumValue != other.EnumValue) return false;
  551. if(!enumArray_.Equals(other.enumArray_)) return false;
  552. return true;
  553. }
  554. public override int GetHashCode() {
  555. int hash = 1;
  556. if (PrimitiveValue != 0) hash ^= PrimitiveValue.GetHashCode();
  557. hash ^= primitiveArray_.GetHashCode();
  558. if (messageValue_ != null) hash ^= MessageValue.GetHashCode();
  559. hash ^= messageArray_.GetHashCode();
  560. if (EnumValue != 0) hash ^= EnumValue.GetHashCode();
  561. hash ^= enumArray_.GetHashCode();
  562. return hash;
  563. }
  564. public override string ToString() {
  565. return pb::JsonFormatter.ToDiagnosticString(this);
  566. }
  567. public void WriteTo(pb::CodedOutputStream output) {
  568. if (PrimitiveValue != 0) {
  569. output.WriteRawTag(8);
  570. output.WriteInt32(PrimitiveValue);
  571. }
  572. primitiveArray_.WriteTo(output, _repeated_primitiveArray_codec);
  573. if (messageValue_ != null) {
  574. output.WriteRawTag(26);
  575. output.WriteMessage(MessageValue);
  576. }
  577. messageArray_.WriteTo(output, _repeated_messageArray_codec);
  578. if (EnumValue != 0) {
  579. output.WriteRawTag(40);
  580. output.WriteEnum((int) EnumValue);
  581. }
  582. enumArray_.WriteTo(output, _repeated_enumArray_codec);
  583. }
  584. public int CalculateSize() {
  585. int size = 0;
  586. if (PrimitiveValue != 0) {
  587. size += 1 + pb::CodedOutputStream.ComputeInt32Size(PrimitiveValue);
  588. }
  589. size += primitiveArray_.CalculateSize(_repeated_primitiveArray_codec);
  590. if (messageValue_ != null) {
  591. size += 1 + pb::CodedOutputStream.ComputeMessageSize(MessageValue);
  592. }
  593. size += messageArray_.CalculateSize(_repeated_messageArray_codec);
  594. if (EnumValue != 0) {
  595. size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) EnumValue);
  596. }
  597. size += enumArray_.CalculateSize(_repeated_enumArray_codec);
  598. return size;
  599. }
  600. public void MergeFrom(DeprecatedFieldsMessage other) {
  601. if (other == null) {
  602. return;
  603. }
  604. if (other.PrimitiveValue != 0) {
  605. PrimitiveValue = other.PrimitiveValue;
  606. }
  607. primitiveArray_.Add(other.primitiveArray_);
  608. if (other.messageValue_ != null) {
  609. if (messageValue_ == null) {
  610. messageValue_ = new global::UnitTest.Issues.TestProtos.DeprecatedChild();
  611. }
  612. MessageValue.MergeFrom(other.MessageValue);
  613. }
  614. messageArray_.Add(other.messageArray_);
  615. if (other.EnumValue != 0) {
  616. EnumValue = other.EnumValue;
  617. }
  618. enumArray_.Add(other.enumArray_);
  619. }
  620. public void MergeFrom(pb::CodedInputStream input) {
  621. uint tag;
  622. while ((tag = input.ReadTag()) != 0) {
  623. switch(tag) {
  624. default:
  625. input.SkipLastField();
  626. break;
  627. case 8: {
  628. PrimitiveValue = input.ReadInt32();
  629. break;
  630. }
  631. case 18:
  632. case 16: {
  633. primitiveArray_.AddEntriesFrom(input, _repeated_primitiveArray_codec);
  634. break;
  635. }
  636. case 26: {
  637. if (messageValue_ == null) {
  638. messageValue_ = new global::UnitTest.Issues.TestProtos.DeprecatedChild();
  639. }
  640. input.ReadMessage(messageValue_);
  641. break;
  642. }
  643. case 34: {
  644. messageArray_.AddEntriesFrom(input, _repeated_messageArray_codec);
  645. break;
  646. }
  647. case 40: {
  648. enumValue_ = (global::UnitTest.Issues.TestProtos.DeprecatedEnum) input.ReadEnum();
  649. break;
  650. }
  651. case 50:
  652. case 48: {
  653. enumArray_.AddEntriesFrom(input, _repeated_enumArray_codec);
  654. break;
  655. }
  656. }
  657. }
  658. }
  659. }
  660. /// <summary>
  661. /// Issue 45: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=45
  662. /// </summary>
  663. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  664. public sealed partial class ItemField : pb::IMessage<ItemField> {
  665. private static readonly pb::MessageParser<ItemField> _parser = new pb::MessageParser<ItemField>(() => new ItemField());
  666. public static pb::MessageParser<ItemField> Parser { get { return _parser; } }
  667. public static pbr::MessageDescriptor Descriptor {
  668. get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[4]; }
  669. }
  670. pbr::MessageDescriptor pb::IMessage.Descriptor {
  671. get { return Descriptor; }
  672. }
  673. public ItemField() {
  674. OnConstruction();
  675. }
  676. partial void OnConstruction();
  677. public ItemField(ItemField other) : this() {
  678. item_ = other.item_;
  679. }
  680. public ItemField Clone() {
  681. return new ItemField(this);
  682. }
  683. /// <summary>Field number for the "item" field.</summary>
  684. public const int ItemFieldNumber = 1;
  685. private int item_;
  686. public int Item {
  687. get { return item_; }
  688. set {
  689. item_ = value;
  690. }
  691. }
  692. public override bool Equals(object other) {
  693. return Equals(other as ItemField);
  694. }
  695. public bool Equals(ItemField other) {
  696. if (ReferenceEquals(other, null)) {
  697. return false;
  698. }
  699. if (ReferenceEquals(other, this)) {
  700. return true;
  701. }
  702. if (Item != other.Item) return false;
  703. return true;
  704. }
  705. public override int GetHashCode() {
  706. int hash = 1;
  707. if (Item != 0) hash ^= Item.GetHashCode();
  708. return hash;
  709. }
  710. public override string ToString() {
  711. return pb::JsonFormatter.ToDiagnosticString(this);
  712. }
  713. public void WriteTo(pb::CodedOutputStream output) {
  714. if (Item != 0) {
  715. output.WriteRawTag(8);
  716. output.WriteInt32(Item);
  717. }
  718. }
  719. public int CalculateSize() {
  720. int size = 0;
  721. if (Item != 0) {
  722. size += 1 + pb::CodedOutputStream.ComputeInt32Size(Item);
  723. }
  724. return size;
  725. }
  726. public void MergeFrom(ItemField other) {
  727. if (other == null) {
  728. return;
  729. }
  730. if (other.Item != 0) {
  731. Item = other.Item;
  732. }
  733. }
  734. public void MergeFrom(pb::CodedInputStream input) {
  735. uint tag;
  736. while ((tag = input.ReadTag()) != 0) {
  737. switch(tag) {
  738. default:
  739. input.SkipLastField();
  740. break;
  741. case 8: {
  742. Item = input.ReadInt32();
  743. break;
  744. }
  745. }
  746. }
  747. }
  748. }
  749. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  750. public sealed partial class ReservedNames : pb::IMessage<ReservedNames> {
  751. private static readonly pb::MessageParser<ReservedNames> _parser = new pb::MessageParser<ReservedNames>(() => new ReservedNames());
  752. public static pb::MessageParser<ReservedNames> Parser { get { return _parser; } }
  753. public static pbr::MessageDescriptor Descriptor {
  754. get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[5]; }
  755. }
  756. pbr::MessageDescriptor pb::IMessage.Descriptor {
  757. get { return Descriptor; }
  758. }
  759. public ReservedNames() {
  760. OnConstruction();
  761. }
  762. partial void OnConstruction();
  763. public ReservedNames(ReservedNames other) : this() {
  764. types_ = other.types_;
  765. descriptor_ = other.descriptor_;
  766. }
  767. public ReservedNames Clone() {
  768. return new ReservedNames(this);
  769. }
  770. /// <summary>Field number for the "types" field.</summary>
  771. public const int Types_FieldNumber = 1;
  772. private int types_;
  773. public int Types_ {
  774. get { return types_; }
  775. set {
  776. types_ = value;
  777. }
  778. }
  779. /// <summary>Field number for the "descriptor" field.</summary>
  780. public const int Descriptor_FieldNumber = 2;
  781. private int descriptor_;
  782. public int Descriptor_ {
  783. get { return descriptor_; }
  784. set {
  785. descriptor_ = value;
  786. }
  787. }
  788. public override bool Equals(object other) {
  789. return Equals(other as ReservedNames);
  790. }
  791. public bool Equals(ReservedNames other) {
  792. if (ReferenceEquals(other, null)) {
  793. return false;
  794. }
  795. if (ReferenceEquals(other, this)) {
  796. return true;
  797. }
  798. if (Types_ != other.Types_) return false;
  799. if (Descriptor_ != other.Descriptor_) return false;
  800. return true;
  801. }
  802. public override int GetHashCode() {
  803. int hash = 1;
  804. if (Types_ != 0) hash ^= Types_.GetHashCode();
  805. if (Descriptor_ != 0) hash ^= Descriptor_.GetHashCode();
  806. return hash;
  807. }
  808. public override string ToString() {
  809. return pb::JsonFormatter.ToDiagnosticString(this);
  810. }
  811. public void WriteTo(pb::CodedOutputStream output) {
  812. if (Types_ != 0) {
  813. output.WriteRawTag(8);
  814. output.WriteInt32(Types_);
  815. }
  816. if (Descriptor_ != 0) {
  817. output.WriteRawTag(16);
  818. output.WriteInt32(Descriptor_);
  819. }
  820. }
  821. public int CalculateSize() {
  822. int size = 0;
  823. if (Types_ != 0) {
  824. size += 1 + pb::CodedOutputStream.ComputeInt32Size(Types_);
  825. }
  826. if (Descriptor_ != 0) {
  827. size += 1 + pb::CodedOutputStream.ComputeInt32Size(Descriptor_);
  828. }
  829. return size;
  830. }
  831. public void MergeFrom(ReservedNames other) {
  832. if (other == null) {
  833. return;
  834. }
  835. if (other.Types_ != 0) {
  836. Types_ = other.Types_;
  837. }
  838. if (other.Descriptor_ != 0) {
  839. Descriptor_ = other.Descriptor_;
  840. }
  841. }
  842. public void MergeFrom(pb::CodedInputStream input) {
  843. uint tag;
  844. while ((tag = input.ReadTag()) != 0) {
  845. switch(tag) {
  846. default:
  847. input.SkipLastField();
  848. break;
  849. case 8: {
  850. Types_ = input.ReadInt32();
  851. break;
  852. }
  853. case 16: {
  854. Descriptor_ = input.ReadInt32();
  855. break;
  856. }
  857. }
  858. }
  859. }
  860. #region Nested types
  861. /// <summary>Container for nested types declared in the ReservedNames message type.</summary>
  862. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  863. public static partial class Types {
  864. /// <summary>
  865. /// Force a nested type called Types
  866. /// </summary>
  867. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  868. public sealed partial class SomeNestedType : pb::IMessage<SomeNestedType> {
  869. private static readonly pb::MessageParser<SomeNestedType> _parser = new pb::MessageParser<SomeNestedType>(() => new SomeNestedType());
  870. public static pb::MessageParser<SomeNestedType> Parser { get { return _parser; } }
  871. public static pbr::MessageDescriptor Descriptor {
  872. get { return global::UnitTest.Issues.TestProtos.ReservedNames.Descriptor.NestedTypes[0]; }
  873. }
  874. pbr::MessageDescriptor pb::IMessage.Descriptor {
  875. get { return Descriptor; }
  876. }
  877. public SomeNestedType() {
  878. OnConstruction();
  879. }
  880. partial void OnConstruction();
  881. public SomeNestedType(SomeNestedType other) : this() {
  882. }
  883. public SomeNestedType Clone() {
  884. return new SomeNestedType(this);
  885. }
  886. public override bool Equals(object other) {
  887. return Equals(other as SomeNestedType);
  888. }
  889. public bool Equals(SomeNestedType other) {
  890. if (ReferenceEquals(other, null)) {
  891. return false;
  892. }
  893. if (ReferenceEquals(other, this)) {
  894. return true;
  895. }
  896. return true;
  897. }
  898. public override int GetHashCode() {
  899. int hash = 1;
  900. return hash;
  901. }
  902. public override string ToString() {
  903. return pb::JsonFormatter.ToDiagnosticString(this);
  904. }
  905. public void WriteTo(pb::CodedOutputStream output) {
  906. }
  907. public int CalculateSize() {
  908. int size = 0;
  909. return size;
  910. }
  911. public void MergeFrom(SomeNestedType other) {
  912. if (other == null) {
  913. return;
  914. }
  915. }
  916. public void MergeFrom(pb::CodedInputStream input) {
  917. uint tag;
  918. while ((tag = input.ReadTag()) != 0) {
  919. switch(tag) {
  920. default:
  921. input.SkipLastField();
  922. break;
  923. }
  924. }
  925. }
  926. }
  927. }
  928. #endregion
  929. }
  930. /// <summary>
  931. /// These fields are deliberately not declared in numeric
  932. /// order, and the oneof fields aren't contiguous either.
  933. /// This allows for reasonably robust tests of JSON output
  934. /// ordering.
  935. /// TestFieldOrderings in unittest_proto3.proto is similar,
  936. /// but doesn't include oneofs.
  937. /// TODO: Consider adding oneofs to TestFieldOrderings, although
  938. /// that will require fixing other tests in multiple platforms.
  939. /// Alternatively, consider just adding this to
  940. /// unittest_proto3.proto if multiple platforms want it.
  941. /// </summary>
  942. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  943. public sealed partial class TestJsonFieldOrdering : pb::IMessage<TestJsonFieldOrdering> {
  944. private static readonly pb::MessageParser<TestJsonFieldOrdering> _parser = new pb::MessageParser<TestJsonFieldOrdering>(() => new TestJsonFieldOrdering());
  945. public static pb::MessageParser<TestJsonFieldOrdering> Parser { get { return _parser; } }
  946. public static pbr::MessageDescriptor Descriptor {
  947. get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[6]; }
  948. }
  949. pbr::MessageDescriptor pb::IMessage.Descriptor {
  950. get { return Descriptor; }
  951. }
  952. public TestJsonFieldOrdering() {
  953. OnConstruction();
  954. }
  955. partial void OnConstruction();
  956. public TestJsonFieldOrdering(TestJsonFieldOrdering other) : this() {
  957. plainInt32_ = other.plainInt32_;
  958. plainString_ = other.plainString_;
  959. switch (other.O1Case) {
  960. case O1OneofCase.O1String:
  961. O1String = other.O1String;
  962. break;
  963. case O1OneofCase.O1Int32:
  964. O1Int32 = other.O1Int32;
  965. break;
  966. }
  967. switch (other.O2Case) {
  968. case O2OneofCase.O2Int32:
  969. O2Int32 = other.O2Int32;
  970. break;
  971. case O2OneofCase.O2String:
  972. O2String = other.O2String;
  973. break;
  974. }
  975. }
  976. public TestJsonFieldOrdering Clone() {
  977. return new TestJsonFieldOrdering(this);
  978. }
  979. /// <summary>Field number for the "plain_int32" field.</summary>
  980. public const int PlainInt32FieldNumber = 4;
  981. private int plainInt32_;
  982. public int PlainInt32 {
  983. get { return plainInt32_; }
  984. set {
  985. plainInt32_ = value;
  986. }
  987. }
  988. /// <summary>Field number for the "o1_string" field.</summary>
  989. public const int O1StringFieldNumber = 2;
  990. public string O1String {
  991. get { return o1Case_ == O1OneofCase.O1String ? (string) o1_ : ""; }
  992. set {
  993. o1_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  994. o1Case_ = O1OneofCase.O1String;
  995. }
  996. }
  997. /// <summary>Field number for the "o1_int32" field.</summary>
  998. public const int O1Int32FieldNumber = 5;
  999. public int O1Int32 {
  1000. get { return o1Case_ == O1OneofCase.O1Int32 ? (int) o1_ : 0; }
  1001. set {
  1002. o1_ = value;
  1003. o1Case_ = O1OneofCase.O1Int32;
  1004. }
  1005. }
  1006. /// <summary>Field number for the "plain_string" field.</summary>
  1007. public const int PlainStringFieldNumber = 1;
  1008. private string plainString_ = "";
  1009. public string PlainString {
  1010. get { return plainString_; }
  1011. set {
  1012. plainString_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  1013. }
  1014. }
  1015. /// <summary>Field number for the "o2_int32" field.</summary>
  1016. public const int O2Int32FieldNumber = 6;
  1017. public int O2Int32 {
  1018. get { return o2Case_ == O2OneofCase.O2Int32 ? (int) o2_ : 0; }
  1019. set {
  1020. o2_ = value;
  1021. o2Case_ = O2OneofCase.O2Int32;
  1022. }
  1023. }
  1024. /// <summary>Field number for the "o2_string" field.</summary>
  1025. public const int O2StringFieldNumber = 3;
  1026. public string O2String {
  1027. get { return o2Case_ == O2OneofCase.O2String ? (string) o2_ : ""; }
  1028. set {
  1029. o2_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  1030. o2Case_ = O2OneofCase.O2String;
  1031. }
  1032. }
  1033. private object o1_;
  1034. /// <summary>Enum of possible cases for the "o1" oneof.</summary>
  1035. public enum O1OneofCase {
  1036. None = 0,
  1037. O1String = 2,
  1038. O1Int32 = 5,
  1039. }
  1040. private O1OneofCase o1Case_ = O1OneofCase.None;
  1041. public O1OneofCase O1Case {
  1042. get { return o1Case_; }
  1043. }
  1044. public void ClearO1() {
  1045. o1Case_ = O1OneofCase.None;
  1046. o1_ = null;
  1047. }
  1048. private object o2_;
  1049. /// <summary>Enum of possible cases for the "o2" oneof.</summary>
  1050. public enum O2OneofCase {
  1051. None = 0,
  1052. O2Int32 = 6,
  1053. O2String = 3,
  1054. }
  1055. private O2OneofCase o2Case_ = O2OneofCase.None;
  1056. public O2OneofCase O2Case {
  1057. get { return o2Case_; }
  1058. }
  1059. public void ClearO2() {
  1060. o2Case_ = O2OneofCase.None;
  1061. o2_ = null;
  1062. }
  1063. public override bool Equals(object other) {
  1064. return Equals(other as TestJsonFieldOrdering);
  1065. }
  1066. public bool Equals(TestJsonFieldOrdering other) {
  1067. if (ReferenceEquals(other, null)) {
  1068. return false;
  1069. }
  1070. if (ReferenceEquals(other, this)) {
  1071. return true;
  1072. }
  1073. if (PlainInt32 != other.PlainInt32) return false;
  1074. if (O1String != other.O1String) return false;
  1075. if (O1Int32 != other.O1Int32) return false;
  1076. if (PlainString != other.PlainString) return false;
  1077. if (O2Int32 != other.O2Int32) return false;
  1078. if (O2String != other.O2String) return false;
  1079. if (O1Case != other.O1Case) return false;
  1080. if (O2Case != other.O2Case) return false;
  1081. return true;
  1082. }
  1083. public override int GetHashCode() {
  1084. int hash = 1;
  1085. if (PlainInt32 != 0) hash ^= PlainInt32.GetHashCode();
  1086. if (o1Case_ == O1OneofCase.O1String) hash ^= O1String.GetHashCode();
  1087. if (o1Case_ == O1OneofCase.O1Int32) hash ^= O1Int32.GetHashCode();
  1088. if (PlainString.Length != 0) hash ^= PlainString.GetHashCode();
  1089. if (o2Case_ == O2OneofCase.O2Int32) hash ^= O2Int32.GetHashCode();
  1090. if (o2Case_ == O2OneofCase.O2String) hash ^= O2String.GetHashCode();
  1091. hash ^= (int) o1Case_;
  1092. hash ^= (int) o2Case_;
  1093. return hash;
  1094. }
  1095. public override string ToString() {
  1096. return pb::JsonFormatter.ToDiagnosticString(this);
  1097. }
  1098. public void WriteTo(pb::CodedOutputStream output) {
  1099. if (PlainString.Length != 0) {
  1100. output.WriteRawTag(10);
  1101. output.WriteString(PlainString);
  1102. }
  1103. if (o1Case_ == O1OneofCase.O1String) {
  1104. output.WriteRawTag(18);
  1105. output.WriteString(O1String);
  1106. }
  1107. if (o2Case_ == O2OneofCase.O2String) {
  1108. output.WriteRawTag(26);
  1109. output.WriteString(O2String);
  1110. }
  1111. if (PlainInt32 != 0) {
  1112. output.WriteRawTag(32);
  1113. output.WriteInt32(PlainInt32);
  1114. }
  1115. if (o1Case_ == O1OneofCase.O1Int32) {
  1116. output.WriteRawTag(40);
  1117. output.WriteInt32(O1Int32);
  1118. }
  1119. if (o2Case_ == O2OneofCase.O2Int32) {
  1120. output.WriteRawTag(48);
  1121. output.WriteInt32(O2Int32);
  1122. }
  1123. }
  1124. public int CalculateSize() {
  1125. int size = 0;
  1126. if (PlainInt32 != 0) {
  1127. size += 1 + pb::CodedOutputStream.ComputeInt32Size(PlainInt32);
  1128. }
  1129. if (o1Case_ == O1OneofCase.O1String) {
  1130. size += 1 + pb::CodedOutputStream.ComputeStringSize(O1String);
  1131. }
  1132. if (o1Case_ == O1OneofCase.O1Int32) {
  1133. size += 1 + pb::CodedOutputStream.ComputeInt32Size(O1Int32);
  1134. }
  1135. if (PlainString.Length != 0) {
  1136. size += 1 + pb::CodedOutputStream.ComputeStringSize(PlainString);
  1137. }
  1138. if (o2Case_ == O2OneofCase.O2Int32) {
  1139. size += 1 + pb::CodedOutputStream.ComputeInt32Size(O2Int32);
  1140. }
  1141. if (o2Case_ == O2OneofCase.O2String) {
  1142. size += 1 + pb::CodedOutputStream.ComputeStringSize(O2String);
  1143. }
  1144. return size;
  1145. }
  1146. public void MergeFrom(TestJsonFieldOrdering other) {
  1147. if (other == null) {
  1148. return;
  1149. }
  1150. if (other.PlainInt32 != 0) {
  1151. PlainInt32 = other.PlainInt32;
  1152. }
  1153. if (other.PlainString.Length != 0) {
  1154. PlainString = other.PlainString;
  1155. }
  1156. switch (other.O1Case) {
  1157. case O1OneofCase.O1String:
  1158. O1String = other.O1String;
  1159. break;
  1160. case O1OneofCase.O1Int32:
  1161. O1Int32 = other.O1Int32;
  1162. break;
  1163. }
  1164. switch (other.O2Case) {
  1165. case O2OneofCase.O2Int32:
  1166. O2Int32 = other.O2Int32;
  1167. break;
  1168. case O2OneofCase.O2String:
  1169. O2String = other.O2String;
  1170. break;
  1171. }
  1172. }
  1173. public void MergeFrom(pb::CodedInputStream input) {
  1174. uint tag;
  1175. while ((tag = input.ReadTag()) != 0) {
  1176. switch(tag) {
  1177. default:
  1178. input.SkipLastField();
  1179. break;
  1180. case 10: {
  1181. PlainString = input.ReadString();
  1182. break;
  1183. }
  1184. case 18: {
  1185. O1String = input.ReadString();
  1186. break;
  1187. }
  1188. case 26: {
  1189. O2String = input.ReadString();
  1190. break;
  1191. }
  1192. case 32: {
  1193. PlainInt32 = input.ReadInt32();
  1194. break;
  1195. }
  1196. case 40: {
  1197. O1Int32 = input.ReadInt32();
  1198. break;
  1199. }
  1200. case 48: {
  1201. O2Int32 = input.ReadInt32();
  1202. break;
  1203. }
  1204. }
  1205. }
  1206. }
  1207. }
  1208. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  1209. public sealed partial class TestJsonName : pb::IMessage<TestJsonName> {
  1210. private static readonly pb::MessageParser<TestJsonName> _parser = new pb::MessageParser<TestJsonName>(() => new TestJsonName());
  1211. public static pb::MessageParser<TestJsonName> Parser { get { return _parser; } }
  1212. public static pbr::MessageDescriptor Descriptor {
  1213. get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[7]; }
  1214. }
  1215. pbr::MessageDescriptor pb::IMessage.Descriptor {
  1216. get { return Descriptor; }
  1217. }
  1218. public TestJsonName() {
  1219. OnConstruction();
  1220. }
  1221. partial void OnConstruction();
  1222. public TestJsonName(TestJsonName other) : this() {
  1223. name_ = other.name_;
  1224. description_ = other.description_;
  1225. guid_ = other.guid_;
  1226. }
  1227. public TestJsonName Clone() {
  1228. return new TestJsonName(this);
  1229. }
  1230. /// <summary>Field number for the "name" field.</summary>
  1231. public const int NameFieldNumber = 1;
  1232. private string name_ = "";
  1233. /// <summary>
  1234. /// Message for testing the effects for of the json_name option
  1235. /// </summary>
  1236. public string Name {
  1237. get { return name_; }
  1238. set {
  1239. name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  1240. }
  1241. }
  1242. /// <summary>Field number for the "description" field.</summary>
  1243. public const int DescriptionFieldNumber = 2;
  1244. private string description_ = "";
  1245. public string Description {
  1246. get { return description_; }
  1247. set {
  1248. description_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  1249. }
  1250. }
  1251. /// <summary>Field number for the "guid" field.</summary>
  1252. public const int GuidFieldNumber = 3;
  1253. private string guid_ = "";
  1254. public string Guid {
  1255. get { return guid_; }
  1256. set {
  1257. guid_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  1258. }
  1259. }
  1260. public override bool Equals(object other) {
  1261. return Equals(other as TestJsonName);
  1262. }
  1263. public bool Equals(TestJsonName other) {
  1264. if (ReferenceEquals(other, null)) {
  1265. return false;
  1266. }
  1267. if (ReferenceEquals(other, this)) {
  1268. return true;
  1269. }
  1270. if (Name != other.Name) return false;
  1271. if (Description != other.Description) return false;
  1272. if (Guid != other.Guid) return false;
  1273. return true;
  1274. }
  1275. public override int GetHashCode() {
  1276. int hash = 1;
  1277. if (Name.Length != 0) hash ^= Name.GetHashCode();
  1278. if (Description.Length != 0) hash ^= Description.GetHashCode();
  1279. if (Guid.Length != 0) hash ^= Guid.GetHashCode();
  1280. return hash;
  1281. }
  1282. public override string ToString() {
  1283. return pb::JsonFormatter.ToDiagnosticString(this);
  1284. }
  1285. public void WriteTo(pb::CodedOutputStream output) {
  1286. if (Name.Length != 0) {
  1287. output.WriteRawTag(10);
  1288. output.WriteString(Name);
  1289. }
  1290. if (Description.Length != 0) {
  1291. output.WriteRawTag(18);
  1292. output.WriteString(Description);
  1293. }
  1294. if (Guid.Length != 0) {
  1295. output.WriteRawTag(26);
  1296. output.WriteString(Guid);
  1297. }
  1298. }
  1299. public int CalculateSize() {
  1300. int size = 0;
  1301. if (Name.Length != 0) {
  1302. size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
  1303. }
  1304. if (Description.Length != 0) {
  1305. size += 1 + pb::CodedOutputStream.ComputeStringSize(Description);
  1306. }
  1307. if (Guid.Length != 0) {
  1308. size += 1 + pb::CodedOutputStream.ComputeStringSize(Guid);
  1309. }
  1310. return size;
  1311. }
  1312. public void MergeFrom(TestJsonName other) {
  1313. if (other == null) {
  1314. return;
  1315. }
  1316. if (other.Name.Length != 0) {
  1317. Name = other.Name;
  1318. }
  1319. if (other.Description.Length != 0) {
  1320. Description = other.Description;
  1321. }
  1322. if (other.Guid.Length != 0) {
  1323. Guid = other.Guid;
  1324. }
  1325. }
  1326. public void MergeFrom(pb::CodedInputStream input) {
  1327. uint tag;
  1328. while ((tag = input.ReadTag()) != 0) {
  1329. switch(tag) {
  1330. default:
  1331. input.SkipLastField();
  1332. break;
  1333. case 10: {
  1334. Name = input.ReadString();
  1335. break;
  1336. }
  1337. case 18: {
  1338. Description = input.ReadString();
  1339. break;
  1340. }
  1341. case 26: {
  1342. Guid = input.ReadString();
  1343. break;
  1344. }
  1345. }
  1346. }
  1347. }
  1348. }
  1349. #endregion
  1350. }
  1351. #endregion Designer generated code