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 8 using pb = global::Google.Protobuf; 9 using pbc = global::Google.Protobuf.Collections; 10 using pbr = global::Google.Protobuf.Reflection; 11 using scg = global::System.Collections.Generic; 12 namespace ProtobufUnittest { 13 14 /// <summary>Holder for reflection information generated from google/protobuf/unittest_proto3_optional.proto</summary> 15 public static partial class UnittestProto3OptionalReflection { 16 17 #region Descriptor 18 /// <summary>File descriptor for google/protobuf/unittest_proto3_optional.proto</summary> 19 public static pbr::FileDescriptor Descriptor { 20 get { return descriptor; } 21 } 22 private static pbr::FileDescriptor descriptor; 23 UnittestProto3OptionalReflection()24 static UnittestProto3OptionalReflection() { 25 byte[] descriptorData = global::System.Convert.FromBase64String( 26 string.Concat( 27 "Ci5nb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfcHJvdG8zX29wdGlvbmFsLnBy", 28 "b3RvEhFwcm90b2J1Zl91bml0dGVzdCKxCgoSVGVzdFByb3RvM09wdGlvbmFs", 29 "EhsKDm9wdGlvbmFsX2ludDMyGAEgASgFSACIAQESGwoOb3B0aW9uYWxfaW50", 30 "NjQYAiABKANIAYgBARIcCg9vcHRpb25hbF91aW50MzIYAyABKA1IAogBARIc", 31 "Cg9vcHRpb25hbF91aW50NjQYBCABKARIA4gBARIcCg9vcHRpb25hbF9zaW50", 32 "MzIYBSABKBFIBIgBARIcCg9vcHRpb25hbF9zaW50NjQYBiABKBJIBYgBARId", 33 "ChBvcHRpb25hbF9maXhlZDMyGAcgASgHSAaIAQESHQoQb3B0aW9uYWxfZml4", 34 "ZWQ2NBgIIAEoBkgHiAEBEh4KEW9wdGlvbmFsX3NmaXhlZDMyGAkgASgPSAiI", 35 "AQESHgoRb3B0aW9uYWxfc2ZpeGVkNjQYCiABKBBICYgBARIbCg5vcHRpb25h", 36 "bF9mbG9hdBgLIAEoAkgKiAEBEhwKD29wdGlvbmFsX2RvdWJsZRgMIAEoAUgL", 37 "iAEBEhoKDW9wdGlvbmFsX2Jvb2wYDSABKAhIDIgBARIcCg9vcHRpb25hbF9z", 38 "dHJpbmcYDiABKAlIDYgBARIbCg5vcHRpb25hbF9ieXRlcxgPIAEoDEgOiAEB", 39 "Eh4KDW9wdGlvbmFsX2NvcmQYECABKAlCAggBSA+IAQESWQoXb3B0aW9uYWxf", 40 "bmVzdGVkX21lc3NhZ2UYEiABKAsyMy5wcm90b2J1Zl91bml0dGVzdC5UZXN0", 41 "UHJvdG8zT3B0aW9uYWwuTmVzdGVkTWVzc2FnZUgQiAEBElkKE2xhenlfbmVz", 42 "dGVkX21lc3NhZ2UYEyABKAsyMy5wcm90b2J1Zl91bml0dGVzdC5UZXN0UHJv", 43 "dG8zT3B0aW9uYWwuTmVzdGVkTWVzc2FnZUICKAFIEYgBARJTChRvcHRpb25h", 44 "bF9uZXN0ZWRfZW51bRgVIAEoDjIwLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RQ", 45 "cm90bzNPcHRpb25hbC5OZXN0ZWRFbnVtSBKIAQESFgoOc2luZ3VsYXJfaW50", 46 "MzIYFiABKAUSFgoOc2luZ3VsYXJfaW50NjQYFyABKAMaJwoNTmVzdGVkTWVz", 47 "c2FnZRIPCgJiYhgBIAEoBUgAiAEBQgUKA19iYiJKCgpOZXN0ZWRFbnVtEg8K", 48 "C1VOU1BFQ0lGSUVEEAASBwoDRk9PEAESBwoDQkFSEAISBwoDQkFaEAMSEAoD", 49 "TkVHEP///////////wFCEQoPX29wdGlvbmFsX2ludDMyQhEKD19vcHRpb25h", 50 "bF9pbnQ2NEISChBfb3B0aW9uYWxfdWludDMyQhIKEF9vcHRpb25hbF91aW50", 51 "NjRCEgoQX29wdGlvbmFsX3NpbnQzMkISChBfb3B0aW9uYWxfc2ludDY0QhMK", 52 "EV9vcHRpb25hbF9maXhlZDMyQhMKEV9vcHRpb25hbF9maXhlZDY0QhQKEl9v", 53 "cHRpb25hbF9zZml4ZWQzMkIUChJfb3B0aW9uYWxfc2ZpeGVkNjRCEQoPX29w", 54 "dGlvbmFsX2Zsb2F0QhIKEF9vcHRpb25hbF9kb3VibGVCEAoOX29wdGlvbmFs", 55 "X2Jvb2xCEgoQX29wdGlvbmFsX3N0cmluZ0IRCg9fb3B0aW9uYWxfYnl0ZXNC", 56 "EAoOX29wdGlvbmFsX2NvcmRCGgoYX29wdGlvbmFsX25lc3RlZF9tZXNzYWdl", 57 "QhYKFF9sYXp5X25lc3RlZF9tZXNzYWdlQhcKFV9vcHRpb25hbF9uZXN0ZWRf", 58 "ZW51bSKJAgoZVGVzdFByb3RvM09wdGlvbmFsTWVzc2FnZRJSCg5uZXN0ZWRf", 59 "bWVzc2FnZRgBIAEoCzI6LnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RQcm90bzNP", 60 "cHRpb25hbE1lc3NhZ2UuTmVzdGVkTWVzc2FnZRJgChdvcHRpb25hbF9uZXN0", 61 "ZWRfbWVzc2FnZRgCIAEoCzI6LnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RQcm90", 62 "bzNPcHRpb25hbE1lc3NhZ2UuTmVzdGVkTWVzc2FnZUgAiAEBGhoKDU5lc3Rl", 63 "ZE1lc3NhZ2USCQoBcxgBIAEoCUIaChhfb3B0aW9uYWxfbmVzdGVkX21lc3Nh", 64 "Z2VCJQohY29tLmdvb2dsZS5wcm90b2J1Zi50ZXN0aW5nLnByb3RvUAFiBnBy", 65 "b3RvMw==")); 66 descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, 67 new pbr::FileDescriptor[] { }, 68 new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { 69 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)}), 70 new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufUnittest.TestProto3OptionalMessage), global::ProtobufUnittest.TestProto3OptionalMessage.Parser, new[]{ "NestedMessage", "OptionalNestedMessage" }, new[]{ "OptionalNestedMessage" }, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufUnittest.TestProto3OptionalMessage.Types.NestedMessage), global::ProtobufUnittest.TestProto3OptionalMessage.Types.NestedMessage.Parser, new[]{ "S" }, null, null, null, null)}) 71 })); 72 } 73 #endregion 74 75 } 76 #region Messages 77 public sealed partial class TestProto3Optional : pb::IMessage<TestProto3Optional> 78 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 79 , pb::IBufferMessage 80 #endif 81 { 82 private static readonly pb::MessageParser<TestProto3Optional> _parser = new pb::MessageParser<TestProto3Optional>(() => new TestProto3Optional()); 83 private pb::UnknownFieldSet _unknownFields; 84 private int _hasBits0; 85 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 86 public static pb::MessageParser<TestProto3Optional> Parser { get { return _parser; } } 87 88 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 89 public static pbr::MessageDescriptor Descriptor { 90 get { return global::ProtobufUnittest.UnittestProto3OptionalReflection.Descriptor.MessageTypes[0]; } 91 } 92 93 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 94 pbr::MessageDescriptor pb::IMessage.Descriptor { 95 get { return Descriptor; } 96 } 97 98 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] TestProto3Optional()99 public TestProto3Optional() { 100 OnConstruction(); 101 } 102 OnConstruction()103 partial void OnConstruction(); 104 105 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] TestProto3Optional(TestProto3Optional other)106 public TestProto3Optional(TestProto3Optional other) : this() { 107 _hasBits0 = other._hasBits0; 108 optionalInt32_ = other.optionalInt32_; 109 optionalInt64_ = other.optionalInt64_; 110 optionalUint32_ = other.optionalUint32_; 111 optionalUint64_ = other.optionalUint64_; 112 optionalSint32_ = other.optionalSint32_; 113 optionalSint64_ = other.optionalSint64_; 114 optionalFixed32_ = other.optionalFixed32_; 115 optionalFixed64_ = other.optionalFixed64_; 116 optionalSfixed32_ = other.optionalSfixed32_; 117 optionalSfixed64_ = other.optionalSfixed64_; 118 optionalFloat_ = other.optionalFloat_; 119 optionalDouble_ = other.optionalDouble_; 120 optionalBool_ = other.optionalBool_; 121 optionalString_ = other.optionalString_; 122 optionalBytes_ = other.optionalBytes_; 123 optionalCord_ = other.optionalCord_; 124 optionalNestedMessage_ = other.optionalNestedMessage_ != null ? other.optionalNestedMessage_.Clone() : null; 125 lazyNestedMessage_ = other.lazyNestedMessage_ != null ? other.lazyNestedMessage_.Clone() : null; 126 optionalNestedEnum_ = other.optionalNestedEnum_; 127 singularInt32_ = other.singularInt32_; 128 singularInt64_ = other.singularInt64_; 129 _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); 130 } 131 132 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] Clone()133 public TestProto3Optional Clone() { 134 return new TestProto3Optional(this); 135 } 136 137 /// <summary>Field number for the "optional_int32" field.</summary> 138 public const int OptionalInt32FieldNumber = 1; 139 private int optionalInt32_; 140 /// <summary> 141 /// Singular 142 /// </summary> 143 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 144 public int OptionalInt32 { 145 get { if ((_hasBits0 & 1) != 0) { return optionalInt32_; } else { return 0; } } 146 set { 147 _hasBits0 |= 1; 148 optionalInt32_ = value; 149 } 150 } 151 /// <summary>Gets whether the "optional_int32" field is set</summary> 152 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 153 public bool HasOptionalInt32 { 154 get { return (_hasBits0 & 1) != 0; } 155 } 156 /// <summary>Clears the value of the "optional_int32" field</summary> 157 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] ClearOptionalInt32()158 public void ClearOptionalInt32() { 159 _hasBits0 &= ~1; 160 } 161 162 /// <summary>Field number for the "optional_int64" field.</summary> 163 public const int OptionalInt64FieldNumber = 2; 164 private long optionalInt64_; 165 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 166 public long OptionalInt64 { 167 get { if ((_hasBits0 & 2) != 0) { return optionalInt64_; } else { return 0L; } } 168 set { 169 _hasBits0 |= 2; 170 optionalInt64_ = value; 171 } 172 } 173 /// <summary>Gets whether the "optional_int64" field is set</summary> 174 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 175 public bool HasOptionalInt64 { 176 get { return (_hasBits0 & 2) != 0; } 177 } 178 /// <summary>Clears the value of the "optional_int64" field</summary> 179 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] ClearOptionalInt64()180 public void ClearOptionalInt64() { 181 _hasBits0 &= ~2; 182 } 183 184 /// <summary>Field number for the "optional_uint32" field.</summary> 185 public const int OptionalUint32FieldNumber = 3; 186 private uint optionalUint32_; 187 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 188 public uint OptionalUint32 { 189 get { if ((_hasBits0 & 4) != 0) { return optionalUint32_; } else { return 0; } } 190 set { 191 _hasBits0 |= 4; 192 optionalUint32_ = value; 193 } 194 } 195 /// <summary>Gets whether the "optional_uint32" field is set</summary> 196 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 197 public bool HasOptionalUint32 { 198 get { return (_hasBits0 & 4) != 0; } 199 } 200 /// <summary>Clears the value of the "optional_uint32" field</summary> 201 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] ClearOptionalUint32()202 public void ClearOptionalUint32() { 203 _hasBits0 &= ~4; 204 } 205 206 /// <summary>Field number for the "optional_uint64" field.</summary> 207 public const int OptionalUint64FieldNumber = 4; 208 private ulong optionalUint64_; 209 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 210 public ulong OptionalUint64 { 211 get { if ((_hasBits0 & 8) != 0) { return optionalUint64_; } else { return 0UL; } } 212 set { 213 _hasBits0 |= 8; 214 optionalUint64_ = value; 215 } 216 } 217 /// <summary>Gets whether the "optional_uint64" field is set</summary> 218 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 219 public bool HasOptionalUint64 { 220 get { return (_hasBits0 & 8) != 0; } 221 } 222 /// <summary>Clears the value of the "optional_uint64" field</summary> 223 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] ClearOptionalUint64()224 public void ClearOptionalUint64() { 225 _hasBits0 &= ~8; 226 } 227 228 /// <summary>Field number for the "optional_sint32" field.</summary> 229 public const int OptionalSint32FieldNumber = 5; 230 private int optionalSint32_; 231 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 232 public int OptionalSint32 { 233 get { if ((_hasBits0 & 16) != 0) { return optionalSint32_; } else { return 0; } } 234 set { 235 _hasBits0 |= 16; 236 optionalSint32_ = value; 237 } 238 } 239 /// <summary>Gets whether the "optional_sint32" field is set</summary> 240 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 241 public bool HasOptionalSint32 { 242 get { return (_hasBits0 & 16) != 0; } 243 } 244 /// <summary>Clears the value of the "optional_sint32" field</summary> 245 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] ClearOptionalSint32()246 public void ClearOptionalSint32() { 247 _hasBits0 &= ~16; 248 } 249 250 /// <summary>Field number for the "optional_sint64" field.</summary> 251 public const int OptionalSint64FieldNumber = 6; 252 private long optionalSint64_; 253 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 254 public long OptionalSint64 { 255 get { if ((_hasBits0 & 32) != 0) { return optionalSint64_; } else { return 0L; } } 256 set { 257 _hasBits0 |= 32; 258 optionalSint64_ = value; 259 } 260 } 261 /// <summary>Gets whether the "optional_sint64" field is set</summary> 262 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 263 public bool HasOptionalSint64 { 264 get { return (_hasBits0 & 32) != 0; } 265 } 266 /// <summary>Clears the value of the "optional_sint64" field</summary> 267 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] ClearOptionalSint64()268 public void ClearOptionalSint64() { 269 _hasBits0 &= ~32; 270 } 271 272 /// <summary>Field number for the "optional_fixed32" field.</summary> 273 public const int OptionalFixed32FieldNumber = 7; 274 private uint optionalFixed32_; 275 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 276 public uint OptionalFixed32 { 277 get { if ((_hasBits0 & 64) != 0) { return optionalFixed32_; } else { return 0; } } 278 set { 279 _hasBits0 |= 64; 280 optionalFixed32_ = value; 281 } 282 } 283 /// <summary>Gets whether the "optional_fixed32" field is set</summary> 284 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 285 public bool HasOptionalFixed32 { 286 get { return (_hasBits0 & 64) != 0; } 287 } 288 /// <summary>Clears the value of the "optional_fixed32" field</summary> 289 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] ClearOptionalFixed32()290 public void ClearOptionalFixed32() { 291 _hasBits0 &= ~64; 292 } 293 294 /// <summary>Field number for the "optional_fixed64" field.</summary> 295 public const int OptionalFixed64FieldNumber = 8; 296 private ulong optionalFixed64_; 297 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 298 public ulong OptionalFixed64 { 299 get { if ((_hasBits0 & 128) != 0) { return optionalFixed64_; } else { return 0UL; } } 300 set { 301 _hasBits0 |= 128; 302 optionalFixed64_ = value; 303 } 304 } 305 /// <summary>Gets whether the "optional_fixed64" field is set</summary> 306 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 307 public bool HasOptionalFixed64 { 308 get { return (_hasBits0 & 128) != 0; } 309 } 310 /// <summary>Clears the value of the "optional_fixed64" field</summary> 311 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] ClearOptionalFixed64()312 public void ClearOptionalFixed64() { 313 _hasBits0 &= ~128; 314 } 315 316 /// <summary>Field number for the "optional_sfixed32" field.</summary> 317 public const int OptionalSfixed32FieldNumber = 9; 318 private int optionalSfixed32_; 319 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 320 public int OptionalSfixed32 { 321 get { if ((_hasBits0 & 256) != 0) { return optionalSfixed32_; } else { return 0; } } 322 set { 323 _hasBits0 |= 256; 324 optionalSfixed32_ = value; 325 } 326 } 327 /// <summary>Gets whether the "optional_sfixed32" field is set</summary> 328 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 329 public bool HasOptionalSfixed32 { 330 get { return (_hasBits0 & 256) != 0; } 331 } 332 /// <summary>Clears the value of the "optional_sfixed32" field</summary> 333 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] ClearOptionalSfixed32()334 public void ClearOptionalSfixed32() { 335 _hasBits0 &= ~256; 336 } 337 338 /// <summary>Field number for the "optional_sfixed64" field.</summary> 339 public const int OptionalSfixed64FieldNumber = 10; 340 private long optionalSfixed64_; 341 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 342 public long OptionalSfixed64 { 343 get { if ((_hasBits0 & 512) != 0) { return optionalSfixed64_; } else { return 0L; } } 344 set { 345 _hasBits0 |= 512; 346 optionalSfixed64_ = value; 347 } 348 } 349 /// <summary>Gets whether the "optional_sfixed64" field is set</summary> 350 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 351 public bool HasOptionalSfixed64 { 352 get { return (_hasBits0 & 512) != 0; } 353 } 354 /// <summary>Clears the value of the "optional_sfixed64" field</summary> 355 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] ClearOptionalSfixed64()356 public void ClearOptionalSfixed64() { 357 _hasBits0 &= ~512; 358 } 359 360 /// <summary>Field number for the "optional_float" field.</summary> 361 public const int OptionalFloatFieldNumber = 11; 362 private float optionalFloat_; 363 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 364 public float OptionalFloat { 365 get { if ((_hasBits0 & 1024) != 0) { return optionalFloat_; } else { return 0F; } } 366 set { 367 _hasBits0 |= 1024; 368 optionalFloat_ = value; 369 } 370 } 371 /// <summary>Gets whether the "optional_float" field is set</summary> 372 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 373 public bool HasOptionalFloat { 374 get { return (_hasBits0 & 1024) != 0; } 375 } 376 /// <summary>Clears the value of the "optional_float" field</summary> 377 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] ClearOptionalFloat()378 public void ClearOptionalFloat() { 379 _hasBits0 &= ~1024; 380 } 381 382 /// <summary>Field number for the "optional_double" field.</summary> 383 public const int OptionalDoubleFieldNumber = 12; 384 private double optionalDouble_; 385 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 386 public double OptionalDouble { 387 get { if ((_hasBits0 & 2048) != 0) { return optionalDouble_; } else { return 0D; } } 388 set { 389 _hasBits0 |= 2048; 390 optionalDouble_ = value; 391 } 392 } 393 /// <summary>Gets whether the "optional_double" field is set</summary> 394 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 395 public bool HasOptionalDouble { 396 get { return (_hasBits0 & 2048) != 0; } 397 } 398 /// <summary>Clears the value of the "optional_double" field</summary> 399 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] ClearOptionalDouble()400 public void ClearOptionalDouble() { 401 _hasBits0 &= ~2048; 402 } 403 404 /// <summary>Field number for the "optional_bool" field.</summary> 405 public const int OptionalBoolFieldNumber = 13; 406 private bool optionalBool_; 407 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 408 public bool OptionalBool { 409 get { if ((_hasBits0 & 4096) != 0) { return optionalBool_; } else { return false; } } 410 set { 411 _hasBits0 |= 4096; 412 optionalBool_ = value; 413 } 414 } 415 /// <summary>Gets whether the "optional_bool" field is set</summary> 416 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 417 public bool HasOptionalBool { 418 get { return (_hasBits0 & 4096) != 0; } 419 } 420 /// <summary>Clears the value of the "optional_bool" field</summary> 421 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] ClearOptionalBool()422 public void ClearOptionalBool() { 423 _hasBits0 &= ~4096; 424 } 425 426 /// <summary>Field number for the "optional_string" field.</summary> 427 public const int OptionalStringFieldNumber = 14; 428 private string optionalString_; 429 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 430 public string OptionalString { 431 get { return optionalString_ ?? ""; } 432 set { 433 optionalString_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 434 } 435 } 436 /// <summary>Gets whether the "optional_string" field is set</summary> 437 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 438 public bool HasOptionalString { 439 get { return optionalString_ != null; } 440 } 441 /// <summary>Clears the value of the "optional_string" field</summary> 442 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] ClearOptionalString()443 public void ClearOptionalString() { 444 optionalString_ = null; 445 } 446 447 /// <summary>Field number for the "optional_bytes" field.</summary> 448 public const int OptionalBytesFieldNumber = 15; 449 private pb::ByteString optionalBytes_; 450 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 451 public pb::ByteString OptionalBytes { 452 get { return optionalBytes_ ?? pb::ByteString.Empty; } 453 set { 454 optionalBytes_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 455 } 456 } 457 /// <summary>Gets whether the "optional_bytes" field is set</summary> 458 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 459 public bool HasOptionalBytes { 460 get { return optionalBytes_ != null; } 461 } 462 /// <summary>Clears the value of the "optional_bytes" field</summary> 463 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] ClearOptionalBytes()464 public void ClearOptionalBytes() { 465 optionalBytes_ = null; 466 } 467 468 /// <summary>Field number for the "optional_cord" field.</summary> 469 public const int OptionalCordFieldNumber = 16; 470 private string optionalCord_; 471 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 472 public string OptionalCord { 473 get { return optionalCord_ ?? ""; } 474 set { 475 optionalCord_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 476 } 477 } 478 /// <summary>Gets whether the "optional_cord" field is set</summary> 479 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 480 public bool HasOptionalCord { 481 get { return optionalCord_ != null; } 482 } 483 /// <summary>Clears the value of the "optional_cord" field</summary> 484 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] ClearOptionalCord()485 public void ClearOptionalCord() { 486 optionalCord_ = null; 487 } 488 489 /// <summary>Field number for the "optional_nested_message" field.</summary> 490 public const int OptionalNestedMessageFieldNumber = 18; 491 private global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage optionalNestedMessage_; 492 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 493 public global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage OptionalNestedMessage { 494 get { return optionalNestedMessage_; } 495 set { 496 optionalNestedMessage_ = value; 497 } 498 } 499 500 /// <summary>Field number for the "lazy_nested_message" field.</summary> 501 public const int LazyNestedMessageFieldNumber = 19; 502 private global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage lazyNestedMessage_; 503 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 504 public global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage LazyNestedMessage { 505 get { return lazyNestedMessage_; } 506 set { 507 lazyNestedMessage_ = value; 508 } 509 } 510 511 /// <summary>Field number for the "optional_nested_enum" field.</summary> 512 public const int OptionalNestedEnumFieldNumber = 21; 513 private global::ProtobufUnittest.TestProto3Optional.Types.NestedEnum optionalNestedEnum_; 514 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 515 public global::ProtobufUnittest.TestProto3Optional.Types.NestedEnum OptionalNestedEnum { 516 get { if ((_hasBits0 & 8192) != 0) { return optionalNestedEnum_; } else { return global::ProtobufUnittest.TestProto3Optional.Types.NestedEnum.Unspecified; } } 517 set { 518 _hasBits0 |= 8192; 519 optionalNestedEnum_ = value; 520 } 521 } 522 /// <summary>Gets whether the "optional_nested_enum" field is set</summary> 523 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 524 public bool HasOptionalNestedEnum { 525 get { return (_hasBits0 & 8192) != 0; } 526 } 527 /// <summary>Clears the value of the "optional_nested_enum" field</summary> 528 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] ClearOptionalNestedEnum()529 public void ClearOptionalNestedEnum() { 530 _hasBits0 &= ~8192; 531 } 532 533 /// <summary>Field number for the "singular_int32" field.</summary> 534 public const int SingularInt32FieldNumber = 22; 535 private int singularInt32_; 536 /// <summary> 537 /// Add some non-optional fields to verify we can mix them. 538 /// </summary> 539 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 540 public int SingularInt32 { 541 get { return singularInt32_; } 542 set { 543 singularInt32_ = value; 544 } 545 } 546 547 /// <summary>Field number for the "singular_int64" field.</summary> 548 public const int SingularInt64FieldNumber = 23; 549 private long singularInt64_; 550 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 551 public long SingularInt64 { 552 get { return singularInt64_; } 553 set { 554 singularInt64_ = value; 555 } 556 } 557 558 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] Equals(object other)559 public override bool Equals(object other) { 560 return Equals(other as TestProto3Optional); 561 } 562 563 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] Equals(TestProto3Optional other)564 public bool Equals(TestProto3Optional other) { 565 if (ReferenceEquals(other, null)) { 566 return false; 567 } 568 if (ReferenceEquals(other, this)) { 569 return true; 570 } 571 if (OptionalInt32 != other.OptionalInt32) return false; 572 if (OptionalInt64 != other.OptionalInt64) return false; 573 if (OptionalUint32 != other.OptionalUint32) return false; 574 if (OptionalUint64 != other.OptionalUint64) return false; 575 if (OptionalSint32 != other.OptionalSint32) return false; 576 if (OptionalSint64 != other.OptionalSint64) return false; 577 if (OptionalFixed32 != other.OptionalFixed32) return false; 578 if (OptionalFixed64 != other.OptionalFixed64) return false; 579 if (OptionalSfixed32 != other.OptionalSfixed32) return false; 580 if (OptionalSfixed64 != other.OptionalSfixed64) return false; 581 if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(OptionalFloat, other.OptionalFloat)) return false; 582 if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(OptionalDouble, other.OptionalDouble)) return false; 583 if (OptionalBool != other.OptionalBool) return false; 584 if (OptionalString != other.OptionalString) return false; 585 if (OptionalBytes != other.OptionalBytes) return false; 586 if (OptionalCord != other.OptionalCord) return false; 587 if (!object.Equals(OptionalNestedMessage, other.OptionalNestedMessage)) return false; 588 if (!object.Equals(LazyNestedMessage, other.LazyNestedMessage)) return false; 589 if (OptionalNestedEnum != other.OptionalNestedEnum) return false; 590 if (SingularInt32 != other.SingularInt32) return false; 591 if (SingularInt64 != other.SingularInt64) return false; 592 return Equals(_unknownFields, other._unknownFields); 593 } 594 595 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] GetHashCode()596 public override int GetHashCode() { 597 int hash = 1; 598 if (HasOptionalInt32) hash ^= OptionalInt32.GetHashCode(); 599 if (HasOptionalInt64) hash ^= OptionalInt64.GetHashCode(); 600 if (HasOptionalUint32) hash ^= OptionalUint32.GetHashCode(); 601 if (HasOptionalUint64) hash ^= OptionalUint64.GetHashCode(); 602 if (HasOptionalSint32) hash ^= OptionalSint32.GetHashCode(); 603 if (HasOptionalSint64) hash ^= OptionalSint64.GetHashCode(); 604 if (HasOptionalFixed32) hash ^= OptionalFixed32.GetHashCode(); 605 if (HasOptionalFixed64) hash ^= OptionalFixed64.GetHashCode(); 606 if (HasOptionalSfixed32) hash ^= OptionalSfixed32.GetHashCode(); 607 if (HasOptionalSfixed64) hash ^= OptionalSfixed64.GetHashCode(); 608 if (HasOptionalFloat) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(OptionalFloat); 609 if (HasOptionalDouble) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(OptionalDouble); 610 if (HasOptionalBool) hash ^= OptionalBool.GetHashCode(); 611 if (HasOptionalString) hash ^= OptionalString.GetHashCode(); 612 if (HasOptionalBytes) hash ^= OptionalBytes.GetHashCode(); 613 if (HasOptionalCord) hash ^= OptionalCord.GetHashCode(); 614 if (optionalNestedMessage_ != null) hash ^= OptionalNestedMessage.GetHashCode(); 615 if (lazyNestedMessage_ != null) hash ^= LazyNestedMessage.GetHashCode(); 616 if (HasOptionalNestedEnum) hash ^= OptionalNestedEnum.GetHashCode(); 617 if (SingularInt32 != 0) hash ^= SingularInt32.GetHashCode(); 618 if (SingularInt64 != 0L) hash ^= SingularInt64.GetHashCode(); 619 if (_unknownFields != null) { 620 hash ^= _unknownFields.GetHashCode(); 621 } 622 return hash; 623 } 624 625 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] ToString()626 public override string ToString() { 627 return pb::JsonFormatter.ToDiagnosticString(this); 628 } 629 630 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] WriteTo(pb::CodedOutputStream output)631 public void WriteTo(pb::CodedOutputStream output) { 632 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 633 output.WriteRawMessage(this); 634 #else 635 if (HasOptionalInt32) { 636 output.WriteRawTag(8); 637 output.WriteInt32(OptionalInt32); 638 } 639 if (HasOptionalInt64) { 640 output.WriteRawTag(16); 641 output.WriteInt64(OptionalInt64); 642 } 643 if (HasOptionalUint32) { 644 output.WriteRawTag(24); 645 output.WriteUInt32(OptionalUint32); 646 } 647 if (HasOptionalUint64) { 648 output.WriteRawTag(32); 649 output.WriteUInt64(OptionalUint64); 650 } 651 if (HasOptionalSint32) { 652 output.WriteRawTag(40); 653 output.WriteSInt32(OptionalSint32); 654 } 655 if (HasOptionalSint64) { 656 output.WriteRawTag(48); 657 output.WriteSInt64(OptionalSint64); 658 } 659 if (HasOptionalFixed32) { 660 output.WriteRawTag(61); 661 output.WriteFixed32(OptionalFixed32); 662 } 663 if (HasOptionalFixed64) { 664 output.WriteRawTag(65); 665 output.WriteFixed64(OptionalFixed64); 666 } 667 if (HasOptionalSfixed32) { 668 output.WriteRawTag(77); 669 output.WriteSFixed32(OptionalSfixed32); 670 } 671 if (HasOptionalSfixed64) { 672 output.WriteRawTag(81); 673 output.WriteSFixed64(OptionalSfixed64); 674 } 675 if (HasOptionalFloat) { 676 output.WriteRawTag(93); 677 output.WriteFloat(OptionalFloat); 678 } 679 if (HasOptionalDouble) { 680 output.WriteRawTag(97); 681 output.WriteDouble(OptionalDouble); 682 } 683 if (HasOptionalBool) { 684 output.WriteRawTag(104); 685 output.WriteBool(OptionalBool); 686 } 687 if (HasOptionalString) { 688 output.WriteRawTag(114); 689 output.WriteString(OptionalString); 690 } 691 if (HasOptionalBytes) { 692 output.WriteRawTag(122); 693 output.WriteBytes(OptionalBytes); 694 } 695 if (HasOptionalCord) { 696 output.WriteRawTag(130, 1); 697 output.WriteString(OptionalCord); 698 } 699 if (optionalNestedMessage_ != null) { 700 output.WriteRawTag(146, 1); 701 output.WriteMessage(OptionalNestedMessage); 702 } 703 if (lazyNestedMessage_ != null) { 704 output.WriteRawTag(154, 1); 705 output.WriteMessage(LazyNestedMessage); 706 } 707 if (HasOptionalNestedEnum) { 708 output.WriteRawTag(168, 1); 709 output.WriteEnum((int) OptionalNestedEnum); 710 } 711 if (SingularInt32 != 0) { 712 output.WriteRawTag(176, 1); 713 output.WriteInt32(SingularInt32); 714 } 715 if (SingularInt64 != 0L) { 716 output.WriteRawTag(184, 1); 717 output.WriteInt64(SingularInt64); 718 } 719 if (_unknownFields != null) { 720 _unknownFields.WriteTo(output); 721 } 722 #endif 723 } 724 725 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 726 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] IBufferMessage.InternalWriteTo(ref pb::WriteContext output)727 void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { 728 if (HasOptionalInt32) { 729 output.WriteRawTag(8); 730 output.WriteInt32(OptionalInt32); 731 } 732 if (HasOptionalInt64) { 733 output.WriteRawTag(16); 734 output.WriteInt64(OptionalInt64); 735 } 736 if (HasOptionalUint32) { 737 output.WriteRawTag(24); 738 output.WriteUInt32(OptionalUint32); 739 } 740 if (HasOptionalUint64) { 741 output.WriteRawTag(32); 742 output.WriteUInt64(OptionalUint64); 743 } 744 if (HasOptionalSint32) { 745 output.WriteRawTag(40); 746 output.WriteSInt32(OptionalSint32); 747 } 748 if (HasOptionalSint64) { 749 output.WriteRawTag(48); 750 output.WriteSInt64(OptionalSint64); 751 } 752 if (HasOptionalFixed32) { 753 output.WriteRawTag(61); 754 output.WriteFixed32(OptionalFixed32); 755 } 756 if (HasOptionalFixed64) { 757 output.WriteRawTag(65); 758 output.WriteFixed64(OptionalFixed64); 759 } 760 if (HasOptionalSfixed32) { 761 output.WriteRawTag(77); 762 output.WriteSFixed32(OptionalSfixed32); 763 } 764 if (HasOptionalSfixed64) { 765 output.WriteRawTag(81); 766 output.WriteSFixed64(OptionalSfixed64); 767 } 768 if (HasOptionalFloat) { 769 output.WriteRawTag(93); 770 output.WriteFloat(OptionalFloat); 771 } 772 if (HasOptionalDouble) { 773 output.WriteRawTag(97); 774 output.WriteDouble(OptionalDouble); 775 } 776 if (HasOptionalBool) { 777 output.WriteRawTag(104); 778 output.WriteBool(OptionalBool); 779 } 780 if (HasOptionalString) { 781 output.WriteRawTag(114); 782 output.WriteString(OptionalString); 783 } 784 if (HasOptionalBytes) { 785 output.WriteRawTag(122); 786 output.WriteBytes(OptionalBytes); 787 } 788 if (HasOptionalCord) { 789 output.WriteRawTag(130, 1); 790 output.WriteString(OptionalCord); 791 } 792 if (optionalNestedMessage_ != null) { 793 output.WriteRawTag(146, 1); 794 output.WriteMessage(OptionalNestedMessage); 795 } 796 if (lazyNestedMessage_ != null) { 797 output.WriteRawTag(154, 1); 798 output.WriteMessage(LazyNestedMessage); 799 } 800 if (HasOptionalNestedEnum) { 801 output.WriteRawTag(168, 1); 802 output.WriteEnum((int) OptionalNestedEnum); 803 } 804 if (SingularInt32 != 0) { 805 output.WriteRawTag(176, 1); 806 output.WriteInt32(SingularInt32); 807 } 808 if (SingularInt64 != 0L) { 809 output.WriteRawTag(184, 1); 810 output.WriteInt64(SingularInt64); 811 } 812 if (_unknownFields != null) { 813 _unknownFields.WriteTo(ref output); 814 } 815 } 816 #endif 817 818 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] CalculateSize()819 public int CalculateSize() { 820 int size = 0; 821 if (HasOptionalInt32) { 822 size += 1 + pb::CodedOutputStream.ComputeInt32Size(OptionalInt32); 823 } 824 if (HasOptionalInt64) { 825 size += 1 + pb::CodedOutputStream.ComputeInt64Size(OptionalInt64); 826 } 827 if (HasOptionalUint32) { 828 size += 1 + pb::CodedOutputStream.ComputeUInt32Size(OptionalUint32); 829 } 830 if (HasOptionalUint64) { 831 size += 1 + pb::CodedOutputStream.ComputeUInt64Size(OptionalUint64); 832 } 833 if (HasOptionalSint32) { 834 size += 1 + pb::CodedOutputStream.ComputeSInt32Size(OptionalSint32); 835 } 836 if (HasOptionalSint64) { 837 size += 1 + pb::CodedOutputStream.ComputeSInt64Size(OptionalSint64); 838 } 839 if (HasOptionalFixed32) { 840 size += 1 + 4; 841 } 842 if (HasOptionalFixed64) { 843 size += 1 + 8; 844 } 845 if (HasOptionalSfixed32) { 846 size += 1 + 4; 847 } 848 if (HasOptionalSfixed64) { 849 size += 1 + 8; 850 } 851 if (HasOptionalFloat) { 852 size += 1 + 4; 853 } 854 if (HasOptionalDouble) { 855 size += 1 + 8; 856 } 857 if (HasOptionalBool) { 858 size += 1 + 1; 859 } 860 if (HasOptionalString) { 861 size += 1 + pb::CodedOutputStream.ComputeStringSize(OptionalString); 862 } 863 if (HasOptionalBytes) { 864 size += 1 + pb::CodedOutputStream.ComputeBytesSize(OptionalBytes); 865 } 866 if (HasOptionalCord) { 867 size += 2 + pb::CodedOutputStream.ComputeStringSize(OptionalCord); 868 } 869 if (optionalNestedMessage_ != null) { 870 size += 2 + pb::CodedOutputStream.ComputeMessageSize(OptionalNestedMessage); 871 } 872 if (lazyNestedMessage_ != null) { 873 size += 2 + pb::CodedOutputStream.ComputeMessageSize(LazyNestedMessage); 874 } 875 if (HasOptionalNestedEnum) { 876 size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) OptionalNestedEnum); 877 } 878 if (SingularInt32 != 0) { 879 size += 2 + pb::CodedOutputStream.ComputeInt32Size(SingularInt32); 880 } 881 if (SingularInt64 != 0L) { 882 size += 2 + pb::CodedOutputStream.ComputeInt64Size(SingularInt64); 883 } 884 if (_unknownFields != null) { 885 size += _unknownFields.CalculateSize(); 886 } 887 return size; 888 } 889 890 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] MergeFrom(TestProto3Optional other)891 public void MergeFrom(TestProto3Optional other) { 892 if (other == null) { 893 return; 894 } 895 if (other.HasOptionalInt32) { 896 OptionalInt32 = other.OptionalInt32; 897 } 898 if (other.HasOptionalInt64) { 899 OptionalInt64 = other.OptionalInt64; 900 } 901 if (other.HasOptionalUint32) { 902 OptionalUint32 = other.OptionalUint32; 903 } 904 if (other.HasOptionalUint64) { 905 OptionalUint64 = other.OptionalUint64; 906 } 907 if (other.HasOptionalSint32) { 908 OptionalSint32 = other.OptionalSint32; 909 } 910 if (other.HasOptionalSint64) { 911 OptionalSint64 = other.OptionalSint64; 912 } 913 if (other.HasOptionalFixed32) { 914 OptionalFixed32 = other.OptionalFixed32; 915 } 916 if (other.HasOptionalFixed64) { 917 OptionalFixed64 = other.OptionalFixed64; 918 } 919 if (other.HasOptionalSfixed32) { 920 OptionalSfixed32 = other.OptionalSfixed32; 921 } 922 if (other.HasOptionalSfixed64) { 923 OptionalSfixed64 = other.OptionalSfixed64; 924 } 925 if (other.HasOptionalFloat) { 926 OptionalFloat = other.OptionalFloat; 927 } 928 if (other.HasOptionalDouble) { 929 OptionalDouble = other.OptionalDouble; 930 } 931 if (other.HasOptionalBool) { 932 OptionalBool = other.OptionalBool; 933 } 934 if (other.HasOptionalString) { 935 OptionalString = other.OptionalString; 936 } 937 if (other.HasOptionalBytes) { 938 OptionalBytes = other.OptionalBytes; 939 } 940 if (other.HasOptionalCord) { 941 OptionalCord = other.OptionalCord; 942 } 943 if (other.optionalNestedMessage_ != null) { 944 if (optionalNestedMessage_ == null) { 945 OptionalNestedMessage = new global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage(); 946 } 947 OptionalNestedMessage.MergeFrom(other.OptionalNestedMessage); 948 } 949 if (other.lazyNestedMessage_ != null) { 950 if (lazyNestedMessage_ == null) { 951 LazyNestedMessage = new global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage(); 952 } 953 LazyNestedMessage.MergeFrom(other.LazyNestedMessage); 954 } 955 if (other.HasOptionalNestedEnum) { 956 OptionalNestedEnum = other.OptionalNestedEnum; 957 } 958 if (other.SingularInt32 != 0) { 959 SingularInt32 = other.SingularInt32; 960 } 961 if (other.SingularInt64 != 0L) { 962 SingularInt64 = other.SingularInt64; 963 } 964 _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); 965 } 966 967 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] MergeFrom(pb::CodedInputStream input)968 public void MergeFrom(pb::CodedInputStream input) { 969 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 970 input.ReadRawMessage(this); 971 #else 972 uint tag; 973 while ((tag = input.ReadTag()) != 0) { 974 switch(tag) { 975 default: 976 _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); 977 break; 978 case 8: { 979 OptionalInt32 = input.ReadInt32(); 980 break; 981 } 982 case 16: { 983 OptionalInt64 = input.ReadInt64(); 984 break; 985 } 986 case 24: { 987 OptionalUint32 = input.ReadUInt32(); 988 break; 989 } 990 case 32: { 991 OptionalUint64 = input.ReadUInt64(); 992 break; 993 } 994 case 40: { 995 OptionalSint32 = input.ReadSInt32(); 996 break; 997 } 998 case 48: { 999 OptionalSint64 = input.ReadSInt64(); 1000 break; 1001 } 1002 case 61: { 1003 OptionalFixed32 = input.ReadFixed32(); 1004 break; 1005 } 1006 case 65: { 1007 OptionalFixed64 = input.ReadFixed64(); 1008 break; 1009 } 1010 case 77: { 1011 OptionalSfixed32 = input.ReadSFixed32(); 1012 break; 1013 } 1014 case 81: { 1015 OptionalSfixed64 = input.ReadSFixed64(); 1016 break; 1017 } 1018 case 93: { 1019 OptionalFloat = input.ReadFloat(); 1020 break; 1021 } 1022 case 97: { 1023 OptionalDouble = input.ReadDouble(); 1024 break; 1025 } 1026 case 104: { 1027 OptionalBool = input.ReadBool(); 1028 break; 1029 } 1030 case 114: { 1031 OptionalString = input.ReadString(); 1032 break; 1033 } 1034 case 122: { 1035 OptionalBytes = input.ReadBytes(); 1036 break; 1037 } 1038 case 130: { 1039 OptionalCord = input.ReadString(); 1040 break; 1041 } 1042 case 146: { 1043 if (optionalNestedMessage_ == null) { 1044 OptionalNestedMessage = new global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage(); 1045 } 1046 input.ReadMessage(OptionalNestedMessage); 1047 break; 1048 } 1049 case 154: { 1050 if (lazyNestedMessage_ == null) { 1051 LazyNestedMessage = new global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage(); 1052 } 1053 input.ReadMessage(LazyNestedMessage); 1054 break; 1055 } 1056 case 168: { 1057 OptionalNestedEnum = (global::ProtobufUnittest.TestProto3Optional.Types.NestedEnum) input.ReadEnum(); 1058 break; 1059 } 1060 case 176: { 1061 SingularInt32 = input.ReadInt32(); 1062 break; 1063 } 1064 case 184: { 1065 SingularInt64 = input.ReadInt64(); 1066 break; 1067 } 1068 } 1069 } 1070 #endif 1071 } 1072 1073 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 1074 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] IBufferMessage.InternalMergeFrom(ref pb::ParseContext input)1075 void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { 1076 uint tag; 1077 while ((tag = input.ReadTag()) != 0) { 1078 switch(tag) { 1079 default: 1080 _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); 1081 break; 1082 case 8: { 1083 OptionalInt32 = input.ReadInt32(); 1084 break; 1085 } 1086 case 16: { 1087 OptionalInt64 = input.ReadInt64(); 1088 break; 1089 } 1090 case 24: { 1091 OptionalUint32 = input.ReadUInt32(); 1092 break; 1093 } 1094 case 32: { 1095 OptionalUint64 = input.ReadUInt64(); 1096 break; 1097 } 1098 case 40: { 1099 OptionalSint32 = input.ReadSInt32(); 1100 break; 1101 } 1102 case 48: { 1103 OptionalSint64 = input.ReadSInt64(); 1104 break; 1105 } 1106 case 61: { 1107 OptionalFixed32 = input.ReadFixed32(); 1108 break; 1109 } 1110 case 65: { 1111 OptionalFixed64 = input.ReadFixed64(); 1112 break; 1113 } 1114 case 77: { 1115 OptionalSfixed32 = input.ReadSFixed32(); 1116 break; 1117 } 1118 case 81: { 1119 OptionalSfixed64 = input.ReadSFixed64(); 1120 break; 1121 } 1122 case 93: { 1123 OptionalFloat = input.ReadFloat(); 1124 break; 1125 } 1126 case 97: { 1127 OptionalDouble = input.ReadDouble(); 1128 break; 1129 } 1130 case 104: { 1131 OptionalBool = input.ReadBool(); 1132 break; 1133 } 1134 case 114: { 1135 OptionalString = input.ReadString(); 1136 break; 1137 } 1138 case 122: { 1139 OptionalBytes = input.ReadBytes(); 1140 break; 1141 } 1142 case 130: { 1143 OptionalCord = input.ReadString(); 1144 break; 1145 } 1146 case 146: { 1147 if (optionalNestedMessage_ == null) { 1148 OptionalNestedMessage = new global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage(); 1149 } 1150 input.ReadMessage(OptionalNestedMessage); 1151 break; 1152 } 1153 case 154: { 1154 if (lazyNestedMessage_ == null) { 1155 LazyNestedMessage = new global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage(); 1156 } 1157 input.ReadMessage(LazyNestedMessage); 1158 break; 1159 } 1160 case 168: { 1161 OptionalNestedEnum = (global::ProtobufUnittest.TestProto3Optional.Types.NestedEnum) input.ReadEnum(); 1162 break; 1163 } 1164 case 176: { 1165 SingularInt32 = input.ReadInt32(); 1166 break; 1167 } 1168 case 184: { 1169 SingularInt64 = input.ReadInt64(); 1170 break; 1171 } 1172 } 1173 } 1174 } 1175 #endif 1176 1177 #region Nested types 1178 /// <summary>Container for nested types declared in the TestProto3Optional message type.</summary> 1179 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1180 public static partial class Types { 1181 public enum NestedEnum { 1182 [pbr::OriginalName("UNSPECIFIED")] Unspecified = 0, 1183 [pbr::OriginalName("FOO")] Foo = 1, 1184 [pbr::OriginalName("BAR")] Bar = 2, 1185 [pbr::OriginalName("BAZ")] Baz = 3, 1186 /// <summary> 1187 /// Intentionally negative. 1188 /// </summary> 1189 [pbr::OriginalName("NEG")] Neg = -1, 1190 } 1191 1192 public sealed partial class NestedMessage : pb::IMessage<NestedMessage> 1193 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 1194 , pb::IBufferMessage 1195 #endif 1196 { 1197 private static readonly pb::MessageParser<NestedMessage> _parser = new pb::MessageParser<NestedMessage>(() => new NestedMessage()); 1198 private pb::UnknownFieldSet _unknownFields; 1199 private int _hasBits0; 1200 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1201 public static pb::MessageParser<NestedMessage> Parser { get { return _parser; } } 1202 1203 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1204 public static pbr::MessageDescriptor Descriptor { 1205 get { return global::ProtobufUnittest.TestProto3Optional.Descriptor.NestedTypes[0]; } 1206 } 1207 1208 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1209 pbr::MessageDescriptor pb::IMessage.Descriptor { 1210 get { return Descriptor; } 1211 } 1212 1213 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] NestedMessage()1214 public NestedMessage() { 1215 OnConstruction(); 1216 } 1217 OnConstruction()1218 partial void OnConstruction(); 1219 1220 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] NestedMessage(NestedMessage other)1221 public NestedMessage(NestedMessage other) : this() { 1222 _hasBits0 = other._hasBits0; 1223 bb_ = other.bb_; 1224 _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); 1225 } 1226 1227 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] Clone()1228 public NestedMessage Clone() { 1229 return new NestedMessage(this); 1230 } 1231 1232 /// <summary>Field number for the "bb" field.</summary> 1233 public const int BbFieldNumber = 1; 1234 private int bb_; 1235 /// <summary> 1236 /// The field name "b" fails to compile in proto1 because it conflicts with 1237 /// a local variable named "b" in one of the generated methods. Doh. 1238 /// This file needs to compile in proto1 to test backwards-compatibility. 1239 /// </summary> 1240 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1241 public int Bb { 1242 get { if ((_hasBits0 & 1) != 0) { return bb_; } else { return 0; } } 1243 set { 1244 _hasBits0 |= 1; 1245 bb_ = value; 1246 } 1247 } 1248 /// <summary>Gets whether the "bb" field is set</summary> 1249 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1250 public bool HasBb { 1251 get { return (_hasBits0 & 1) != 0; } 1252 } 1253 /// <summary>Clears the value of the "bb" field</summary> 1254 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] ClearBb()1255 public void ClearBb() { 1256 _hasBits0 &= ~1; 1257 } 1258 1259 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] Equals(object other)1260 public override bool Equals(object other) { 1261 return Equals(other as NestedMessage); 1262 } 1263 1264 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] Equals(NestedMessage other)1265 public bool Equals(NestedMessage other) { 1266 if (ReferenceEquals(other, null)) { 1267 return false; 1268 } 1269 if (ReferenceEquals(other, this)) { 1270 return true; 1271 } 1272 if (Bb != other.Bb) return false; 1273 return Equals(_unknownFields, other._unknownFields); 1274 } 1275 1276 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] GetHashCode()1277 public override int GetHashCode() { 1278 int hash = 1; 1279 if (HasBb) hash ^= Bb.GetHashCode(); 1280 if (_unknownFields != null) { 1281 hash ^= _unknownFields.GetHashCode(); 1282 } 1283 return hash; 1284 } 1285 1286 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] ToString()1287 public override string ToString() { 1288 return pb::JsonFormatter.ToDiagnosticString(this); 1289 } 1290 1291 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] WriteTo(pb::CodedOutputStream output)1292 public void WriteTo(pb::CodedOutputStream output) { 1293 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 1294 output.WriteRawMessage(this); 1295 #else 1296 if (HasBb) { 1297 output.WriteRawTag(8); 1298 output.WriteInt32(Bb); 1299 } 1300 if (_unknownFields != null) { 1301 _unknownFields.WriteTo(output); 1302 } 1303 #endif 1304 } 1305 1306 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 1307 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] IBufferMessage.InternalWriteTo(ref pb::WriteContext output)1308 void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { 1309 if (HasBb) { 1310 output.WriteRawTag(8); 1311 output.WriteInt32(Bb); 1312 } 1313 if (_unknownFields != null) { 1314 _unknownFields.WriteTo(ref output); 1315 } 1316 } 1317 #endif 1318 1319 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] CalculateSize()1320 public int CalculateSize() { 1321 int size = 0; 1322 if (HasBb) { 1323 size += 1 + pb::CodedOutputStream.ComputeInt32Size(Bb); 1324 } 1325 if (_unknownFields != null) { 1326 size += _unknownFields.CalculateSize(); 1327 } 1328 return size; 1329 } 1330 1331 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] MergeFrom(NestedMessage other)1332 public void MergeFrom(NestedMessage other) { 1333 if (other == null) { 1334 return; 1335 } 1336 if (other.HasBb) { 1337 Bb = other.Bb; 1338 } 1339 _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); 1340 } 1341 1342 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] MergeFrom(pb::CodedInputStream input)1343 public void MergeFrom(pb::CodedInputStream input) { 1344 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 1345 input.ReadRawMessage(this); 1346 #else 1347 uint tag; 1348 while ((tag = input.ReadTag()) != 0) { 1349 switch(tag) { 1350 default: 1351 _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); 1352 break; 1353 case 8: { 1354 Bb = input.ReadInt32(); 1355 break; 1356 } 1357 } 1358 } 1359 #endif 1360 } 1361 1362 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 1363 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] IBufferMessage.InternalMergeFrom(ref pb::ParseContext input)1364 void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { 1365 uint tag; 1366 while ((tag = input.ReadTag()) != 0) { 1367 switch(tag) { 1368 default: 1369 _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); 1370 break; 1371 case 8: { 1372 Bb = input.ReadInt32(); 1373 break; 1374 } 1375 } 1376 } 1377 } 1378 #endif 1379 1380 } 1381 1382 } 1383 #endregion 1384 1385 } 1386 1387 public sealed partial class TestProto3OptionalMessage : pb::IMessage<TestProto3OptionalMessage> 1388 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 1389 , pb::IBufferMessage 1390 #endif 1391 { 1392 private static readonly pb::MessageParser<TestProto3OptionalMessage> _parser = new pb::MessageParser<TestProto3OptionalMessage>(() => new TestProto3OptionalMessage()); 1393 private pb::UnknownFieldSet _unknownFields; 1394 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1395 public static pb::MessageParser<TestProto3OptionalMessage> Parser { get { return _parser; } } 1396 1397 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1398 public static pbr::MessageDescriptor Descriptor { 1399 get { return global::ProtobufUnittest.UnittestProto3OptionalReflection.Descriptor.MessageTypes[1]; } 1400 } 1401 1402 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1403 pbr::MessageDescriptor pb::IMessage.Descriptor { 1404 get { return Descriptor; } 1405 } 1406 1407 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] TestProto3OptionalMessage()1408 public TestProto3OptionalMessage() { 1409 OnConstruction(); 1410 } 1411 OnConstruction()1412 partial void OnConstruction(); 1413 1414 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] TestProto3OptionalMessage(TestProto3OptionalMessage other)1415 public TestProto3OptionalMessage(TestProto3OptionalMessage other) : this() { 1416 nestedMessage_ = other.nestedMessage_ != null ? other.nestedMessage_.Clone() : null; 1417 optionalNestedMessage_ = other.optionalNestedMessage_ != null ? other.optionalNestedMessage_.Clone() : null; 1418 _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); 1419 } 1420 1421 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] Clone()1422 public TestProto3OptionalMessage Clone() { 1423 return new TestProto3OptionalMessage(this); 1424 } 1425 1426 /// <summary>Field number for the "nested_message" field.</summary> 1427 public const int NestedMessageFieldNumber = 1; 1428 private global::ProtobufUnittest.TestProto3OptionalMessage.Types.NestedMessage nestedMessage_; 1429 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1430 public global::ProtobufUnittest.TestProto3OptionalMessage.Types.NestedMessage NestedMessage { 1431 get { return nestedMessage_; } 1432 set { 1433 nestedMessage_ = value; 1434 } 1435 } 1436 1437 /// <summary>Field number for the "optional_nested_message" field.</summary> 1438 public const int OptionalNestedMessageFieldNumber = 2; 1439 private global::ProtobufUnittest.TestProto3OptionalMessage.Types.NestedMessage optionalNestedMessage_; 1440 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1441 public global::ProtobufUnittest.TestProto3OptionalMessage.Types.NestedMessage OptionalNestedMessage { 1442 get { return optionalNestedMessage_; } 1443 set { 1444 optionalNestedMessage_ = value; 1445 } 1446 } 1447 1448 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] Equals(object other)1449 public override bool Equals(object other) { 1450 return Equals(other as TestProto3OptionalMessage); 1451 } 1452 1453 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] Equals(TestProto3OptionalMessage other)1454 public bool Equals(TestProto3OptionalMessage other) { 1455 if (ReferenceEquals(other, null)) { 1456 return false; 1457 } 1458 if (ReferenceEquals(other, this)) { 1459 return true; 1460 } 1461 if (!object.Equals(NestedMessage, other.NestedMessage)) return false; 1462 if (!object.Equals(OptionalNestedMessage, other.OptionalNestedMessage)) return false; 1463 return Equals(_unknownFields, other._unknownFields); 1464 } 1465 1466 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] GetHashCode()1467 public override int GetHashCode() { 1468 int hash = 1; 1469 if (nestedMessage_ != null) hash ^= NestedMessage.GetHashCode(); 1470 if (optionalNestedMessage_ != null) hash ^= OptionalNestedMessage.GetHashCode(); 1471 if (_unknownFields != null) { 1472 hash ^= _unknownFields.GetHashCode(); 1473 } 1474 return hash; 1475 } 1476 1477 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] ToString()1478 public override string ToString() { 1479 return pb::JsonFormatter.ToDiagnosticString(this); 1480 } 1481 1482 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] WriteTo(pb::CodedOutputStream output)1483 public void WriteTo(pb::CodedOutputStream output) { 1484 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 1485 output.WriteRawMessage(this); 1486 #else 1487 if (nestedMessage_ != null) { 1488 output.WriteRawTag(10); 1489 output.WriteMessage(NestedMessage); 1490 } 1491 if (optionalNestedMessage_ != null) { 1492 output.WriteRawTag(18); 1493 output.WriteMessage(OptionalNestedMessage); 1494 } 1495 if (_unknownFields != null) { 1496 _unknownFields.WriteTo(output); 1497 } 1498 #endif 1499 } 1500 1501 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 1502 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] IBufferMessage.InternalWriteTo(ref pb::WriteContext output)1503 void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { 1504 if (nestedMessage_ != null) { 1505 output.WriteRawTag(10); 1506 output.WriteMessage(NestedMessage); 1507 } 1508 if (optionalNestedMessage_ != null) { 1509 output.WriteRawTag(18); 1510 output.WriteMessage(OptionalNestedMessage); 1511 } 1512 if (_unknownFields != null) { 1513 _unknownFields.WriteTo(ref output); 1514 } 1515 } 1516 #endif 1517 1518 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] CalculateSize()1519 public int CalculateSize() { 1520 int size = 0; 1521 if (nestedMessage_ != null) { 1522 size += 1 + pb::CodedOutputStream.ComputeMessageSize(NestedMessage); 1523 } 1524 if (optionalNestedMessage_ != null) { 1525 size += 1 + pb::CodedOutputStream.ComputeMessageSize(OptionalNestedMessage); 1526 } 1527 if (_unknownFields != null) { 1528 size += _unknownFields.CalculateSize(); 1529 } 1530 return size; 1531 } 1532 1533 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] MergeFrom(TestProto3OptionalMessage other)1534 public void MergeFrom(TestProto3OptionalMessage other) { 1535 if (other == null) { 1536 return; 1537 } 1538 if (other.nestedMessage_ != null) { 1539 if (nestedMessage_ == null) { 1540 NestedMessage = new global::ProtobufUnittest.TestProto3OptionalMessage.Types.NestedMessage(); 1541 } 1542 NestedMessage.MergeFrom(other.NestedMessage); 1543 } 1544 if (other.optionalNestedMessage_ != null) { 1545 if (optionalNestedMessage_ == null) { 1546 OptionalNestedMessage = new global::ProtobufUnittest.TestProto3OptionalMessage.Types.NestedMessage(); 1547 } 1548 OptionalNestedMessage.MergeFrom(other.OptionalNestedMessage); 1549 } 1550 _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); 1551 } 1552 1553 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] MergeFrom(pb::CodedInputStream input)1554 public void MergeFrom(pb::CodedInputStream input) { 1555 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 1556 input.ReadRawMessage(this); 1557 #else 1558 uint tag; 1559 while ((tag = input.ReadTag()) != 0) { 1560 switch(tag) { 1561 default: 1562 _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); 1563 break; 1564 case 10: { 1565 if (nestedMessage_ == null) { 1566 NestedMessage = new global::ProtobufUnittest.TestProto3OptionalMessage.Types.NestedMessage(); 1567 } 1568 input.ReadMessage(NestedMessage); 1569 break; 1570 } 1571 case 18: { 1572 if (optionalNestedMessage_ == null) { 1573 OptionalNestedMessage = new global::ProtobufUnittest.TestProto3OptionalMessage.Types.NestedMessage(); 1574 } 1575 input.ReadMessage(OptionalNestedMessage); 1576 break; 1577 } 1578 } 1579 } 1580 #endif 1581 } 1582 1583 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 1584 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] IBufferMessage.InternalMergeFrom(ref pb::ParseContext input)1585 void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { 1586 uint tag; 1587 while ((tag = input.ReadTag()) != 0) { 1588 switch(tag) { 1589 default: 1590 _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); 1591 break; 1592 case 10: { 1593 if (nestedMessage_ == null) { 1594 NestedMessage = new global::ProtobufUnittest.TestProto3OptionalMessage.Types.NestedMessage(); 1595 } 1596 input.ReadMessage(NestedMessage); 1597 break; 1598 } 1599 case 18: { 1600 if (optionalNestedMessage_ == null) { 1601 OptionalNestedMessage = new global::ProtobufUnittest.TestProto3OptionalMessage.Types.NestedMessage(); 1602 } 1603 input.ReadMessage(OptionalNestedMessage); 1604 break; 1605 } 1606 } 1607 } 1608 } 1609 #endif 1610 1611 #region Nested types 1612 /// <summary>Container for nested types declared in the TestProto3OptionalMessage message type.</summary> 1613 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1614 public static partial class Types { 1615 public sealed partial class NestedMessage : pb::IMessage<NestedMessage> 1616 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 1617 , pb::IBufferMessage 1618 #endif 1619 { 1620 private static readonly pb::MessageParser<NestedMessage> _parser = new pb::MessageParser<NestedMessage>(() => new NestedMessage()); 1621 private pb::UnknownFieldSet _unknownFields; 1622 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1623 public static pb::MessageParser<NestedMessage> Parser { get { return _parser; } } 1624 1625 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1626 public static pbr::MessageDescriptor Descriptor { 1627 get { return global::ProtobufUnittest.TestProto3OptionalMessage.Descriptor.NestedTypes[0]; } 1628 } 1629 1630 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1631 pbr::MessageDescriptor pb::IMessage.Descriptor { 1632 get { return Descriptor; } 1633 } 1634 1635 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] NestedMessage()1636 public NestedMessage() { 1637 OnConstruction(); 1638 } 1639 OnConstruction()1640 partial void OnConstruction(); 1641 1642 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] NestedMessage(NestedMessage other)1643 public NestedMessage(NestedMessage other) : this() { 1644 s_ = other.s_; 1645 _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); 1646 } 1647 1648 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] Clone()1649 public NestedMessage Clone() { 1650 return new NestedMessage(this); 1651 } 1652 1653 /// <summary>Field number for the "s" field.</summary> 1654 public const int SFieldNumber = 1; 1655 private string s_ = ""; 1656 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1657 public string S { 1658 get { return s_; } 1659 set { 1660 s_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 1661 } 1662 } 1663 1664 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] Equals(object other)1665 public override bool Equals(object other) { 1666 return Equals(other as NestedMessage); 1667 } 1668 1669 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] Equals(NestedMessage other)1670 public bool Equals(NestedMessage other) { 1671 if (ReferenceEquals(other, null)) { 1672 return false; 1673 } 1674 if (ReferenceEquals(other, this)) { 1675 return true; 1676 } 1677 if (S != other.S) return false; 1678 return Equals(_unknownFields, other._unknownFields); 1679 } 1680 1681 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] GetHashCode()1682 public override int GetHashCode() { 1683 int hash = 1; 1684 if (S.Length != 0) hash ^= S.GetHashCode(); 1685 if (_unknownFields != null) { 1686 hash ^= _unknownFields.GetHashCode(); 1687 } 1688 return hash; 1689 } 1690 1691 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] ToString()1692 public override string ToString() { 1693 return pb::JsonFormatter.ToDiagnosticString(this); 1694 } 1695 1696 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] WriteTo(pb::CodedOutputStream output)1697 public void WriteTo(pb::CodedOutputStream output) { 1698 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 1699 output.WriteRawMessage(this); 1700 #else 1701 if (S.Length != 0) { 1702 output.WriteRawTag(10); 1703 output.WriteString(S); 1704 } 1705 if (_unknownFields != null) { 1706 _unknownFields.WriteTo(output); 1707 } 1708 #endif 1709 } 1710 1711 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 1712 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] IBufferMessage.InternalWriteTo(ref pb::WriteContext output)1713 void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { 1714 if (S.Length != 0) { 1715 output.WriteRawTag(10); 1716 output.WriteString(S); 1717 } 1718 if (_unknownFields != null) { 1719 _unknownFields.WriteTo(ref output); 1720 } 1721 } 1722 #endif 1723 1724 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] CalculateSize()1725 public int CalculateSize() { 1726 int size = 0; 1727 if (S.Length != 0) { 1728 size += 1 + pb::CodedOutputStream.ComputeStringSize(S); 1729 } 1730 if (_unknownFields != null) { 1731 size += _unknownFields.CalculateSize(); 1732 } 1733 return size; 1734 } 1735 1736 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] MergeFrom(NestedMessage other)1737 public void MergeFrom(NestedMessage other) { 1738 if (other == null) { 1739 return; 1740 } 1741 if (other.S.Length != 0) { 1742 S = other.S; 1743 } 1744 _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); 1745 } 1746 1747 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] MergeFrom(pb::CodedInputStream input)1748 public void MergeFrom(pb::CodedInputStream input) { 1749 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 1750 input.ReadRawMessage(this); 1751 #else 1752 uint tag; 1753 while ((tag = input.ReadTag()) != 0) { 1754 switch(tag) { 1755 default: 1756 _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); 1757 break; 1758 case 10: { 1759 S = input.ReadString(); 1760 break; 1761 } 1762 } 1763 } 1764 #endif 1765 } 1766 1767 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 1768 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] IBufferMessage.InternalMergeFrom(ref pb::ParseContext input)1769 void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { 1770 uint tag; 1771 while ((tag = input.ReadTag()) != 0) { 1772 switch(tag) { 1773 default: 1774 _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); 1775 break; 1776 case 10: { 1777 S = input.ReadString(); 1778 break; 1779 } 1780 } 1781 } 1782 } 1783 #endif 1784 1785 } 1786 1787 } 1788 #endregion 1789 1790 } 1791 1792 #endregion 1793 1794 } 1795 1796 #endregion Designer generated code 1797