UnittestIssues.cs 43 KB

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