UnittestIssues.cs 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362
  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 UnittestIssues {
  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 UnittestIssues() {
  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. "KlUKDE5lZ2F0aXZlRW51bRIWChJORUdBVElWRV9FTlVNX1pFUk8QABIWCglG",
  42. "aXZlQmVsb3cQ+///////////ARIVCghNaW51c09uZRD///////////8BKi4K",
  43. "DkRlcHJlY2F0ZWRFbnVtEhMKD0RFUFJFQ0FURURfWkVSTxAAEgcKA29uZRAB",
  44. "Qh9IAaoCGlVuaXRUZXN0Lklzc3Vlcy5UZXN0UHJvdG9zYgZwcm90bzM="));
  45. descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
  46. new pbr::FileDescriptor[] { },
  47. new pbr::GeneratedCodeInfo(new[] {typeof(global::UnitTest.Issues.TestProtos.NegativeEnum), typeof(global::UnitTest.Issues.TestProtos.DeprecatedEnum), }, new pbr::GeneratedCodeInfo[] {
  48. new pbr::GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos.Issue307), null, null, null, new pbr::GeneratedCodeInfo[] { new pbr::GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce), null, null, null, new pbr::GeneratedCodeInfo[] { new pbr::GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce.Types.NestedTwice), null, null, null, null)})}),
  49. new pbr::GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos.NegativeEnumMessage), new[]{ "Value", "Values", "PackedValues" }, null, null, null),
  50. new pbr::GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos.DeprecatedChild), null, null, null, null),
  51. new pbr::GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos.DeprecatedFieldsMessage), new[]{ "PrimitiveValue", "PrimitiveArray", "MessageValue", "MessageArray", "EnumValue", "EnumArray" }, null, null, null),
  52. new pbr::GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos.ItemField), new[]{ "Item" }, null, null, null),
  53. new pbr::GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos.ReservedNames), new[]{ "Types_", "Descriptor_" }, null, null, new pbr::GeneratedCodeInfo[] { new pbr::GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos.ReservedNames.Types.SomeNestedType), null, null, null, null)}),
  54. new pbr::GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos.TestJsonFieldOrdering), new[]{ "PlainInt32", "O1String", "O1Int32", "PlainString", "O2Int32", "O2String" }, new[]{ "O1", "O2" }, null, null)
  55. }));
  56. }
  57. #endregion
  58. }
  59. #region Enums
  60. public enum NegativeEnum {
  61. NEGATIVE_ENUM_ZERO = 0,
  62. FiveBelow = -5,
  63. MinusOne = -1,
  64. }
  65. public enum DeprecatedEnum {
  66. DEPRECATED_ZERO = 0,
  67. one = 1,
  68. }
  69. #endregion
  70. #region Messages
  71. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  72. public sealed partial class Issue307 : pb::IMessage<Issue307> {
  73. private static readonly pb::MessageParser<Issue307> _parser = new pb::MessageParser<Issue307>(() => new Issue307());
  74. public static pb::MessageParser<Issue307> Parser { get { return _parser; } }
  75. public static pbr::MessageDescriptor Descriptor {
  76. get { return global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor.MessageTypes[0]; }
  77. }
  78. pbr::MessageDescriptor pb::IMessage.Descriptor {
  79. get { return Descriptor; }
  80. }
  81. public Issue307() {
  82. OnConstruction();
  83. }
  84. partial void OnConstruction();
  85. public Issue307(Issue307 other) : this() {
  86. }
  87. public Issue307 Clone() {
  88. return new Issue307(this);
  89. }
  90. public override bool Equals(object other) {
  91. return Equals(other as Issue307);
  92. }
  93. public bool Equals(Issue307 other) {
  94. if (ReferenceEquals(other, null)) {
  95. return false;
  96. }
  97. if (ReferenceEquals(other, this)) {
  98. return true;
  99. }
  100. return true;
  101. }
  102. public override int GetHashCode() {
  103. int hash = 1;
  104. return hash;
  105. }
  106. public override string ToString() {
  107. return pb::JsonFormatter.Default.Format(this);
  108. }
  109. public void WriteTo(pb::CodedOutputStream output) {
  110. }
  111. public int CalculateSize() {
  112. int size = 0;
  113. return size;
  114. }
  115. public void MergeFrom(Issue307 other) {
  116. if (other == null) {
  117. return;
  118. }
  119. }
  120. public void MergeFrom(pb::CodedInputStream input) {
  121. uint tag;
  122. while ((tag = input.ReadTag()) != 0) {
  123. switch(tag) {
  124. default:
  125. input.SkipLastField();
  126. break;
  127. }
  128. }
  129. }
  130. #region Nested types
  131. /// <summary>Container for nested types declared in the Issue307 message type.</summary>
  132. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  133. public static partial class Types {
  134. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  135. public sealed partial class NestedOnce : pb::IMessage<NestedOnce> {
  136. private static readonly pb::MessageParser<NestedOnce> _parser = new pb::MessageParser<NestedOnce>(() => new NestedOnce());
  137. public static pb::MessageParser<NestedOnce> Parser { get { return _parser; } }
  138. public static pbr::MessageDescriptor Descriptor {
  139. get { return global::UnitTest.Issues.TestProtos.Issue307.Descriptor.NestedTypes[0]; }
  140. }
  141. pbr::MessageDescriptor pb::IMessage.Descriptor {
  142. get { return Descriptor; }
  143. }
  144. public NestedOnce() {
  145. OnConstruction();
  146. }
  147. partial void OnConstruction();
  148. public NestedOnce(NestedOnce other) : this() {
  149. }
  150. public NestedOnce Clone() {
  151. return new NestedOnce(this);
  152. }
  153. public override bool Equals(object other) {
  154. return Equals(other as NestedOnce);
  155. }
  156. public bool Equals(NestedOnce other) {
  157. if (ReferenceEquals(other, null)) {
  158. return false;
  159. }
  160. if (ReferenceEquals(other, this)) {
  161. return true;
  162. }
  163. return true;
  164. }
  165. public override int GetHashCode() {
  166. int hash = 1;
  167. return hash;
  168. }
  169. public override string ToString() {
  170. return pb::JsonFormatter.Default.Format(this);
  171. }
  172. public void WriteTo(pb::CodedOutputStream output) {
  173. }
  174. public int CalculateSize() {
  175. int size = 0;
  176. return size;
  177. }
  178. public void MergeFrom(NestedOnce other) {
  179. if (other == null) {
  180. return;
  181. }
  182. }
  183. public void MergeFrom(pb::CodedInputStream input) {
  184. uint tag;
  185. while ((tag = input.ReadTag()) != 0) {
  186. switch(tag) {
  187. default:
  188. input.SkipLastField();
  189. break;
  190. }
  191. }
  192. }
  193. #region Nested types
  194. /// <summary>Container for nested types declared in the NestedOnce message type.</summary>
  195. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  196. public static partial class Types {
  197. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  198. public sealed partial class NestedTwice : pb::IMessage<NestedTwice> {
  199. private static readonly pb::MessageParser<NestedTwice> _parser = new pb::MessageParser<NestedTwice>(() => new NestedTwice());
  200. public static pb::MessageParser<NestedTwice> Parser { get { return _parser; } }
  201. public static pbr::MessageDescriptor Descriptor {
  202. get { return global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce.Descriptor.NestedTypes[0]; }
  203. }
  204. pbr::MessageDescriptor pb::IMessage.Descriptor {
  205. get { return Descriptor; }
  206. }
  207. public NestedTwice() {
  208. OnConstruction();
  209. }
  210. partial void OnConstruction();
  211. public NestedTwice(NestedTwice other) : this() {
  212. }
  213. public NestedTwice Clone() {
  214. return new NestedTwice(this);
  215. }
  216. public override bool Equals(object other) {
  217. return Equals(other as NestedTwice);
  218. }
  219. public bool Equals(NestedTwice other) {
  220. if (ReferenceEquals(other, null)) {
  221. return false;
  222. }
  223. if (ReferenceEquals(other, this)) {
  224. return true;
  225. }
  226. return true;
  227. }
  228. public override int GetHashCode() {
  229. int hash = 1;
  230. return hash;
  231. }
  232. public override string ToString() {
  233. return pb::JsonFormatter.Default.Format(this);
  234. }
  235. public void WriteTo(pb::CodedOutputStream output) {
  236. }
  237. public int CalculateSize() {
  238. int size = 0;
  239. return size;
  240. }
  241. public void MergeFrom(NestedTwice other) {
  242. if (other == null) {
  243. return;
  244. }
  245. }
  246. public void MergeFrom(pb::CodedInputStream input) {
  247. uint tag;
  248. while ((tag = input.ReadTag()) != 0) {
  249. switch(tag) {
  250. default:
  251. input.SkipLastField();
  252. break;
  253. }
  254. }
  255. }
  256. }
  257. }
  258. #endregion
  259. }
  260. }
  261. #endregion
  262. }
  263. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  264. public sealed partial class NegativeEnumMessage : pb::IMessage<NegativeEnumMessage> {
  265. private static readonly pb::MessageParser<NegativeEnumMessage> _parser = new pb::MessageParser<NegativeEnumMessage>(() => new NegativeEnumMessage());
  266. public static pb::MessageParser<NegativeEnumMessage> Parser { get { return _parser; } }
  267. public static pbr::MessageDescriptor Descriptor {
  268. get { return global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor.MessageTypes[1]; }
  269. }
  270. pbr::MessageDescriptor pb::IMessage.Descriptor {
  271. get { return Descriptor; }
  272. }
  273. public NegativeEnumMessage() {
  274. OnConstruction();
  275. }
  276. partial void OnConstruction();
  277. public NegativeEnumMessage(NegativeEnumMessage other) : this() {
  278. value_ = other.value_;
  279. values_ = other.values_.Clone();
  280. packedValues_ = other.packedValues_.Clone();
  281. }
  282. public NegativeEnumMessage Clone() {
  283. return new NegativeEnumMessage(this);
  284. }
  285. public const int ValueFieldNumber = 1;
  286. private global::UnitTest.Issues.TestProtos.NegativeEnum value_ = global::UnitTest.Issues.TestProtos.NegativeEnum.NEGATIVE_ENUM_ZERO;
  287. public global::UnitTest.Issues.TestProtos.NegativeEnum Value {
  288. get { return value_; }
  289. set {
  290. value_ = value;
  291. }
  292. }
  293. public const int ValuesFieldNumber = 2;
  294. private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.NegativeEnum> _repeated_values_codec
  295. = pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::UnitTest.Issues.TestProtos.NegativeEnum) x);
  296. private readonly pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum> values_ = new pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum>();
  297. public pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum> Values {
  298. get { return values_; }
  299. }
  300. public const int PackedValuesFieldNumber = 3;
  301. private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.NegativeEnum> _repeated_packedValues_codec
  302. = pb::FieldCodec.ForEnum(26, x => (int) x, x => (global::UnitTest.Issues.TestProtos.NegativeEnum) x);
  303. private readonly pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum> packedValues_ = new pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum>();
  304. public pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum> PackedValues {
  305. get { return packedValues_; }
  306. }
  307. public override bool Equals(object other) {
  308. return Equals(other as NegativeEnumMessage);
  309. }
  310. public bool Equals(NegativeEnumMessage other) {
  311. if (ReferenceEquals(other, null)) {
  312. return false;
  313. }
  314. if (ReferenceEquals(other, this)) {
  315. return true;
  316. }
  317. if (Value != other.Value) return false;
  318. if(!values_.Equals(other.values_)) return false;
  319. if(!packedValues_.Equals(other.packedValues_)) return false;
  320. return true;
  321. }
  322. public override int GetHashCode() {
  323. int hash = 1;
  324. if (Value != global::UnitTest.Issues.TestProtos.NegativeEnum.NEGATIVE_ENUM_ZERO) hash ^= Value.GetHashCode();
  325. hash ^= values_.GetHashCode();
  326. hash ^= packedValues_.GetHashCode();
  327. return hash;
  328. }
  329. public override string ToString() {
  330. return pb::JsonFormatter.Default.Format(this);
  331. }
  332. public void WriteTo(pb::CodedOutputStream output) {
  333. if (Value != global::UnitTest.Issues.TestProtos.NegativeEnum.NEGATIVE_ENUM_ZERO) {
  334. output.WriteRawTag(8);
  335. output.WriteEnum((int) Value);
  336. }
  337. values_.WriteTo(output, _repeated_values_codec);
  338. packedValues_.WriteTo(output, _repeated_packedValues_codec);
  339. }
  340. public int CalculateSize() {
  341. int size = 0;
  342. if (Value != global::UnitTest.Issues.TestProtos.NegativeEnum.NEGATIVE_ENUM_ZERO) {
  343. size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Value);
  344. }
  345. size += values_.CalculateSize(_repeated_values_codec);
  346. size += packedValues_.CalculateSize(_repeated_packedValues_codec);
  347. return size;
  348. }
  349. public void MergeFrom(NegativeEnumMessage other) {
  350. if (other == null) {
  351. return;
  352. }
  353. if (other.Value != global::UnitTest.Issues.TestProtos.NegativeEnum.NEGATIVE_ENUM_ZERO) {
  354. Value = other.Value;
  355. }
  356. values_.Add(other.values_);
  357. packedValues_.Add(other.packedValues_);
  358. }
  359. public void MergeFrom(pb::CodedInputStream input) {
  360. uint tag;
  361. while ((tag = input.ReadTag()) != 0) {
  362. switch(tag) {
  363. default:
  364. input.SkipLastField();
  365. break;
  366. case 8: {
  367. value_ = (global::UnitTest.Issues.TestProtos.NegativeEnum) input.ReadEnum();
  368. break;
  369. }
  370. case 18:
  371. case 16: {
  372. values_.AddEntriesFrom(input, _repeated_values_codec);
  373. break;
  374. }
  375. case 26:
  376. case 24: {
  377. packedValues_.AddEntriesFrom(input, _repeated_packedValues_codec);
  378. break;
  379. }
  380. }
  381. }
  382. }
  383. }
  384. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  385. public sealed partial class DeprecatedChild : pb::IMessage<DeprecatedChild> {
  386. private static readonly pb::MessageParser<DeprecatedChild> _parser = new pb::MessageParser<DeprecatedChild>(() => new DeprecatedChild());
  387. public static pb::MessageParser<DeprecatedChild> Parser { get { return _parser; } }
  388. public static pbr::MessageDescriptor Descriptor {
  389. get { return global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor.MessageTypes[2]; }
  390. }
  391. pbr::MessageDescriptor pb::IMessage.Descriptor {
  392. get { return Descriptor; }
  393. }
  394. public DeprecatedChild() {
  395. OnConstruction();
  396. }
  397. partial void OnConstruction();
  398. public DeprecatedChild(DeprecatedChild other) : this() {
  399. }
  400. public DeprecatedChild Clone() {
  401. return new DeprecatedChild(this);
  402. }
  403. public override bool Equals(object other) {
  404. return Equals(other as DeprecatedChild);
  405. }
  406. public bool Equals(DeprecatedChild other) {
  407. if (ReferenceEquals(other, null)) {
  408. return false;
  409. }
  410. if (ReferenceEquals(other, this)) {
  411. return true;
  412. }
  413. return true;
  414. }
  415. public override int GetHashCode() {
  416. int hash = 1;
  417. return hash;
  418. }
  419. public override string ToString() {
  420. return pb::JsonFormatter.Default.Format(this);
  421. }
  422. public void WriteTo(pb::CodedOutputStream output) {
  423. }
  424. public int CalculateSize() {
  425. int size = 0;
  426. return size;
  427. }
  428. public void MergeFrom(DeprecatedChild other) {
  429. if (other == null) {
  430. return;
  431. }
  432. }
  433. public void MergeFrom(pb::CodedInputStream input) {
  434. uint tag;
  435. while ((tag = input.ReadTag()) != 0) {
  436. switch(tag) {
  437. default:
  438. input.SkipLastField();
  439. break;
  440. }
  441. }
  442. }
  443. }
  444. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  445. public sealed partial class DeprecatedFieldsMessage : pb::IMessage<DeprecatedFieldsMessage> {
  446. private static readonly pb::MessageParser<DeprecatedFieldsMessage> _parser = new pb::MessageParser<DeprecatedFieldsMessage>(() => new DeprecatedFieldsMessage());
  447. public static pb::MessageParser<DeprecatedFieldsMessage> Parser { get { return _parser; } }
  448. public static pbr::MessageDescriptor Descriptor {
  449. get { return global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor.MessageTypes[3]; }
  450. }
  451. pbr::MessageDescriptor pb::IMessage.Descriptor {
  452. get { return Descriptor; }
  453. }
  454. public DeprecatedFieldsMessage() {
  455. OnConstruction();
  456. }
  457. partial void OnConstruction();
  458. public DeprecatedFieldsMessage(DeprecatedFieldsMessage other) : this() {
  459. primitiveValue_ = other.primitiveValue_;
  460. primitiveArray_ = other.primitiveArray_.Clone();
  461. MessageValue = other.messageValue_ != null ? other.MessageValue.Clone() : null;
  462. messageArray_ = other.messageArray_.Clone();
  463. enumValue_ = other.enumValue_;
  464. enumArray_ = other.enumArray_.Clone();
  465. }
  466. public DeprecatedFieldsMessage Clone() {
  467. return new DeprecatedFieldsMessage(this);
  468. }
  469. public const int PrimitiveValueFieldNumber = 1;
  470. private int primitiveValue_;
  471. [global::System.ObsoleteAttribute()]
  472. public int PrimitiveValue {
  473. get { return primitiveValue_; }
  474. set {
  475. primitiveValue_ = value;
  476. }
  477. }
  478. public const int PrimitiveArrayFieldNumber = 2;
  479. private static readonly pb::FieldCodec<int> _repeated_primitiveArray_codec
  480. = pb::FieldCodec.ForInt32(18);
  481. private readonly pbc::RepeatedField<int> primitiveArray_ = new pbc::RepeatedField<int>();
  482. [global::System.ObsoleteAttribute()]
  483. public pbc::RepeatedField<int> PrimitiveArray {
  484. get { return primitiveArray_; }
  485. }
  486. public const int MessageValueFieldNumber = 3;
  487. private global::UnitTest.Issues.TestProtos.DeprecatedChild messageValue_;
  488. [global::System.ObsoleteAttribute()]
  489. public global::UnitTest.Issues.TestProtos.DeprecatedChild MessageValue {
  490. get { return messageValue_; }
  491. set {
  492. messageValue_ = value;
  493. }
  494. }
  495. public const int MessageArrayFieldNumber = 4;
  496. private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.DeprecatedChild> _repeated_messageArray_codec
  497. = pb::FieldCodec.ForMessage(34, global::UnitTest.Issues.TestProtos.DeprecatedChild.Parser);
  498. private readonly pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedChild> messageArray_ = new pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedChild>();
  499. [global::System.ObsoleteAttribute()]
  500. public pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedChild> MessageArray {
  501. get { return messageArray_; }
  502. }
  503. public const int EnumValueFieldNumber = 5;
  504. private global::UnitTest.Issues.TestProtos.DeprecatedEnum enumValue_ = global::UnitTest.Issues.TestProtos.DeprecatedEnum.DEPRECATED_ZERO;
  505. [global::System.ObsoleteAttribute()]
  506. public global::UnitTest.Issues.TestProtos.DeprecatedEnum EnumValue {
  507. get { return enumValue_; }
  508. set {
  509. enumValue_ = value;
  510. }
  511. }
  512. public const int EnumArrayFieldNumber = 6;
  513. private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.DeprecatedEnum> _repeated_enumArray_codec
  514. = pb::FieldCodec.ForEnum(50, x => (int) x, x => (global::UnitTest.Issues.TestProtos.DeprecatedEnum) x);
  515. private readonly pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedEnum> enumArray_ = new pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedEnum>();
  516. [global::System.ObsoleteAttribute()]
  517. public pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedEnum> EnumArray {
  518. get { return enumArray_; }
  519. }
  520. public override bool Equals(object other) {
  521. return Equals(other as DeprecatedFieldsMessage);
  522. }
  523. public bool Equals(DeprecatedFieldsMessage other) {
  524. if (ReferenceEquals(other, null)) {
  525. return false;
  526. }
  527. if (ReferenceEquals(other, this)) {
  528. return true;
  529. }
  530. if (PrimitiveValue != other.PrimitiveValue) return false;
  531. if(!primitiveArray_.Equals(other.primitiveArray_)) return false;
  532. if (!object.Equals(MessageValue, other.MessageValue)) return false;
  533. if(!messageArray_.Equals(other.messageArray_)) return false;
  534. if (EnumValue != other.EnumValue) return false;
  535. if(!enumArray_.Equals(other.enumArray_)) return false;
  536. return true;
  537. }
  538. public override int GetHashCode() {
  539. int hash = 1;
  540. if (PrimitiveValue != 0) hash ^= PrimitiveValue.GetHashCode();
  541. hash ^= primitiveArray_.GetHashCode();
  542. if (messageValue_ != null) hash ^= MessageValue.GetHashCode();
  543. hash ^= messageArray_.GetHashCode();
  544. if (EnumValue != global::UnitTest.Issues.TestProtos.DeprecatedEnum.DEPRECATED_ZERO) hash ^= EnumValue.GetHashCode();
  545. hash ^= enumArray_.GetHashCode();
  546. return hash;
  547. }
  548. public override string ToString() {
  549. return pb::JsonFormatter.Default.Format(this);
  550. }
  551. public void WriteTo(pb::CodedOutputStream output) {
  552. if (PrimitiveValue != 0) {
  553. output.WriteRawTag(8);
  554. output.WriteInt32(PrimitiveValue);
  555. }
  556. primitiveArray_.WriteTo(output, _repeated_primitiveArray_codec);
  557. if (messageValue_ != null) {
  558. output.WriteRawTag(26);
  559. output.WriteMessage(MessageValue);
  560. }
  561. messageArray_.WriteTo(output, _repeated_messageArray_codec);
  562. if (EnumValue != global::UnitTest.Issues.TestProtos.DeprecatedEnum.DEPRECATED_ZERO) {
  563. output.WriteRawTag(40);
  564. output.WriteEnum((int) EnumValue);
  565. }
  566. enumArray_.WriteTo(output, _repeated_enumArray_codec);
  567. }
  568. public int CalculateSize() {
  569. int size = 0;
  570. if (PrimitiveValue != 0) {
  571. size += 1 + pb::CodedOutputStream.ComputeInt32Size(PrimitiveValue);
  572. }
  573. size += primitiveArray_.CalculateSize(_repeated_primitiveArray_codec);
  574. if (messageValue_ != null) {
  575. size += 1 + pb::CodedOutputStream.ComputeMessageSize(MessageValue);
  576. }
  577. size += messageArray_.CalculateSize(_repeated_messageArray_codec);
  578. if (EnumValue != global::UnitTest.Issues.TestProtos.DeprecatedEnum.DEPRECATED_ZERO) {
  579. size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) EnumValue);
  580. }
  581. size += enumArray_.CalculateSize(_repeated_enumArray_codec);
  582. return size;
  583. }
  584. public void MergeFrom(DeprecatedFieldsMessage other) {
  585. if (other == null) {
  586. return;
  587. }
  588. if (other.PrimitiveValue != 0) {
  589. PrimitiveValue = other.PrimitiveValue;
  590. }
  591. primitiveArray_.Add(other.primitiveArray_);
  592. if (other.messageValue_ != null) {
  593. if (messageValue_ == null) {
  594. messageValue_ = new global::UnitTest.Issues.TestProtos.DeprecatedChild();
  595. }
  596. MessageValue.MergeFrom(other.MessageValue);
  597. }
  598. messageArray_.Add(other.messageArray_);
  599. if (other.EnumValue != global::UnitTest.Issues.TestProtos.DeprecatedEnum.DEPRECATED_ZERO) {
  600. EnumValue = other.EnumValue;
  601. }
  602. enumArray_.Add(other.enumArray_);
  603. }
  604. public void MergeFrom(pb::CodedInputStream input) {
  605. uint tag;
  606. while ((tag = input.ReadTag()) != 0) {
  607. switch(tag) {
  608. default:
  609. input.SkipLastField();
  610. break;
  611. case 8: {
  612. PrimitiveValue = input.ReadInt32();
  613. break;
  614. }
  615. case 18:
  616. case 16: {
  617. primitiveArray_.AddEntriesFrom(input, _repeated_primitiveArray_codec);
  618. break;
  619. }
  620. case 26: {
  621. if (messageValue_ == null) {
  622. messageValue_ = new global::UnitTest.Issues.TestProtos.DeprecatedChild();
  623. }
  624. input.ReadMessage(messageValue_);
  625. break;
  626. }
  627. case 34: {
  628. messageArray_.AddEntriesFrom(input, _repeated_messageArray_codec);
  629. break;
  630. }
  631. case 40: {
  632. enumValue_ = (global::UnitTest.Issues.TestProtos.DeprecatedEnum) input.ReadEnum();
  633. break;
  634. }
  635. case 50:
  636. case 48: {
  637. enumArray_.AddEntriesFrom(input, _repeated_enumArray_codec);
  638. break;
  639. }
  640. }
  641. }
  642. }
  643. }
  644. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  645. public sealed partial class ItemField : pb::IMessage<ItemField> {
  646. private static readonly pb::MessageParser<ItemField> _parser = new pb::MessageParser<ItemField>(() => new ItemField());
  647. public static pb::MessageParser<ItemField> Parser { get { return _parser; } }
  648. public static pbr::MessageDescriptor Descriptor {
  649. get { return global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor.MessageTypes[4]; }
  650. }
  651. pbr::MessageDescriptor pb::IMessage.Descriptor {
  652. get { return Descriptor; }
  653. }
  654. public ItemField() {
  655. OnConstruction();
  656. }
  657. partial void OnConstruction();
  658. public ItemField(ItemField other) : this() {
  659. item_ = other.item_;
  660. }
  661. public ItemField Clone() {
  662. return new ItemField(this);
  663. }
  664. public const int ItemFieldNumber = 1;
  665. private int item_;
  666. public int Item {
  667. get { return item_; }
  668. set {
  669. item_ = value;
  670. }
  671. }
  672. public override bool Equals(object other) {
  673. return Equals(other as ItemField);
  674. }
  675. public bool Equals(ItemField other) {
  676. if (ReferenceEquals(other, null)) {
  677. return false;
  678. }
  679. if (ReferenceEquals(other, this)) {
  680. return true;
  681. }
  682. if (Item != other.Item) return false;
  683. return true;
  684. }
  685. public override int GetHashCode() {
  686. int hash = 1;
  687. if (Item != 0) hash ^= Item.GetHashCode();
  688. return hash;
  689. }
  690. public override string ToString() {
  691. return pb::JsonFormatter.Default.Format(this);
  692. }
  693. public void WriteTo(pb::CodedOutputStream output) {
  694. if (Item != 0) {
  695. output.WriteRawTag(8);
  696. output.WriteInt32(Item);
  697. }
  698. }
  699. public int CalculateSize() {
  700. int size = 0;
  701. if (Item != 0) {
  702. size += 1 + pb::CodedOutputStream.ComputeInt32Size(Item);
  703. }
  704. return size;
  705. }
  706. public void MergeFrom(ItemField other) {
  707. if (other == null) {
  708. return;
  709. }
  710. if (other.Item != 0) {
  711. Item = other.Item;
  712. }
  713. }
  714. public void MergeFrom(pb::CodedInputStream input) {
  715. uint tag;
  716. while ((tag = input.ReadTag()) != 0) {
  717. switch(tag) {
  718. default:
  719. input.SkipLastField();
  720. break;
  721. case 8: {
  722. Item = input.ReadInt32();
  723. break;
  724. }
  725. }
  726. }
  727. }
  728. }
  729. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  730. public sealed partial class ReservedNames : pb::IMessage<ReservedNames> {
  731. private static readonly pb::MessageParser<ReservedNames> _parser = new pb::MessageParser<ReservedNames>(() => new ReservedNames());
  732. public static pb::MessageParser<ReservedNames> Parser { get { return _parser; } }
  733. public static pbr::MessageDescriptor Descriptor {
  734. get { return global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor.MessageTypes[5]; }
  735. }
  736. pbr::MessageDescriptor pb::IMessage.Descriptor {
  737. get { return Descriptor; }
  738. }
  739. public ReservedNames() {
  740. OnConstruction();
  741. }
  742. partial void OnConstruction();
  743. public ReservedNames(ReservedNames other) : this() {
  744. types_ = other.types_;
  745. descriptor_ = other.descriptor_;
  746. }
  747. public ReservedNames Clone() {
  748. return new ReservedNames(this);
  749. }
  750. public const int Types_FieldNumber = 1;
  751. private int types_;
  752. public int Types_ {
  753. get { return types_; }
  754. set {
  755. types_ = value;
  756. }
  757. }
  758. public const int Descriptor_FieldNumber = 2;
  759. private int descriptor_;
  760. public int Descriptor_ {
  761. get { return descriptor_; }
  762. set {
  763. descriptor_ = value;
  764. }
  765. }
  766. public override bool Equals(object other) {
  767. return Equals(other as ReservedNames);
  768. }
  769. public bool Equals(ReservedNames other) {
  770. if (ReferenceEquals(other, null)) {
  771. return false;
  772. }
  773. if (ReferenceEquals(other, this)) {
  774. return true;
  775. }
  776. if (Types_ != other.Types_) return false;
  777. if (Descriptor_ != other.Descriptor_) return false;
  778. return true;
  779. }
  780. public override int GetHashCode() {
  781. int hash = 1;
  782. if (Types_ != 0) hash ^= Types_.GetHashCode();
  783. if (Descriptor_ != 0) hash ^= Descriptor_.GetHashCode();
  784. return hash;
  785. }
  786. public override string ToString() {
  787. return pb::JsonFormatter.Default.Format(this);
  788. }
  789. public void WriteTo(pb::CodedOutputStream output) {
  790. if (Types_ != 0) {
  791. output.WriteRawTag(8);
  792. output.WriteInt32(Types_);
  793. }
  794. if (Descriptor_ != 0) {
  795. output.WriteRawTag(16);
  796. output.WriteInt32(Descriptor_);
  797. }
  798. }
  799. public int CalculateSize() {
  800. int size = 0;
  801. if (Types_ != 0) {
  802. size += 1 + pb::CodedOutputStream.ComputeInt32Size(Types_);
  803. }
  804. if (Descriptor_ != 0) {
  805. size += 1 + pb::CodedOutputStream.ComputeInt32Size(Descriptor_);
  806. }
  807. return size;
  808. }
  809. public void MergeFrom(ReservedNames other) {
  810. if (other == null) {
  811. return;
  812. }
  813. if (other.Types_ != 0) {
  814. Types_ = other.Types_;
  815. }
  816. if (other.Descriptor_ != 0) {
  817. Descriptor_ = other.Descriptor_;
  818. }
  819. }
  820. public void MergeFrom(pb::CodedInputStream input) {
  821. uint tag;
  822. while ((tag = input.ReadTag()) != 0) {
  823. switch(tag) {
  824. default:
  825. input.SkipLastField();
  826. break;
  827. case 8: {
  828. Types_ = input.ReadInt32();
  829. break;
  830. }
  831. case 16: {
  832. Descriptor_ = input.ReadInt32();
  833. break;
  834. }
  835. }
  836. }
  837. }
  838. #region Nested types
  839. /// <summary>Container for nested types declared in the ReservedNames message type.</summary>
  840. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  841. public static partial class Types {
  842. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  843. public sealed partial class SomeNestedType : pb::IMessage<SomeNestedType> {
  844. private static readonly pb::MessageParser<SomeNestedType> _parser = new pb::MessageParser<SomeNestedType>(() => new SomeNestedType());
  845. public static pb::MessageParser<SomeNestedType> Parser { get { return _parser; } }
  846. public static pbr::MessageDescriptor Descriptor {
  847. get { return global::UnitTest.Issues.TestProtos.ReservedNames.Descriptor.NestedTypes[0]; }
  848. }
  849. pbr::MessageDescriptor pb::IMessage.Descriptor {
  850. get { return Descriptor; }
  851. }
  852. public SomeNestedType() {
  853. OnConstruction();
  854. }
  855. partial void OnConstruction();
  856. public SomeNestedType(SomeNestedType other) : this() {
  857. }
  858. public SomeNestedType Clone() {
  859. return new SomeNestedType(this);
  860. }
  861. public override bool Equals(object other) {
  862. return Equals(other as SomeNestedType);
  863. }
  864. public bool Equals(SomeNestedType other) {
  865. if (ReferenceEquals(other, null)) {
  866. return false;
  867. }
  868. if (ReferenceEquals(other, this)) {
  869. return true;
  870. }
  871. return true;
  872. }
  873. public override int GetHashCode() {
  874. int hash = 1;
  875. return hash;
  876. }
  877. public override string ToString() {
  878. return pb::JsonFormatter.Default.Format(this);
  879. }
  880. public void WriteTo(pb::CodedOutputStream output) {
  881. }
  882. public int CalculateSize() {
  883. int size = 0;
  884. return size;
  885. }
  886. public void MergeFrom(SomeNestedType other) {
  887. if (other == null) {
  888. return;
  889. }
  890. }
  891. public void MergeFrom(pb::CodedInputStream input) {
  892. uint tag;
  893. while ((tag = input.ReadTag()) != 0) {
  894. switch(tag) {
  895. default:
  896. input.SkipLastField();
  897. break;
  898. }
  899. }
  900. }
  901. }
  902. }
  903. #endregion
  904. }
  905. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  906. public sealed partial class TestJsonFieldOrdering : pb::IMessage<TestJsonFieldOrdering> {
  907. private static readonly pb::MessageParser<TestJsonFieldOrdering> _parser = new pb::MessageParser<TestJsonFieldOrdering>(() => new TestJsonFieldOrdering());
  908. public static pb::MessageParser<TestJsonFieldOrdering> Parser { get { return _parser; } }
  909. public static pbr::MessageDescriptor Descriptor {
  910. get { return global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor.MessageTypes[6]; }
  911. }
  912. pbr::MessageDescriptor pb::IMessage.Descriptor {
  913. get { return Descriptor; }
  914. }
  915. public TestJsonFieldOrdering() {
  916. OnConstruction();
  917. }
  918. partial void OnConstruction();
  919. public TestJsonFieldOrdering(TestJsonFieldOrdering other) : this() {
  920. plainInt32_ = other.plainInt32_;
  921. plainString_ = other.plainString_;
  922. switch (other.O1Case) {
  923. case O1OneofCase.O1String:
  924. O1String = other.O1String;
  925. break;
  926. case O1OneofCase.O1Int32:
  927. O1Int32 = other.O1Int32;
  928. break;
  929. }
  930. switch (other.O2Case) {
  931. case O2OneofCase.O2Int32:
  932. O2Int32 = other.O2Int32;
  933. break;
  934. case O2OneofCase.O2String:
  935. O2String = other.O2String;
  936. break;
  937. }
  938. }
  939. public TestJsonFieldOrdering Clone() {
  940. return new TestJsonFieldOrdering(this);
  941. }
  942. public const int PlainInt32FieldNumber = 4;
  943. private int plainInt32_;
  944. public int PlainInt32 {
  945. get { return plainInt32_; }
  946. set {
  947. plainInt32_ = value;
  948. }
  949. }
  950. public const int O1StringFieldNumber = 2;
  951. public string O1String {
  952. get { return o1Case_ == O1OneofCase.O1String ? (string) o1_ : ""; }
  953. set {
  954. o1_ = pb::Preconditions.CheckNotNull(value, "value");
  955. o1Case_ = O1OneofCase.O1String;
  956. }
  957. }
  958. public const int O1Int32FieldNumber = 5;
  959. public int O1Int32 {
  960. get { return o1Case_ == O1OneofCase.O1Int32 ? (int) o1_ : 0; }
  961. set {
  962. o1_ = value;
  963. o1Case_ = O1OneofCase.O1Int32;
  964. }
  965. }
  966. public const int PlainStringFieldNumber = 1;
  967. private string plainString_ = "";
  968. public string PlainString {
  969. get { return plainString_; }
  970. set {
  971. plainString_ = pb::Preconditions.CheckNotNull(value, "value");
  972. }
  973. }
  974. public const int O2Int32FieldNumber = 6;
  975. public int O2Int32 {
  976. get { return o2Case_ == O2OneofCase.O2Int32 ? (int) o2_ : 0; }
  977. set {
  978. o2_ = value;
  979. o2Case_ = O2OneofCase.O2Int32;
  980. }
  981. }
  982. public const int O2StringFieldNumber = 3;
  983. public string O2String {
  984. get { return o2Case_ == O2OneofCase.O2String ? (string) o2_ : ""; }
  985. set {
  986. o2_ = pb::Preconditions.CheckNotNull(value, "value");
  987. o2Case_ = O2OneofCase.O2String;
  988. }
  989. }
  990. private object o1_;
  991. /// <summary>Enum of possible cases for the "o1" oneof.</summary>
  992. public enum O1OneofCase {
  993. None = 0,
  994. O1String = 2,
  995. O1Int32 = 5,
  996. }
  997. private O1OneofCase o1Case_ = O1OneofCase.None;
  998. public O1OneofCase O1Case {
  999. get { return o1Case_; }
  1000. }
  1001. public void ClearO1() {
  1002. o1Case_ = O1OneofCase.None;
  1003. o1_ = null;
  1004. }
  1005. private object o2_;
  1006. /// <summary>Enum of possible cases for the "o2" oneof.</summary>
  1007. public enum O2OneofCase {
  1008. None = 0,
  1009. O2Int32 = 6,
  1010. O2String = 3,
  1011. }
  1012. private O2OneofCase o2Case_ = O2OneofCase.None;
  1013. public O2OneofCase O2Case {
  1014. get { return o2Case_; }
  1015. }
  1016. public void ClearO2() {
  1017. o2Case_ = O2OneofCase.None;
  1018. o2_ = null;
  1019. }
  1020. public override bool Equals(object other) {
  1021. return Equals(other as TestJsonFieldOrdering);
  1022. }
  1023. public bool Equals(TestJsonFieldOrdering other) {
  1024. if (ReferenceEquals(other, null)) {
  1025. return false;
  1026. }
  1027. if (ReferenceEquals(other, this)) {
  1028. return true;
  1029. }
  1030. if (PlainInt32 != other.PlainInt32) return false;
  1031. if (O1String != other.O1String) return false;
  1032. if (O1Int32 != other.O1Int32) return false;
  1033. if (PlainString != other.PlainString) return false;
  1034. if (O2Int32 != other.O2Int32) return false;
  1035. if (O2String != other.O2String) return false;
  1036. return true;
  1037. }
  1038. public override int GetHashCode() {
  1039. int hash = 1;
  1040. if (PlainInt32 != 0) hash ^= PlainInt32.GetHashCode();
  1041. if (o1Case_ == O1OneofCase.O1String) hash ^= O1String.GetHashCode();
  1042. if (o1Case_ == O1OneofCase.O1Int32) hash ^= O1Int32.GetHashCode();
  1043. if (PlainString.Length != 0) hash ^= PlainString.GetHashCode();
  1044. if (o2Case_ == O2OneofCase.O2Int32) hash ^= O2Int32.GetHashCode();
  1045. if (o2Case_ == O2OneofCase.O2String) hash ^= O2String.GetHashCode();
  1046. return hash;
  1047. }
  1048. public override string ToString() {
  1049. return pb::JsonFormatter.Default.Format(this);
  1050. }
  1051. public void WriteTo(pb::CodedOutputStream output) {
  1052. if (PlainString.Length != 0) {
  1053. output.WriteRawTag(10);
  1054. output.WriteString(PlainString);
  1055. }
  1056. if (o1Case_ == O1OneofCase.O1String) {
  1057. output.WriteRawTag(18);
  1058. output.WriteString(O1String);
  1059. }
  1060. if (o2Case_ == O2OneofCase.O2String) {
  1061. output.WriteRawTag(26);
  1062. output.WriteString(O2String);
  1063. }
  1064. if (PlainInt32 != 0) {
  1065. output.WriteRawTag(32);
  1066. output.WriteInt32(PlainInt32);
  1067. }
  1068. if (o1Case_ == O1OneofCase.O1Int32) {
  1069. output.WriteRawTag(40);
  1070. output.WriteInt32(O1Int32);
  1071. }
  1072. if (o2Case_ == O2OneofCase.O2Int32) {
  1073. output.WriteRawTag(48);
  1074. output.WriteInt32(O2Int32);
  1075. }
  1076. }
  1077. public int CalculateSize() {
  1078. int size = 0;
  1079. if (PlainInt32 != 0) {
  1080. size += 1 + pb::CodedOutputStream.ComputeInt32Size(PlainInt32);
  1081. }
  1082. if (o1Case_ == O1OneofCase.O1String) {
  1083. size += 1 + pb::CodedOutputStream.ComputeStringSize(O1String);
  1084. }
  1085. if (o1Case_ == O1OneofCase.O1Int32) {
  1086. size += 1 + pb::CodedOutputStream.ComputeInt32Size(O1Int32);
  1087. }
  1088. if (PlainString.Length != 0) {
  1089. size += 1 + pb::CodedOutputStream.ComputeStringSize(PlainString);
  1090. }
  1091. if (o2Case_ == O2OneofCase.O2Int32) {
  1092. size += 1 + pb::CodedOutputStream.ComputeInt32Size(O2Int32);
  1093. }
  1094. if (o2Case_ == O2OneofCase.O2String) {
  1095. size += 1 + pb::CodedOutputStream.ComputeStringSize(O2String);
  1096. }
  1097. return size;
  1098. }
  1099. public void MergeFrom(TestJsonFieldOrdering other) {
  1100. if (other == null) {
  1101. return;
  1102. }
  1103. if (other.PlainInt32 != 0) {
  1104. PlainInt32 = other.PlainInt32;
  1105. }
  1106. if (other.PlainString.Length != 0) {
  1107. PlainString = other.PlainString;
  1108. }
  1109. switch (other.O1Case) {
  1110. case O1OneofCase.O1String:
  1111. O1String = other.O1String;
  1112. break;
  1113. case O1OneofCase.O1Int32:
  1114. O1Int32 = other.O1Int32;
  1115. break;
  1116. }
  1117. switch (other.O2Case) {
  1118. case O2OneofCase.O2Int32:
  1119. O2Int32 = other.O2Int32;
  1120. break;
  1121. case O2OneofCase.O2String:
  1122. O2String = other.O2String;
  1123. break;
  1124. }
  1125. }
  1126. public void MergeFrom(pb::CodedInputStream input) {
  1127. uint tag;
  1128. while ((tag = input.ReadTag()) != 0) {
  1129. switch(tag) {
  1130. default:
  1131. input.SkipLastField();
  1132. break;
  1133. case 10: {
  1134. PlainString = input.ReadString();
  1135. break;
  1136. }
  1137. case 18: {
  1138. O1String = input.ReadString();
  1139. break;
  1140. }
  1141. case 26: {
  1142. O2String = input.ReadString();
  1143. break;
  1144. }
  1145. case 32: {
  1146. PlainInt32 = input.ReadInt32();
  1147. break;
  1148. }
  1149. case 40: {
  1150. O1Int32 = input.ReadInt32();
  1151. break;
  1152. }
  1153. case 48: {
  1154. O2Int32 = input.ReadInt32();
  1155. break;
  1156. }
  1157. }
  1158. }
  1159. }
  1160. }
  1161. #endregion
  1162. }
  1163. #endregion Designer generated code