UnittestIssues.cs 42 KB

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