UnittestProto3Optional.cs 51 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384
  1. // <auto-generated>
  2. // Generated by the protocol buffer compiler. DO NOT EDIT!
  3. // source: google/protobuf/unittest_proto3_optional.proto
  4. // </auto-generated>
  5. #pragma warning disable 1591, 0612, 3021
  6. #region Designer generated code
  7. using pb = global::Google.Protobuf;
  8. using pbc = global::Google.Protobuf.Collections;
  9. using pbr = global::Google.Protobuf.Reflection;
  10. using scg = global::System.Collections.Generic;
  11. namespace ProtobufUnittest {
  12. /// <summary>Holder for reflection information generated from google/protobuf/unittest_proto3_optional.proto</summary>
  13. public static partial class UnittestProto3OptionalReflection {
  14. #region Descriptor
  15. /// <summary>File descriptor for google/protobuf/unittest_proto3_optional.proto</summary>
  16. public static pbr::FileDescriptor Descriptor {
  17. get { return descriptor; }
  18. }
  19. private static pbr::FileDescriptor descriptor;
  20. static UnittestProto3OptionalReflection() {
  21. byte[] descriptorData = global::System.Convert.FromBase64String(
  22. string.Concat(
  23. "Ci5nb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfcHJvdG8zX29wdGlvbmFsLnBy",
  24. "b3RvEhFwcm90b2J1Zl91bml0dGVzdCKxCgoSVGVzdFByb3RvM09wdGlvbmFs",
  25. "EhsKDm9wdGlvbmFsX2ludDMyGAEgASgFSACIAQESGwoOb3B0aW9uYWxfaW50",
  26. "NjQYAiABKANIAYgBARIcCg9vcHRpb25hbF91aW50MzIYAyABKA1IAogBARIc",
  27. "Cg9vcHRpb25hbF91aW50NjQYBCABKARIA4gBARIcCg9vcHRpb25hbF9zaW50",
  28. "MzIYBSABKBFIBIgBARIcCg9vcHRpb25hbF9zaW50NjQYBiABKBJIBYgBARId",
  29. "ChBvcHRpb25hbF9maXhlZDMyGAcgASgHSAaIAQESHQoQb3B0aW9uYWxfZml4",
  30. "ZWQ2NBgIIAEoBkgHiAEBEh4KEW9wdGlvbmFsX3NmaXhlZDMyGAkgASgPSAiI",
  31. "AQESHgoRb3B0aW9uYWxfc2ZpeGVkNjQYCiABKBBICYgBARIbCg5vcHRpb25h",
  32. "bF9mbG9hdBgLIAEoAkgKiAEBEhwKD29wdGlvbmFsX2RvdWJsZRgMIAEoAUgL",
  33. "iAEBEhoKDW9wdGlvbmFsX2Jvb2wYDSABKAhIDIgBARIcCg9vcHRpb25hbF9z",
  34. "dHJpbmcYDiABKAlIDYgBARIbCg5vcHRpb25hbF9ieXRlcxgPIAEoDEgOiAEB",
  35. "Eh4KDW9wdGlvbmFsX2NvcmQYECABKAlCAggBSA+IAQESWQoXb3B0aW9uYWxf",
  36. "bmVzdGVkX21lc3NhZ2UYEiABKAsyMy5wcm90b2J1Zl91bml0dGVzdC5UZXN0",
  37. "UHJvdG8zT3B0aW9uYWwuTmVzdGVkTWVzc2FnZUgQiAEBElkKE2xhenlfbmVz",
  38. "dGVkX21lc3NhZ2UYEyABKAsyMy5wcm90b2J1Zl91bml0dGVzdC5UZXN0UHJv",
  39. "dG8zT3B0aW9uYWwuTmVzdGVkTWVzc2FnZUICKAFIEYgBARJTChRvcHRpb25h",
  40. "bF9uZXN0ZWRfZW51bRgVIAEoDjIwLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RQ",
  41. "cm90bzNPcHRpb25hbC5OZXN0ZWRFbnVtSBKIAQESFgoOc2luZ3VsYXJfaW50",
  42. "MzIYFiABKAUSFgoOc2luZ3VsYXJfaW50NjQYFyABKAMaJwoNTmVzdGVkTWVz",
  43. "c2FnZRIPCgJiYhgBIAEoBUgAiAEBQgUKA19iYiJKCgpOZXN0ZWRFbnVtEg8K",
  44. "C1VOU1BFQ0lGSUVEEAASBwoDRk9PEAESBwoDQkFSEAISBwoDQkFaEAMSEAoD",
  45. "TkVHEP///////////wFCEQoPX29wdGlvbmFsX2ludDMyQhEKD19vcHRpb25h",
  46. "bF9pbnQ2NEISChBfb3B0aW9uYWxfdWludDMyQhIKEF9vcHRpb25hbF91aW50",
  47. "NjRCEgoQX29wdGlvbmFsX3NpbnQzMkISChBfb3B0aW9uYWxfc2ludDY0QhMK",
  48. "EV9vcHRpb25hbF9maXhlZDMyQhMKEV9vcHRpb25hbF9maXhlZDY0QhQKEl9v",
  49. "cHRpb25hbF9zZml4ZWQzMkIUChJfb3B0aW9uYWxfc2ZpeGVkNjRCEQoPX29w",
  50. "dGlvbmFsX2Zsb2F0QhIKEF9vcHRpb25hbF9kb3VibGVCEAoOX29wdGlvbmFs",
  51. "X2Jvb2xCEgoQX29wdGlvbmFsX3N0cmluZ0IRCg9fb3B0aW9uYWxfYnl0ZXNC",
  52. "EAoOX29wdGlvbmFsX2NvcmRCGgoYX29wdGlvbmFsX25lc3RlZF9tZXNzYWdl",
  53. "QhYKFF9sYXp5X25lc3RlZF9tZXNzYWdlQhcKFV9vcHRpb25hbF9uZXN0ZWRf",
  54. "ZW51bUIlCiFjb20uZ29vZ2xlLnByb3RvYnVmLnRlc3RpbmcucHJvdG9QAWIG",
  55. "cHJvdG8z"));
  56. descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
  57. new pbr::FileDescriptor[] { },
  58. new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
  59. new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufUnittest.TestProto3Optional), global::ProtobufUnittest.TestProto3Optional.Parser, new[]{ "OptionalInt32", "OptionalInt64", "OptionalUint32", "OptionalUint64", "OptionalSint32", "OptionalSint64", "OptionalFixed32", "OptionalFixed64", "OptionalSfixed32", "OptionalSfixed64", "OptionalFloat", "OptionalDouble", "OptionalBool", "OptionalString", "OptionalBytes", "OptionalCord", "OptionalNestedMessage", "LazyNestedMessage", "OptionalNestedEnum", "SingularInt32", "SingularInt64" }, new[]{ "OptionalInt32", "OptionalInt64", "OptionalUint32", "OptionalUint64", "OptionalSint32", "OptionalSint64", "OptionalFixed32", "OptionalFixed64", "OptionalSfixed32", "OptionalSfixed64", "OptionalFloat", "OptionalDouble", "OptionalBool", "OptionalString", "OptionalBytes", "OptionalCord", "OptionalNestedMessage", "LazyNestedMessage", "OptionalNestedEnum" }, new[]{ typeof(global::ProtobufUnittest.TestProto3Optional.Types.NestedEnum) }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage), global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage.Parser, new[]{ "Bb" }, new[]{ "Bb" }, null, null, null)})
  60. }));
  61. }
  62. #endregion
  63. }
  64. #region Messages
  65. public sealed partial class TestProto3Optional : pb::IMessage<TestProto3Optional>
  66. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  67. , pb::IBufferMessage
  68. #endif
  69. {
  70. private static readonly pb::MessageParser<TestProto3Optional> _parser = new pb::MessageParser<TestProto3Optional>(() => new TestProto3Optional());
  71. private pb::UnknownFieldSet _unknownFields;
  72. private int _hasBits0;
  73. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  74. public static pb::MessageParser<TestProto3Optional> Parser { get { return _parser; } }
  75. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  76. public static pbr::MessageDescriptor Descriptor {
  77. get { return global::ProtobufUnittest.UnittestProto3OptionalReflection.Descriptor.MessageTypes[0]; }
  78. }
  79. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  80. pbr::MessageDescriptor pb::IMessage.Descriptor {
  81. get { return Descriptor; }
  82. }
  83. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  84. public TestProto3Optional() {
  85. OnConstruction();
  86. }
  87. partial void OnConstruction();
  88. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  89. public TestProto3Optional(TestProto3Optional other) : this() {
  90. _hasBits0 = other._hasBits0;
  91. optionalInt32_ = other.optionalInt32_;
  92. optionalInt64_ = other.optionalInt64_;
  93. optionalUint32_ = other.optionalUint32_;
  94. optionalUint64_ = other.optionalUint64_;
  95. optionalSint32_ = other.optionalSint32_;
  96. optionalSint64_ = other.optionalSint64_;
  97. optionalFixed32_ = other.optionalFixed32_;
  98. optionalFixed64_ = other.optionalFixed64_;
  99. optionalSfixed32_ = other.optionalSfixed32_;
  100. optionalSfixed64_ = other.optionalSfixed64_;
  101. optionalFloat_ = other.optionalFloat_;
  102. optionalDouble_ = other.optionalDouble_;
  103. optionalBool_ = other.optionalBool_;
  104. optionalString_ = other.optionalString_;
  105. optionalBytes_ = other.optionalBytes_;
  106. optionalCord_ = other.optionalCord_;
  107. optionalNestedMessage_ = other.optionalNestedMessage_ != null ? other.optionalNestedMessage_.Clone() : null;
  108. lazyNestedMessage_ = other.lazyNestedMessage_ != null ? other.lazyNestedMessage_.Clone() : null;
  109. optionalNestedEnum_ = other.optionalNestedEnum_;
  110. singularInt32_ = other.singularInt32_;
  111. singularInt64_ = other.singularInt64_;
  112. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  113. }
  114. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  115. public TestProto3Optional Clone() {
  116. return new TestProto3Optional(this);
  117. }
  118. /// <summary>Field number for the "optional_int32" field.</summary>
  119. public const int OptionalInt32FieldNumber = 1;
  120. private int optionalInt32_;
  121. /// <summary>
  122. /// Singular
  123. /// </summary>
  124. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  125. public int OptionalInt32 {
  126. get { if ((_hasBits0 & 1) != 0) { return optionalInt32_; } else { return 0; } }
  127. set {
  128. _hasBits0 |= 1;
  129. optionalInt32_ = value;
  130. }
  131. }
  132. /// <summary>Gets whether the "optional_int32" field is set</summary>
  133. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  134. public bool HasOptionalInt32 {
  135. get { return (_hasBits0 & 1) != 0; }
  136. }
  137. /// <summary>Clears the value of the "optional_int32" field</summary>
  138. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  139. public void ClearOptionalInt32() {
  140. _hasBits0 &= ~1;
  141. }
  142. /// <summary>Field number for the "optional_int64" field.</summary>
  143. public const int OptionalInt64FieldNumber = 2;
  144. private long optionalInt64_;
  145. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  146. public long OptionalInt64 {
  147. get { if ((_hasBits0 & 2) != 0) { return optionalInt64_; } else { return 0L; } }
  148. set {
  149. _hasBits0 |= 2;
  150. optionalInt64_ = value;
  151. }
  152. }
  153. /// <summary>Gets whether the "optional_int64" field is set</summary>
  154. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  155. public bool HasOptionalInt64 {
  156. get { return (_hasBits0 & 2) != 0; }
  157. }
  158. /// <summary>Clears the value of the "optional_int64" field</summary>
  159. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  160. public void ClearOptionalInt64() {
  161. _hasBits0 &= ~2;
  162. }
  163. /// <summary>Field number for the "optional_uint32" field.</summary>
  164. public const int OptionalUint32FieldNumber = 3;
  165. private uint optionalUint32_;
  166. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  167. public uint OptionalUint32 {
  168. get { if ((_hasBits0 & 4) != 0) { return optionalUint32_; } else { return 0; } }
  169. set {
  170. _hasBits0 |= 4;
  171. optionalUint32_ = value;
  172. }
  173. }
  174. /// <summary>Gets whether the "optional_uint32" field is set</summary>
  175. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  176. public bool HasOptionalUint32 {
  177. get { return (_hasBits0 & 4) != 0; }
  178. }
  179. /// <summary>Clears the value of the "optional_uint32" field</summary>
  180. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  181. public void ClearOptionalUint32() {
  182. _hasBits0 &= ~4;
  183. }
  184. /// <summary>Field number for the "optional_uint64" field.</summary>
  185. public const int OptionalUint64FieldNumber = 4;
  186. private ulong optionalUint64_;
  187. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  188. public ulong OptionalUint64 {
  189. get { if ((_hasBits0 & 8) != 0) { return optionalUint64_; } else { return 0UL; } }
  190. set {
  191. _hasBits0 |= 8;
  192. optionalUint64_ = value;
  193. }
  194. }
  195. /// <summary>Gets whether the "optional_uint64" field is set</summary>
  196. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  197. public bool HasOptionalUint64 {
  198. get { return (_hasBits0 & 8) != 0; }
  199. }
  200. /// <summary>Clears the value of the "optional_uint64" field</summary>
  201. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  202. public void ClearOptionalUint64() {
  203. _hasBits0 &= ~8;
  204. }
  205. /// <summary>Field number for the "optional_sint32" field.</summary>
  206. public const int OptionalSint32FieldNumber = 5;
  207. private int optionalSint32_;
  208. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  209. public int OptionalSint32 {
  210. get { if ((_hasBits0 & 16) != 0) { return optionalSint32_; } else { return 0; } }
  211. set {
  212. _hasBits0 |= 16;
  213. optionalSint32_ = value;
  214. }
  215. }
  216. /// <summary>Gets whether the "optional_sint32" field is set</summary>
  217. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  218. public bool HasOptionalSint32 {
  219. get { return (_hasBits0 & 16) != 0; }
  220. }
  221. /// <summary>Clears the value of the "optional_sint32" field</summary>
  222. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  223. public void ClearOptionalSint32() {
  224. _hasBits0 &= ~16;
  225. }
  226. /// <summary>Field number for the "optional_sint64" field.</summary>
  227. public const int OptionalSint64FieldNumber = 6;
  228. private long optionalSint64_;
  229. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  230. public long OptionalSint64 {
  231. get { if ((_hasBits0 & 32) != 0) { return optionalSint64_; } else { return 0L; } }
  232. set {
  233. _hasBits0 |= 32;
  234. optionalSint64_ = value;
  235. }
  236. }
  237. /// <summary>Gets whether the "optional_sint64" field is set</summary>
  238. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  239. public bool HasOptionalSint64 {
  240. get { return (_hasBits0 & 32) != 0; }
  241. }
  242. /// <summary>Clears the value of the "optional_sint64" field</summary>
  243. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  244. public void ClearOptionalSint64() {
  245. _hasBits0 &= ~32;
  246. }
  247. /// <summary>Field number for the "optional_fixed32" field.</summary>
  248. public const int OptionalFixed32FieldNumber = 7;
  249. private uint optionalFixed32_;
  250. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  251. public uint OptionalFixed32 {
  252. get { if ((_hasBits0 & 64) != 0) { return optionalFixed32_; } else { return 0; } }
  253. set {
  254. _hasBits0 |= 64;
  255. optionalFixed32_ = value;
  256. }
  257. }
  258. /// <summary>Gets whether the "optional_fixed32" field is set</summary>
  259. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  260. public bool HasOptionalFixed32 {
  261. get { return (_hasBits0 & 64) != 0; }
  262. }
  263. /// <summary>Clears the value of the "optional_fixed32" field</summary>
  264. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  265. public void ClearOptionalFixed32() {
  266. _hasBits0 &= ~64;
  267. }
  268. /// <summary>Field number for the "optional_fixed64" field.</summary>
  269. public const int OptionalFixed64FieldNumber = 8;
  270. private ulong optionalFixed64_;
  271. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  272. public ulong OptionalFixed64 {
  273. get { if ((_hasBits0 & 128) != 0) { return optionalFixed64_; } else { return 0UL; } }
  274. set {
  275. _hasBits0 |= 128;
  276. optionalFixed64_ = value;
  277. }
  278. }
  279. /// <summary>Gets whether the "optional_fixed64" field is set</summary>
  280. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  281. public bool HasOptionalFixed64 {
  282. get { return (_hasBits0 & 128) != 0; }
  283. }
  284. /// <summary>Clears the value of the "optional_fixed64" field</summary>
  285. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  286. public void ClearOptionalFixed64() {
  287. _hasBits0 &= ~128;
  288. }
  289. /// <summary>Field number for the "optional_sfixed32" field.</summary>
  290. public const int OptionalSfixed32FieldNumber = 9;
  291. private int optionalSfixed32_;
  292. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  293. public int OptionalSfixed32 {
  294. get { if ((_hasBits0 & 256) != 0) { return optionalSfixed32_; } else { return 0; } }
  295. set {
  296. _hasBits0 |= 256;
  297. optionalSfixed32_ = value;
  298. }
  299. }
  300. /// <summary>Gets whether the "optional_sfixed32" field is set</summary>
  301. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  302. public bool HasOptionalSfixed32 {
  303. get { return (_hasBits0 & 256) != 0; }
  304. }
  305. /// <summary>Clears the value of the "optional_sfixed32" field</summary>
  306. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  307. public void ClearOptionalSfixed32() {
  308. _hasBits0 &= ~256;
  309. }
  310. /// <summary>Field number for the "optional_sfixed64" field.</summary>
  311. public const int OptionalSfixed64FieldNumber = 10;
  312. private long optionalSfixed64_;
  313. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  314. public long OptionalSfixed64 {
  315. get { if ((_hasBits0 & 512) != 0) { return optionalSfixed64_; } else { return 0L; } }
  316. set {
  317. _hasBits0 |= 512;
  318. optionalSfixed64_ = value;
  319. }
  320. }
  321. /// <summary>Gets whether the "optional_sfixed64" field is set</summary>
  322. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  323. public bool HasOptionalSfixed64 {
  324. get { return (_hasBits0 & 512) != 0; }
  325. }
  326. /// <summary>Clears the value of the "optional_sfixed64" field</summary>
  327. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  328. public void ClearOptionalSfixed64() {
  329. _hasBits0 &= ~512;
  330. }
  331. /// <summary>Field number for the "optional_float" field.</summary>
  332. public const int OptionalFloatFieldNumber = 11;
  333. private float optionalFloat_;
  334. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  335. public float OptionalFloat {
  336. get { if ((_hasBits0 & 1024) != 0) { return optionalFloat_; } else { return 0F; } }
  337. set {
  338. _hasBits0 |= 1024;
  339. optionalFloat_ = value;
  340. }
  341. }
  342. /// <summary>Gets whether the "optional_float" field is set</summary>
  343. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  344. public bool HasOptionalFloat {
  345. get { return (_hasBits0 & 1024) != 0; }
  346. }
  347. /// <summary>Clears the value of the "optional_float" field</summary>
  348. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  349. public void ClearOptionalFloat() {
  350. _hasBits0 &= ~1024;
  351. }
  352. /// <summary>Field number for the "optional_double" field.</summary>
  353. public const int OptionalDoubleFieldNumber = 12;
  354. private double optionalDouble_;
  355. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  356. public double OptionalDouble {
  357. get { if ((_hasBits0 & 2048) != 0) { return optionalDouble_; } else { return 0D; } }
  358. set {
  359. _hasBits0 |= 2048;
  360. optionalDouble_ = value;
  361. }
  362. }
  363. /// <summary>Gets whether the "optional_double" field is set</summary>
  364. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  365. public bool HasOptionalDouble {
  366. get { return (_hasBits0 & 2048) != 0; }
  367. }
  368. /// <summary>Clears the value of the "optional_double" field</summary>
  369. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  370. public void ClearOptionalDouble() {
  371. _hasBits0 &= ~2048;
  372. }
  373. /// <summary>Field number for the "optional_bool" field.</summary>
  374. public const int OptionalBoolFieldNumber = 13;
  375. private bool optionalBool_;
  376. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  377. public bool OptionalBool {
  378. get { if ((_hasBits0 & 4096) != 0) { return optionalBool_; } else { return false; } }
  379. set {
  380. _hasBits0 |= 4096;
  381. optionalBool_ = value;
  382. }
  383. }
  384. /// <summary>Gets whether the "optional_bool" field is set</summary>
  385. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  386. public bool HasOptionalBool {
  387. get { return (_hasBits0 & 4096) != 0; }
  388. }
  389. /// <summary>Clears the value of the "optional_bool" field</summary>
  390. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  391. public void ClearOptionalBool() {
  392. _hasBits0 &= ~4096;
  393. }
  394. /// <summary>Field number for the "optional_string" field.</summary>
  395. public const int OptionalStringFieldNumber = 14;
  396. private string optionalString_;
  397. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  398. public string OptionalString {
  399. get { return optionalString_ ?? ""; }
  400. set {
  401. optionalString_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  402. }
  403. }
  404. /// <summary>Gets whether the "optional_string" field is set</summary>
  405. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  406. public bool HasOptionalString {
  407. get { return optionalString_ != null; }
  408. }
  409. /// <summary>Clears the value of the "optional_string" field</summary>
  410. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  411. public void ClearOptionalString() {
  412. optionalString_ = null;
  413. }
  414. /// <summary>Field number for the "optional_bytes" field.</summary>
  415. public const int OptionalBytesFieldNumber = 15;
  416. private pb::ByteString optionalBytes_;
  417. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  418. public pb::ByteString OptionalBytes {
  419. get { return optionalBytes_ ?? pb::ByteString.Empty; }
  420. set {
  421. optionalBytes_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  422. }
  423. }
  424. /// <summary>Gets whether the "optional_bytes" field is set</summary>
  425. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  426. public bool HasOptionalBytes {
  427. get { return optionalBytes_ != null; }
  428. }
  429. /// <summary>Clears the value of the "optional_bytes" field</summary>
  430. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  431. public void ClearOptionalBytes() {
  432. optionalBytes_ = null;
  433. }
  434. /// <summary>Field number for the "optional_cord" field.</summary>
  435. public const int OptionalCordFieldNumber = 16;
  436. private string optionalCord_;
  437. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  438. public string OptionalCord {
  439. get { return optionalCord_ ?? ""; }
  440. set {
  441. optionalCord_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  442. }
  443. }
  444. /// <summary>Gets whether the "optional_cord" field is set</summary>
  445. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  446. public bool HasOptionalCord {
  447. get { return optionalCord_ != null; }
  448. }
  449. /// <summary>Clears the value of the "optional_cord" field</summary>
  450. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  451. public void ClearOptionalCord() {
  452. optionalCord_ = null;
  453. }
  454. /// <summary>Field number for the "optional_nested_message" field.</summary>
  455. public const int OptionalNestedMessageFieldNumber = 18;
  456. private global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage optionalNestedMessage_;
  457. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  458. public global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage OptionalNestedMessage {
  459. get { return optionalNestedMessage_; }
  460. set {
  461. optionalNestedMessage_ = value;
  462. }
  463. }
  464. /// <summary>Field number for the "lazy_nested_message" field.</summary>
  465. public const int LazyNestedMessageFieldNumber = 19;
  466. private global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage lazyNestedMessage_;
  467. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  468. public global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage LazyNestedMessage {
  469. get { return lazyNestedMessage_; }
  470. set {
  471. lazyNestedMessage_ = value;
  472. }
  473. }
  474. /// <summary>Field number for the "optional_nested_enum" field.</summary>
  475. public const int OptionalNestedEnumFieldNumber = 21;
  476. private global::ProtobufUnittest.TestProto3Optional.Types.NestedEnum optionalNestedEnum_;
  477. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  478. public global::ProtobufUnittest.TestProto3Optional.Types.NestedEnum OptionalNestedEnum {
  479. get { if ((_hasBits0 & 8192) != 0) { return optionalNestedEnum_; } else { return global::ProtobufUnittest.TestProto3Optional.Types.NestedEnum.Unspecified; } }
  480. set {
  481. _hasBits0 |= 8192;
  482. optionalNestedEnum_ = value;
  483. }
  484. }
  485. /// <summary>Gets whether the "optional_nested_enum" field is set</summary>
  486. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  487. public bool HasOptionalNestedEnum {
  488. get { return (_hasBits0 & 8192) != 0; }
  489. }
  490. /// <summary>Clears the value of the "optional_nested_enum" field</summary>
  491. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  492. public void ClearOptionalNestedEnum() {
  493. _hasBits0 &= ~8192;
  494. }
  495. /// <summary>Field number for the "singular_int32" field.</summary>
  496. public const int SingularInt32FieldNumber = 22;
  497. private int singularInt32_;
  498. /// <summary>
  499. /// Add some non-optional fields to verify we can mix them.
  500. /// </summary>
  501. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  502. public int SingularInt32 {
  503. get { return singularInt32_; }
  504. set {
  505. singularInt32_ = value;
  506. }
  507. }
  508. /// <summary>Field number for the "singular_int64" field.</summary>
  509. public const int SingularInt64FieldNumber = 23;
  510. private long singularInt64_;
  511. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  512. public long SingularInt64 {
  513. get { return singularInt64_; }
  514. set {
  515. singularInt64_ = value;
  516. }
  517. }
  518. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  519. public override bool Equals(object other) {
  520. return Equals(other as TestProto3Optional);
  521. }
  522. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  523. public bool Equals(TestProto3Optional other) {
  524. if (ReferenceEquals(other, null)) {
  525. return false;
  526. }
  527. if (ReferenceEquals(other, this)) {
  528. return true;
  529. }
  530. if (OptionalInt32 != other.OptionalInt32) return false;
  531. if (OptionalInt64 != other.OptionalInt64) return false;
  532. if (OptionalUint32 != other.OptionalUint32) return false;
  533. if (OptionalUint64 != other.OptionalUint64) return false;
  534. if (OptionalSint32 != other.OptionalSint32) return false;
  535. if (OptionalSint64 != other.OptionalSint64) return false;
  536. if (OptionalFixed32 != other.OptionalFixed32) return false;
  537. if (OptionalFixed64 != other.OptionalFixed64) return false;
  538. if (OptionalSfixed32 != other.OptionalSfixed32) return false;
  539. if (OptionalSfixed64 != other.OptionalSfixed64) return false;
  540. if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(OptionalFloat, other.OptionalFloat)) return false;
  541. if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(OptionalDouble, other.OptionalDouble)) return false;
  542. if (OptionalBool != other.OptionalBool) return false;
  543. if (OptionalString != other.OptionalString) return false;
  544. if (OptionalBytes != other.OptionalBytes) return false;
  545. if (OptionalCord != other.OptionalCord) return false;
  546. if (!object.Equals(OptionalNestedMessage, other.OptionalNestedMessage)) return false;
  547. if (!object.Equals(LazyNestedMessage, other.LazyNestedMessage)) return false;
  548. if (OptionalNestedEnum != other.OptionalNestedEnum) return false;
  549. if (SingularInt32 != other.SingularInt32) return false;
  550. if (SingularInt64 != other.SingularInt64) return false;
  551. return Equals(_unknownFields, other._unknownFields);
  552. }
  553. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  554. public override int GetHashCode() {
  555. int hash = 1;
  556. if (HasOptionalInt32) hash ^= OptionalInt32.GetHashCode();
  557. if (HasOptionalInt64) hash ^= OptionalInt64.GetHashCode();
  558. if (HasOptionalUint32) hash ^= OptionalUint32.GetHashCode();
  559. if (HasOptionalUint64) hash ^= OptionalUint64.GetHashCode();
  560. if (HasOptionalSint32) hash ^= OptionalSint32.GetHashCode();
  561. if (HasOptionalSint64) hash ^= OptionalSint64.GetHashCode();
  562. if (HasOptionalFixed32) hash ^= OptionalFixed32.GetHashCode();
  563. if (HasOptionalFixed64) hash ^= OptionalFixed64.GetHashCode();
  564. if (HasOptionalSfixed32) hash ^= OptionalSfixed32.GetHashCode();
  565. if (HasOptionalSfixed64) hash ^= OptionalSfixed64.GetHashCode();
  566. if (HasOptionalFloat) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(OptionalFloat);
  567. if (HasOptionalDouble) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(OptionalDouble);
  568. if (HasOptionalBool) hash ^= OptionalBool.GetHashCode();
  569. if (HasOptionalString) hash ^= OptionalString.GetHashCode();
  570. if (HasOptionalBytes) hash ^= OptionalBytes.GetHashCode();
  571. if (HasOptionalCord) hash ^= OptionalCord.GetHashCode();
  572. if (optionalNestedMessage_ != null) hash ^= OptionalNestedMessage.GetHashCode();
  573. if (lazyNestedMessage_ != null) hash ^= LazyNestedMessage.GetHashCode();
  574. if (HasOptionalNestedEnum) hash ^= OptionalNestedEnum.GetHashCode();
  575. if (SingularInt32 != 0) hash ^= SingularInt32.GetHashCode();
  576. if (SingularInt64 != 0L) hash ^= SingularInt64.GetHashCode();
  577. if (_unknownFields != null) {
  578. hash ^= _unknownFields.GetHashCode();
  579. }
  580. return hash;
  581. }
  582. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  583. public override string ToString() {
  584. return pb::JsonFormatter.ToDiagnosticString(this);
  585. }
  586. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  587. public void WriteTo(pb::CodedOutputStream output) {
  588. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  589. output.WriteRawMessage(this);
  590. #else
  591. if (HasOptionalInt32) {
  592. output.WriteRawTag(8);
  593. output.WriteInt32(OptionalInt32);
  594. }
  595. if (HasOptionalInt64) {
  596. output.WriteRawTag(16);
  597. output.WriteInt64(OptionalInt64);
  598. }
  599. if (HasOptionalUint32) {
  600. output.WriteRawTag(24);
  601. output.WriteUInt32(OptionalUint32);
  602. }
  603. if (HasOptionalUint64) {
  604. output.WriteRawTag(32);
  605. output.WriteUInt64(OptionalUint64);
  606. }
  607. if (HasOptionalSint32) {
  608. output.WriteRawTag(40);
  609. output.WriteSInt32(OptionalSint32);
  610. }
  611. if (HasOptionalSint64) {
  612. output.WriteRawTag(48);
  613. output.WriteSInt64(OptionalSint64);
  614. }
  615. if (HasOptionalFixed32) {
  616. output.WriteRawTag(61);
  617. output.WriteFixed32(OptionalFixed32);
  618. }
  619. if (HasOptionalFixed64) {
  620. output.WriteRawTag(65);
  621. output.WriteFixed64(OptionalFixed64);
  622. }
  623. if (HasOptionalSfixed32) {
  624. output.WriteRawTag(77);
  625. output.WriteSFixed32(OptionalSfixed32);
  626. }
  627. if (HasOptionalSfixed64) {
  628. output.WriteRawTag(81);
  629. output.WriteSFixed64(OptionalSfixed64);
  630. }
  631. if (HasOptionalFloat) {
  632. output.WriteRawTag(93);
  633. output.WriteFloat(OptionalFloat);
  634. }
  635. if (HasOptionalDouble) {
  636. output.WriteRawTag(97);
  637. output.WriteDouble(OptionalDouble);
  638. }
  639. if (HasOptionalBool) {
  640. output.WriteRawTag(104);
  641. output.WriteBool(OptionalBool);
  642. }
  643. if (HasOptionalString) {
  644. output.WriteRawTag(114);
  645. output.WriteString(OptionalString);
  646. }
  647. if (HasOptionalBytes) {
  648. output.WriteRawTag(122);
  649. output.WriteBytes(OptionalBytes);
  650. }
  651. if (HasOptionalCord) {
  652. output.WriteRawTag(130, 1);
  653. output.WriteString(OptionalCord);
  654. }
  655. if (optionalNestedMessage_ != null) {
  656. output.WriteRawTag(146, 1);
  657. output.WriteMessage(OptionalNestedMessage);
  658. }
  659. if (lazyNestedMessage_ != null) {
  660. output.WriteRawTag(154, 1);
  661. output.WriteMessage(LazyNestedMessage);
  662. }
  663. if (HasOptionalNestedEnum) {
  664. output.WriteRawTag(168, 1);
  665. output.WriteEnum((int) OptionalNestedEnum);
  666. }
  667. if (SingularInt32 != 0) {
  668. output.WriteRawTag(176, 1);
  669. output.WriteInt32(SingularInt32);
  670. }
  671. if (SingularInt64 != 0L) {
  672. output.WriteRawTag(184, 1);
  673. output.WriteInt64(SingularInt64);
  674. }
  675. if (_unknownFields != null) {
  676. _unknownFields.WriteTo(output);
  677. }
  678. #endif
  679. }
  680. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  681. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  682. void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
  683. if (HasOptionalInt32) {
  684. output.WriteRawTag(8);
  685. output.WriteInt32(OptionalInt32);
  686. }
  687. if (HasOptionalInt64) {
  688. output.WriteRawTag(16);
  689. output.WriteInt64(OptionalInt64);
  690. }
  691. if (HasOptionalUint32) {
  692. output.WriteRawTag(24);
  693. output.WriteUInt32(OptionalUint32);
  694. }
  695. if (HasOptionalUint64) {
  696. output.WriteRawTag(32);
  697. output.WriteUInt64(OptionalUint64);
  698. }
  699. if (HasOptionalSint32) {
  700. output.WriteRawTag(40);
  701. output.WriteSInt32(OptionalSint32);
  702. }
  703. if (HasOptionalSint64) {
  704. output.WriteRawTag(48);
  705. output.WriteSInt64(OptionalSint64);
  706. }
  707. if (HasOptionalFixed32) {
  708. output.WriteRawTag(61);
  709. output.WriteFixed32(OptionalFixed32);
  710. }
  711. if (HasOptionalFixed64) {
  712. output.WriteRawTag(65);
  713. output.WriteFixed64(OptionalFixed64);
  714. }
  715. if (HasOptionalSfixed32) {
  716. output.WriteRawTag(77);
  717. output.WriteSFixed32(OptionalSfixed32);
  718. }
  719. if (HasOptionalSfixed64) {
  720. output.WriteRawTag(81);
  721. output.WriteSFixed64(OptionalSfixed64);
  722. }
  723. if (HasOptionalFloat) {
  724. output.WriteRawTag(93);
  725. output.WriteFloat(OptionalFloat);
  726. }
  727. if (HasOptionalDouble) {
  728. output.WriteRawTag(97);
  729. output.WriteDouble(OptionalDouble);
  730. }
  731. if (HasOptionalBool) {
  732. output.WriteRawTag(104);
  733. output.WriteBool(OptionalBool);
  734. }
  735. if (HasOptionalString) {
  736. output.WriteRawTag(114);
  737. output.WriteString(OptionalString);
  738. }
  739. if (HasOptionalBytes) {
  740. output.WriteRawTag(122);
  741. output.WriteBytes(OptionalBytes);
  742. }
  743. if (HasOptionalCord) {
  744. output.WriteRawTag(130, 1);
  745. output.WriteString(OptionalCord);
  746. }
  747. if (optionalNestedMessage_ != null) {
  748. output.WriteRawTag(146, 1);
  749. output.WriteMessage(OptionalNestedMessage);
  750. }
  751. if (lazyNestedMessage_ != null) {
  752. output.WriteRawTag(154, 1);
  753. output.WriteMessage(LazyNestedMessage);
  754. }
  755. if (HasOptionalNestedEnum) {
  756. output.WriteRawTag(168, 1);
  757. output.WriteEnum((int) OptionalNestedEnum);
  758. }
  759. if (SingularInt32 != 0) {
  760. output.WriteRawTag(176, 1);
  761. output.WriteInt32(SingularInt32);
  762. }
  763. if (SingularInt64 != 0L) {
  764. output.WriteRawTag(184, 1);
  765. output.WriteInt64(SingularInt64);
  766. }
  767. if (_unknownFields != null) {
  768. _unknownFields.WriteTo(ref output);
  769. }
  770. }
  771. #endif
  772. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  773. public int CalculateSize() {
  774. int size = 0;
  775. if (HasOptionalInt32) {
  776. size += 1 + pb::CodedOutputStream.ComputeInt32Size(OptionalInt32);
  777. }
  778. if (HasOptionalInt64) {
  779. size += 1 + pb::CodedOutputStream.ComputeInt64Size(OptionalInt64);
  780. }
  781. if (HasOptionalUint32) {
  782. size += 1 + pb::CodedOutputStream.ComputeUInt32Size(OptionalUint32);
  783. }
  784. if (HasOptionalUint64) {
  785. size += 1 + pb::CodedOutputStream.ComputeUInt64Size(OptionalUint64);
  786. }
  787. if (HasOptionalSint32) {
  788. size += 1 + pb::CodedOutputStream.ComputeSInt32Size(OptionalSint32);
  789. }
  790. if (HasOptionalSint64) {
  791. size += 1 + pb::CodedOutputStream.ComputeSInt64Size(OptionalSint64);
  792. }
  793. if (HasOptionalFixed32) {
  794. size += 1 + 4;
  795. }
  796. if (HasOptionalFixed64) {
  797. size += 1 + 8;
  798. }
  799. if (HasOptionalSfixed32) {
  800. size += 1 + 4;
  801. }
  802. if (HasOptionalSfixed64) {
  803. size += 1 + 8;
  804. }
  805. if (HasOptionalFloat) {
  806. size += 1 + 4;
  807. }
  808. if (HasOptionalDouble) {
  809. size += 1 + 8;
  810. }
  811. if (HasOptionalBool) {
  812. size += 1 + 1;
  813. }
  814. if (HasOptionalString) {
  815. size += 1 + pb::CodedOutputStream.ComputeStringSize(OptionalString);
  816. }
  817. if (HasOptionalBytes) {
  818. size += 1 + pb::CodedOutputStream.ComputeBytesSize(OptionalBytes);
  819. }
  820. if (HasOptionalCord) {
  821. size += 2 + pb::CodedOutputStream.ComputeStringSize(OptionalCord);
  822. }
  823. if (optionalNestedMessage_ != null) {
  824. size += 2 + pb::CodedOutputStream.ComputeMessageSize(OptionalNestedMessage);
  825. }
  826. if (lazyNestedMessage_ != null) {
  827. size += 2 + pb::CodedOutputStream.ComputeMessageSize(LazyNestedMessage);
  828. }
  829. if (HasOptionalNestedEnum) {
  830. size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) OptionalNestedEnum);
  831. }
  832. if (SingularInt32 != 0) {
  833. size += 2 + pb::CodedOutputStream.ComputeInt32Size(SingularInt32);
  834. }
  835. if (SingularInt64 != 0L) {
  836. size += 2 + pb::CodedOutputStream.ComputeInt64Size(SingularInt64);
  837. }
  838. if (_unknownFields != null) {
  839. size += _unknownFields.CalculateSize();
  840. }
  841. return size;
  842. }
  843. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  844. public void MergeFrom(TestProto3Optional other) {
  845. if (other == null) {
  846. return;
  847. }
  848. if (other.HasOptionalInt32) {
  849. OptionalInt32 = other.OptionalInt32;
  850. }
  851. if (other.HasOptionalInt64) {
  852. OptionalInt64 = other.OptionalInt64;
  853. }
  854. if (other.HasOptionalUint32) {
  855. OptionalUint32 = other.OptionalUint32;
  856. }
  857. if (other.HasOptionalUint64) {
  858. OptionalUint64 = other.OptionalUint64;
  859. }
  860. if (other.HasOptionalSint32) {
  861. OptionalSint32 = other.OptionalSint32;
  862. }
  863. if (other.HasOptionalSint64) {
  864. OptionalSint64 = other.OptionalSint64;
  865. }
  866. if (other.HasOptionalFixed32) {
  867. OptionalFixed32 = other.OptionalFixed32;
  868. }
  869. if (other.HasOptionalFixed64) {
  870. OptionalFixed64 = other.OptionalFixed64;
  871. }
  872. if (other.HasOptionalSfixed32) {
  873. OptionalSfixed32 = other.OptionalSfixed32;
  874. }
  875. if (other.HasOptionalSfixed64) {
  876. OptionalSfixed64 = other.OptionalSfixed64;
  877. }
  878. if (other.HasOptionalFloat) {
  879. OptionalFloat = other.OptionalFloat;
  880. }
  881. if (other.HasOptionalDouble) {
  882. OptionalDouble = other.OptionalDouble;
  883. }
  884. if (other.HasOptionalBool) {
  885. OptionalBool = other.OptionalBool;
  886. }
  887. if (other.HasOptionalString) {
  888. OptionalString = other.OptionalString;
  889. }
  890. if (other.HasOptionalBytes) {
  891. OptionalBytes = other.OptionalBytes;
  892. }
  893. if (other.HasOptionalCord) {
  894. OptionalCord = other.OptionalCord;
  895. }
  896. if (other.optionalNestedMessage_ != null) {
  897. if (optionalNestedMessage_ == null) {
  898. OptionalNestedMessage = new global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage();
  899. }
  900. OptionalNestedMessage.MergeFrom(other.OptionalNestedMessage);
  901. }
  902. if (other.lazyNestedMessage_ != null) {
  903. if (lazyNestedMessage_ == null) {
  904. LazyNestedMessage = new global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage();
  905. }
  906. LazyNestedMessage.MergeFrom(other.LazyNestedMessage);
  907. }
  908. if (other.HasOptionalNestedEnum) {
  909. OptionalNestedEnum = other.OptionalNestedEnum;
  910. }
  911. if (other.SingularInt32 != 0) {
  912. SingularInt32 = other.SingularInt32;
  913. }
  914. if (other.SingularInt64 != 0L) {
  915. SingularInt64 = other.SingularInt64;
  916. }
  917. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  918. }
  919. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  920. public void MergeFrom(pb::CodedInputStream input) {
  921. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  922. input.ReadRawMessage(this);
  923. #else
  924. uint tag;
  925. while ((tag = input.ReadTag()) != 0) {
  926. switch(tag) {
  927. default:
  928. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  929. break;
  930. case 8: {
  931. OptionalInt32 = input.ReadInt32();
  932. break;
  933. }
  934. case 16: {
  935. OptionalInt64 = input.ReadInt64();
  936. break;
  937. }
  938. case 24: {
  939. OptionalUint32 = input.ReadUInt32();
  940. break;
  941. }
  942. case 32: {
  943. OptionalUint64 = input.ReadUInt64();
  944. break;
  945. }
  946. case 40: {
  947. OptionalSint32 = input.ReadSInt32();
  948. break;
  949. }
  950. case 48: {
  951. OptionalSint64 = input.ReadSInt64();
  952. break;
  953. }
  954. case 61: {
  955. OptionalFixed32 = input.ReadFixed32();
  956. break;
  957. }
  958. case 65: {
  959. OptionalFixed64 = input.ReadFixed64();
  960. break;
  961. }
  962. case 77: {
  963. OptionalSfixed32 = input.ReadSFixed32();
  964. break;
  965. }
  966. case 81: {
  967. OptionalSfixed64 = input.ReadSFixed64();
  968. break;
  969. }
  970. case 93: {
  971. OptionalFloat = input.ReadFloat();
  972. break;
  973. }
  974. case 97: {
  975. OptionalDouble = input.ReadDouble();
  976. break;
  977. }
  978. case 104: {
  979. OptionalBool = input.ReadBool();
  980. break;
  981. }
  982. case 114: {
  983. OptionalString = input.ReadString();
  984. break;
  985. }
  986. case 122: {
  987. OptionalBytes = input.ReadBytes();
  988. break;
  989. }
  990. case 130: {
  991. OptionalCord = input.ReadString();
  992. break;
  993. }
  994. case 146: {
  995. if (optionalNestedMessage_ == null) {
  996. OptionalNestedMessage = new global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage();
  997. }
  998. input.ReadMessage(OptionalNestedMessage);
  999. break;
  1000. }
  1001. case 154: {
  1002. if (lazyNestedMessage_ == null) {
  1003. LazyNestedMessage = new global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage();
  1004. }
  1005. input.ReadMessage(LazyNestedMessage);
  1006. break;
  1007. }
  1008. case 168: {
  1009. OptionalNestedEnum = (global::ProtobufUnittest.TestProto3Optional.Types.NestedEnum) input.ReadEnum();
  1010. break;
  1011. }
  1012. case 176: {
  1013. SingularInt32 = input.ReadInt32();
  1014. break;
  1015. }
  1016. case 184: {
  1017. SingularInt64 = input.ReadInt64();
  1018. break;
  1019. }
  1020. }
  1021. }
  1022. #endif
  1023. }
  1024. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1025. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1026. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  1027. uint tag;
  1028. while ((tag = input.ReadTag()) != 0) {
  1029. switch(tag) {
  1030. default:
  1031. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  1032. break;
  1033. case 8: {
  1034. OptionalInt32 = input.ReadInt32();
  1035. break;
  1036. }
  1037. case 16: {
  1038. OptionalInt64 = input.ReadInt64();
  1039. break;
  1040. }
  1041. case 24: {
  1042. OptionalUint32 = input.ReadUInt32();
  1043. break;
  1044. }
  1045. case 32: {
  1046. OptionalUint64 = input.ReadUInt64();
  1047. break;
  1048. }
  1049. case 40: {
  1050. OptionalSint32 = input.ReadSInt32();
  1051. break;
  1052. }
  1053. case 48: {
  1054. OptionalSint64 = input.ReadSInt64();
  1055. break;
  1056. }
  1057. case 61: {
  1058. OptionalFixed32 = input.ReadFixed32();
  1059. break;
  1060. }
  1061. case 65: {
  1062. OptionalFixed64 = input.ReadFixed64();
  1063. break;
  1064. }
  1065. case 77: {
  1066. OptionalSfixed32 = input.ReadSFixed32();
  1067. break;
  1068. }
  1069. case 81: {
  1070. OptionalSfixed64 = input.ReadSFixed64();
  1071. break;
  1072. }
  1073. case 93: {
  1074. OptionalFloat = input.ReadFloat();
  1075. break;
  1076. }
  1077. case 97: {
  1078. OptionalDouble = input.ReadDouble();
  1079. break;
  1080. }
  1081. case 104: {
  1082. OptionalBool = input.ReadBool();
  1083. break;
  1084. }
  1085. case 114: {
  1086. OptionalString = input.ReadString();
  1087. break;
  1088. }
  1089. case 122: {
  1090. OptionalBytes = input.ReadBytes();
  1091. break;
  1092. }
  1093. case 130: {
  1094. OptionalCord = input.ReadString();
  1095. break;
  1096. }
  1097. case 146: {
  1098. if (optionalNestedMessage_ == null) {
  1099. OptionalNestedMessage = new global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage();
  1100. }
  1101. input.ReadMessage(OptionalNestedMessage);
  1102. break;
  1103. }
  1104. case 154: {
  1105. if (lazyNestedMessage_ == null) {
  1106. LazyNestedMessage = new global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage();
  1107. }
  1108. input.ReadMessage(LazyNestedMessage);
  1109. break;
  1110. }
  1111. case 168: {
  1112. OptionalNestedEnum = (global::ProtobufUnittest.TestProto3Optional.Types.NestedEnum) input.ReadEnum();
  1113. break;
  1114. }
  1115. case 176: {
  1116. SingularInt32 = input.ReadInt32();
  1117. break;
  1118. }
  1119. case 184: {
  1120. SingularInt64 = input.ReadInt64();
  1121. break;
  1122. }
  1123. }
  1124. }
  1125. }
  1126. #endif
  1127. #region Nested types
  1128. /// <summary>Container for nested types declared in the TestProto3Optional message type.</summary>
  1129. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1130. public static partial class Types {
  1131. public enum NestedEnum {
  1132. [pbr::OriginalName("UNSPECIFIED")] Unspecified = 0,
  1133. [pbr::OriginalName("FOO")] Foo = 1,
  1134. [pbr::OriginalName("BAR")] Bar = 2,
  1135. [pbr::OriginalName("BAZ")] Baz = 3,
  1136. /// <summary>
  1137. /// Intentionally negative.
  1138. /// </summary>
  1139. [pbr::OriginalName("NEG")] Neg = -1,
  1140. }
  1141. public sealed partial class NestedMessage : pb::IMessage<NestedMessage>
  1142. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1143. , pb::IBufferMessage
  1144. #endif
  1145. {
  1146. private static readonly pb::MessageParser<NestedMessage> _parser = new pb::MessageParser<NestedMessage>(() => new NestedMessage());
  1147. private pb::UnknownFieldSet _unknownFields;
  1148. private int _hasBits0;
  1149. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1150. public static pb::MessageParser<NestedMessage> Parser { get { return _parser; } }
  1151. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1152. public static pbr::MessageDescriptor Descriptor {
  1153. get { return global::ProtobufUnittest.TestProto3Optional.Descriptor.NestedTypes[0]; }
  1154. }
  1155. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1156. pbr::MessageDescriptor pb::IMessage.Descriptor {
  1157. get { return Descriptor; }
  1158. }
  1159. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1160. public NestedMessage() {
  1161. OnConstruction();
  1162. }
  1163. partial void OnConstruction();
  1164. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1165. public NestedMessage(NestedMessage other) : this() {
  1166. _hasBits0 = other._hasBits0;
  1167. bb_ = other.bb_;
  1168. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  1169. }
  1170. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1171. public NestedMessage Clone() {
  1172. return new NestedMessage(this);
  1173. }
  1174. /// <summary>Field number for the "bb" field.</summary>
  1175. public const int BbFieldNumber = 1;
  1176. private int bb_;
  1177. /// <summary>
  1178. /// The field name "b" fails to compile in proto1 because it conflicts with
  1179. /// a local variable named "b" in one of the generated methods. Doh.
  1180. /// This file needs to compile in proto1 to test backwards-compatibility.
  1181. /// </summary>
  1182. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1183. public int Bb {
  1184. get { if ((_hasBits0 & 1) != 0) { return bb_; } else { return 0; } }
  1185. set {
  1186. _hasBits0 |= 1;
  1187. bb_ = value;
  1188. }
  1189. }
  1190. /// <summary>Gets whether the "bb" field is set</summary>
  1191. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1192. public bool HasBb {
  1193. get { return (_hasBits0 & 1) != 0; }
  1194. }
  1195. /// <summary>Clears the value of the "bb" field</summary>
  1196. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1197. public void ClearBb() {
  1198. _hasBits0 &= ~1;
  1199. }
  1200. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1201. public override bool Equals(object other) {
  1202. return Equals(other as NestedMessage);
  1203. }
  1204. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1205. public bool Equals(NestedMessage other) {
  1206. if (ReferenceEquals(other, null)) {
  1207. return false;
  1208. }
  1209. if (ReferenceEquals(other, this)) {
  1210. return true;
  1211. }
  1212. if (Bb != other.Bb) return false;
  1213. return Equals(_unknownFields, other._unknownFields);
  1214. }
  1215. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1216. public override int GetHashCode() {
  1217. int hash = 1;
  1218. if (HasBb) hash ^= Bb.GetHashCode();
  1219. if (_unknownFields != null) {
  1220. hash ^= _unknownFields.GetHashCode();
  1221. }
  1222. return hash;
  1223. }
  1224. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1225. public override string ToString() {
  1226. return pb::JsonFormatter.ToDiagnosticString(this);
  1227. }
  1228. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1229. public void WriteTo(pb::CodedOutputStream output) {
  1230. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1231. output.WriteRawMessage(this);
  1232. #else
  1233. if (HasBb) {
  1234. output.WriteRawTag(8);
  1235. output.WriteInt32(Bb);
  1236. }
  1237. if (_unknownFields != null) {
  1238. _unknownFields.WriteTo(output);
  1239. }
  1240. #endif
  1241. }
  1242. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1243. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1244. void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
  1245. if (HasBb) {
  1246. output.WriteRawTag(8);
  1247. output.WriteInt32(Bb);
  1248. }
  1249. if (_unknownFields != null) {
  1250. _unknownFields.WriteTo(ref output);
  1251. }
  1252. }
  1253. #endif
  1254. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1255. public int CalculateSize() {
  1256. int size = 0;
  1257. if (HasBb) {
  1258. size += 1 + pb::CodedOutputStream.ComputeInt32Size(Bb);
  1259. }
  1260. if (_unknownFields != null) {
  1261. size += _unknownFields.CalculateSize();
  1262. }
  1263. return size;
  1264. }
  1265. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1266. public void MergeFrom(NestedMessage other) {
  1267. if (other == null) {
  1268. return;
  1269. }
  1270. if (other.HasBb) {
  1271. Bb = other.Bb;
  1272. }
  1273. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  1274. }
  1275. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1276. public void MergeFrom(pb::CodedInputStream input) {
  1277. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1278. input.ReadRawMessage(this);
  1279. #else
  1280. uint tag;
  1281. while ((tag = input.ReadTag()) != 0) {
  1282. switch(tag) {
  1283. default:
  1284. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  1285. break;
  1286. case 8: {
  1287. Bb = input.ReadInt32();
  1288. break;
  1289. }
  1290. }
  1291. }
  1292. #endif
  1293. }
  1294. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1295. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1296. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  1297. uint tag;
  1298. while ((tag = input.ReadTag()) != 0) {
  1299. switch(tag) {
  1300. default:
  1301. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  1302. break;
  1303. case 8: {
  1304. Bb = input.ReadInt32();
  1305. break;
  1306. }
  1307. }
  1308. }
  1309. }
  1310. #endif
  1311. }
  1312. }
  1313. #endregion
  1314. }
  1315. #endregion
  1316. }
  1317. #endregion Designer generated code