1 // Generated by the protocol buffer compiler. DO NOT EDIT! 2 // source: unittest_issues.proto 3 #pragma warning disable 1591, 0612, 3021 4 #region Designer generated code 5 6 using pb = global::Google.Protobuf; 7 using pbc = global::Google.Protobuf.Collections; 8 using pbr = global::Google.Protobuf.Reflection; 9 using scg = global::System.Collections.Generic; 10 namespace UnitTest.Issues.TestProtos { 11 12 /// <summary>Holder for reflection information generated from unittest_issues.proto</summary> 13 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 14 public static partial class UnittestIssuesReflection { 15 16 #region Descriptor 17 /// <summary>File descriptor for unittest_issues.proto</summary> 18 public static pbr::FileDescriptor Descriptor { 19 get { return descriptor; } 20 } 21 private static pbr::FileDescriptor descriptor; 22 UnittestIssuesReflection()23 static UnittestIssuesReflection() { 24 byte[] descriptorData = global::System.Convert.FromBase64String( 25 string.Concat( 26 "ChV1bml0dGVzdF9pc3N1ZXMucHJvdG8SD3VuaXR0ZXN0X2lzc3VlcyInCghJ", 27 "c3N1ZTMwNxobCgpOZXN0ZWRPbmNlGg0KC05lc3RlZFR3aWNlIrABChNOZWdh", 28 "dGl2ZUVudW1NZXNzYWdlEiwKBXZhbHVlGAEgASgOMh0udW5pdHRlc3RfaXNz", 29 "dWVzLk5lZ2F0aXZlRW51bRIxCgZ2YWx1ZXMYAiADKA4yHS51bml0dGVzdF9p", 30 "c3N1ZXMuTmVnYXRpdmVFbnVtQgIQABI4Cg1wYWNrZWRfdmFsdWVzGAMgAygO", 31 "Mh0udW5pdHRlc3RfaXNzdWVzLk5lZ2F0aXZlRW51bUICEAEiEQoPRGVwcmVj", 32 "YXRlZENoaWxkIrkCChdEZXByZWNhdGVkRmllbGRzTWVzc2FnZRIaCg5Qcmlt", 33 "aXRpdmVWYWx1ZRgBIAEoBUICGAESGgoOUHJpbWl0aXZlQXJyYXkYAiADKAVC", 34 "AhgBEjoKDE1lc3NhZ2VWYWx1ZRgDIAEoCzIgLnVuaXR0ZXN0X2lzc3Vlcy5E", 35 "ZXByZWNhdGVkQ2hpbGRCAhgBEjoKDE1lc3NhZ2VBcnJheRgEIAMoCzIgLnVu", 36 "aXR0ZXN0X2lzc3Vlcy5EZXByZWNhdGVkQ2hpbGRCAhgBEjYKCUVudW1WYWx1", 37 "ZRgFIAEoDjIfLnVuaXR0ZXN0X2lzc3Vlcy5EZXByZWNhdGVkRW51bUICGAES", 38 "NgoJRW51bUFycmF5GAYgAygOMh8udW5pdHRlc3RfaXNzdWVzLkRlcHJlY2F0", 39 "ZWRFbnVtQgIYASIZCglJdGVtRmllbGQSDAoEaXRlbRgBIAEoBSJECg1SZXNl", 40 "cnZlZE5hbWVzEg0KBXR5cGVzGAEgASgFEhIKCmRlc2NyaXB0b3IYAiABKAUa", 41 "EAoOU29tZU5lc3RlZFR5cGUioAEKFVRlc3RKc29uRmllbGRPcmRlcmluZxIT", 42 "CgtwbGFpbl9pbnQzMhgEIAEoBRITCglvMV9zdHJpbmcYAiABKAlIABISCghv", 43 "MV9pbnQzMhgFIAEoBUgAEhQKDHBsYWluX3N0cmluZxgBIAEoCRISCghvMl9p", 44 "bnQzMhgGIAEoBUgBEhMKCW8yX3N0cmluZxgDIAEoCUgBQgQKAm8xQgQKAm8y", 45 "IksKDFRlc3RKc29uTmFtZRIMCgRuYW1lGAEgASgJEhkKC2Rlc2NyaXB0aW9u", 46 "GAIgASgJUgRkZXNjEhIKBGd1aWQYAyABKAlSBGV4aWQqVQoMTmVnYXRpdmVF", 47 "bnVtEhYKEk5FR0FUSVZFX0VOVU1fWkVSTxAAEhYKCUZpdmVCZWxvdxD7////", 48 "//////8BEhUKCE1pbnVzT25lEP///////////wEqLgoORGVwcmVjYXRlZEVu", 49 "dW0SEwoPREVQUkVDQVRFRF9aRVJPEAASBwoDb25lEAFCH0gBqgIaVW5pdFRl", 50 "c3QuSXNzdWVzLlRlc3RQcm90b3NiBnByb3RvMw==")); 51 descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, 52 new pbr::FileDescriptor[] { }, 53 new pbr::GeneratedClrTypeInfo(new[] {typeof(global::UnitTest.Issues.TestProtos.NegativeEnum), typeof(global::UnitTest.Issues.TestProtos.DeprecatedEnum), }, new pbr::GeneratedClrTypeInfo[] { 54 new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.Issue307), global::UnitTest.Issues.TestProtos.Issue307.Parser, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce), global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce.Parser, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce.Types.NestedTwice), global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce.Types.NestedTwice.Parser, null, null, null, null)})}), 55 new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.NegativeEnumMessage), global::UnitTest.Issues.TestProtos.NegativeEnumMessage.Parser, new[]{ "Value", "Values", "PackedValues" }, null, null, null), 56 new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.DeprecatedChild), global::UnitTest.Issues.TestProtos.DeprecatedChild.Parser, null, null, null, null), 57 new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.DeprecatedFieldsMessage), global::UnitTest.Issues.TestProtos.DeprecatedFieldsMessage.Parser, new[]{ "PrimitiveValue", "PrimitiveArray", "MessageValue", "MessageArray", "EnumValue", "EnumArray" }, null, null, null), 58 new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.ItemField), global::UnitTest.Issues.TestProtos.ItemField.Parser, new[]{ "Item" }, null, null, null), 59 new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.ReservedNames), global::UnitTest.Issues.TestProtos.ReservedNames.Parser, new[]{ "Types_", "Descriptor_" }, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.ReservedNames.Types.SomeNestedType), global::UnitTest.Issues.TestProtos.ReservedNames.Types.SomeNestedType.Parser, null, null, null, null)}), 60 new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.TestJsonFieldOrdering), global::UnitTest.Issues.TestProtos.TestJsonFieldOrdering.Parser, new[]{ "PlainInt32", "O1String", "O1Int32", "PlainString", "O2Int32", "O2String" }, new[]{ "O1", "O2" }, null, null), 61 new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.TestJsonName), global::UnitTest.Issues.TestProtos.TestJsonName.Parser, new[]{ "Name", "Description", "Guid" }, null, null, null) 62 })); 63 } 64 #endregion 65 66 } 67 #region Enums 68 public enum NegativeEnum { 69 [pbr::OriginalName("NEGATIVE_ENUM_ZERO")] Zero = 0, 70 [pbr::OriginalName("FiveBelow")] FiveBelow = -5, 71 [pbr::OriginalName("MinusOne")] MinusOne = -1, 72 } 73 74 public enum DeprecatedEnum { 75 [pbr::OriginalName("DEPRECATED_ZERO")] DeprecatedZero = 0, 76 [pbr::OriginalName("one")] One = 1, 77 } 78 79 #endregion 80 81 #region Messages 82 /// <summary> 83 /// Issue 307: when generating doubly-nested types, any references 84 /// should be of the form A.Types.B.Types.C. 85 /// </summary> 86 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 87 public sealed partial class Issue307 : pb::IMessage<Issue307> { 88 private static readonly pb::MessageParser<Issue307> _parser = new pb::MessageParser<Issue307>(() => new Issue307()); 89 public static pb::MessageParser<Issue307> Parser { get { return _parser; } } 90 91 public static pbr::MessageDescriptor Descriptor { 92 get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[0]; } 93 } 94 95 pbr::MessageDescriptor pb::IMessage.Descriptor { 96 get { return Descriptor; } 97 } 98 Issue307()99 public Issue307() { 100 OnConstruction(); 101 } 102 OnConstruction()103 partial void OnConstruction(); 104 Issue307(Issue307 other)105 public Issue307(Issue307 other) : this() { 106 } 107 Clone()108 public Issue307 Clone() { 109 return new Issue307(this); 110 } 111 Equals(object other)112 public override bool Equals(object other) { 113 return Equals(other as Issue307); 114 } 115 Equals(Issue307 other)116 public bool Equals(Issue307 other) { 117 if (ReferenceEquals(other, null)) { 118 return false; 119 } 120 if (ReferenceEquals(other, this)) { 121 return true; 122 } 123 return true; 124 } 125 GetHashCode()126 public override int GetHashCode() { 127 int hash = 1; 128 return hash; 129 } 130 ToString()131 public override string ToString() { 132 return pb::JsonFormatter.ToDiagnosticString(this); 133 } 134 WriteTo(pb::CodedOutputStream output)135 public void WriteTo(pb::CodedOutputStream output) { 136 } 137 CalculateSize()138 public int CalculateSize() { 139 int size = 0; 140 return size; 141 } 142 MergeFrom(Issue307 other)143 public void MergeFrom(Issue307 other) { 144 if (other == null) { 145 return; 146 } 147 } 148 MergeFrom(pb::CodedInputStream input)149 public void MergeFrom(pb::CodedInputStream input) { 150 uint tag; 151 while ((tag = input.ReadTag()) != 0) { 152 switch(tag) { 153 default: 154 input.SkipLastField(); 155 break; 156 } 157 } 158 } 159 160 #region Nested types 161 /// <summary>Container for nested types declared in the Issue307 message type.</summary> 162 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 163 public static partial class Types { 164 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 165 public sealed partial class NestedOnce : pb::IMessage<NestedOnce> { 166 private static readonly pb::MessageParser<NestedOnce> _parser = new pb::MessageParser<NestedOnce>(() => new NestedOnce()); 167 public static pb::MessageParser<NestedOnce> Parser { get { return _parser; } } 168 169 public static pbr::MessageDescriptor Descriptor { 170 get { return global::UnitTest.Issues.TestProtos.Issue307.Descriptor.NestedTypes[0]; } 171 } 172 173 pbr::MessageDescriptor pb::IMessage.Descriptor { 174 get { return Descriptor; } 175 } 176 NestedOnce()177 public NestedOnce() { 178 OnConstruction(); 179 } 180 OnConstruction()181 partial void OnConstruction(); 182 NestedOnce(NestedOnce other)183 public NestedOnce(NestedOnce other) : this() { 184 } 185 Clone()186 public NestedOnce Clone() { 187 return new NestedOnce(this); 188 } 189 Equals(object other)190 public override bool Equals(object other) { 191 return Equals(other as NestedOnce); 192 } 193 Equals(NestedOnce other)194 public bool Equals(NestedOnce other) { 195 if (ReferenceEquals(other, null)) { 196 return false; 197 } 198 if (ReferenceEquals(other, this)) { 199 return true; 200 } 201 return true; 202 } 203 GetHashCode()204 public override int GetHashCode() { 205 int hash = 1; 206 return hash; 207 } 208 ToString()209 public override string ToString() { 210 return pb::JsonFormatter.ToDiagnosticString(this); 211 } 212 WriteTo(pb::CodedOutputStream output)213 public void WriteTo(pb::CodedOutputStream output) { 214 } 215 CalculateSize()216 public int CalculateSize() { 217 int size = 0; 218 return size; 219 } 220 MergeFrom(NestedOnce other)221 public void MergeFrom(NestedOnce other) { 222 if (other == null) { 223 return; 224 } 225 } 226 MergeFrom(pb::CodedInputStream input)227 public void MergeFrom(pb::CodedInputStream input) { 228 uint tag; 229 while ((tag = input.ReadTag()) != 0) { 230 switch(tag) { 231 default: 232 input.SkipLastField(); 233 break; 234 } 235 } 236 } 237 238 #region Nested types 239 /// <summary>Container for nested types declared in the NestedOnce message type.</summary> 240 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 241 public static partial class Types { 242 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 243 public sealed partial class NestedTwice : pb::IMessage<NestedTwice> { 244 private static readonly pb::MessageParser<NestedTwice> _parser = new pb::MessageParser<NestedTwice>(() => new NestedTwice()); 245 public static pb::MessageParser<NestedTwice> Parser { get { return _parser; } } 246 247 public static pbr::MessageDescriptor Descriptor { 248 get { return global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce.Descriptor.NestedTypes[0]; } 249 } 250 251 pbr::MessageDescriptor pb::IMessage.Descriptor { 252 get { return Descriptor; } 253 } 254 NestedTwice()255 public NestedTwice() { 256 OnConstruction(); 257 } 258 OnConstruction()259 partial void OnConstruction(); 260 NestedTwice(NestedTwice other)261 public NestedTwice(NestedTwice other) : this() { 262 } 263 Clone()264 public NestedTwice Clone() { 265 return new NestedTwice(this); 266 } 267 Equals(object other)268 public override bool Equals(object other) { 269 return Equals(other as NestedTwice); 270 } 271 Equals(NestedTwice other)272 public bool Equals(NestedTwice other) { 273 if (ReferenceEquals(other, null)) { 274 return false; 275 } 276 if (ReferenceEquals(other, this)) { 277 return true; 278 } 279 return true; 280 } 281 GetHashCode()282 public override int GetHashCode() { 283 int hash = 1; 284 return hash; 285 } 286 ToString()287 public override string ToString() { 288 return pb::JsonFormatter.ToDiagnosticString(this); 289 } 290 WriteTo(pb::CodedOutputStream output)291 public void WriteTo(pb::CodedOutputStream output) { 292 } 293 CalculateSize()294 public int CalculateSize() { 295 int size = 0; 296 return size; 297 } 298 MergeFrom(NestedTwice other)299 public void MergeFrom(NestedTwice other) { 300 if (other == null) { 301 return; 302 } 303 } 304 MergeFrom(pb::CodedInputStream input)305 public void MergeFrom(pb::CodedInputStream input) { 306 uint tag; 307 while ((tag = input.ReadTag()) != 0) { 308 switch(tag) { 309 default: 310 input.SkipLastField(); 311 break; 312 } 313 } 314 } 315 316 } 317 318 } 319 #endregion 320 321 } 322 323 } 324 #endregion 325 326 } 327 328 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 329 public sealed partial class NegativeEnumMessage : pb::IMessage<NegativeEnumMessage> { 330 private static readonly pb::MessageParser<NegativeEnumMessage> _parser = new pb::MessageParser<NegativeEnumMessage>(() => new NegativeEnumMessage()); 331 public static pb::MessageParser<NegativeEnumMessage> Parser { get { return _parser; } } 332 333 public static pbr::MessageDescriptor Descriptor { 334 get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[1]; } 335 } 336 337 pbr::MessageDescriptor pb::IMessage.Descriptor { 338 get { return Descriptor; } 339 } 340 NegativeEnumMessage()341 public NegativeEnumMessage() { 342 OnConstruction(); 343 } 344 OnConstruction()345 partial void OnConstruction(); 346 NegativeEnumMessage(NegativeEnumMessage other)347 public NegativeEnumMessage(NegativeEnumMessage other) : this() { 348 value_ = other.value_; 349 values_ = other.values_.Clone(); 350 packedValues_ = other.packedValues_.Clone(); 351 } 352 Clone()353 public NegativeEnumMessage Clone() { 354 return new NegativeEnumMessage(this); 355 } 356 357 /// <summary>Field number for the "value" field.</summary> 358 public const int ValueFieldNumber = 1; 359 private global::UnitTest.Issues.TestProtos.NegativeEnum value_ = 0; 360 public global::UnitTest.Issues.TestProtos.NegativeEnum Value { 361 get { return value_; } 362 set { 363 value_ = value; 364 } 365 } 366 367 /// <summary>Field number for the "values" field.</summary> 368 public const int ValuesFieldNumber = 2; 369 private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.NegativeEnum> _repeated_values_codec 370 = pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::UnitTest.Issues.TestProtos.NegativeEnum) x); 371 private readonly pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum> values_ = new pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum>(); 372 public pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum> Values { 373 get { return values_; } 374 } 375 376 /// <summary>Field number for the "packed_values" field.</summary> 377 public const int PackedValuesFieldNumber = 3; 378 private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.NegativeEnum> _repeated_packedValues_codec 379 = pb::FieldCodec.ForEnum(26, x => (int) x, x => (global::UnitTest.Issues.TestProtos.NegativeEnum) x); 380 private readonly pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum> packedValues_ = new pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum>(); 381 public pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum> PackedValues { 382 get { return packedValues_; } 383 } 384 Equals(object other)385 public override bool Equals(object other) { 386 return Equals(other as NegativeEnumMessage); 387 } 388 Equals(NegativeEnumMessage other)389 public bool Equals(NegativeEnumMessage other) { 390 if (ReferenceEquals(other, null)) { 391 return false; 392 } 393 if (ReferenceEquals(other, this)) { 394 return true; 395 } 396 if (Value != other.Value) return false; 397 if(!values_.Equals(other.values_)) return false; 398 if(!packedValues_.Equals(other.packedValues_)) return false; 399 return true; 400 } 401 GetHashCode()402 public override int GetHashCode() { 403 int hash = 1; 404 if (Value != 0) hash ^= Value.GetHashCode(); 405 hash ^= values_.GetHashCode(); 406 hash ^= packedValues_.GetHashCode(); 407 return hash; 408 } 409 ToString()410 public override string ToString() { 411 return pb::JsonFormatter.ToDiagnosticString(this); 412 } 413 WriteTo(pb::CodedOutputStream output)414 public void WriteTo(pb::CodedOutputStream output) { 415 if (Value != 0) { 416 output.WriteRawTag(8); 417 output.WriteEnum((int) Value); 418 } 419 values_.WriteTo(output, _repeated_values_codec); 420 packedValues_.WriteTo(output, _repeated_packedValues_codec); 421 } 422 CalculateSize()423 public int CalculateSize() { 424 int size = 0; 425 if (Value != 0) { 426 size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Value); 427 } 428 size += values_.CalculateSize(_repeated_values_codec); 429 size += packedValues_.CalculateSize(_repeated_packedValues_codec); 430 return size; 431 } 432 MergeFrom(NegativeEnumMessage other)433 public void MergeFrom(NegativeEnumMessage other) { 434 if (other == null) { 435 return; 436 } 437 if (other.Value != 0) { 438 Value = other.Value; 439 } 440 values_.Add(other.values_); 441 packedValues_.Add(other.packedValues_); 442 } 443 MergeFrom(pb::CodedInputStream input)444 public void MergeFrom(pb::CodedInputStream input) { 445 uint tag; 446 while ((tag = input.ReadTag()) != 0) { 447 switch(tag) { 448 default: 449 input.SkipLastField(); 450 break; 451 case 8: { 452 value_ = (global::UnitTest.Issues.TestProtos.NegativeEnum) input.ReadEnum(); 453 break; 454 } 455 case 18: 456 case 16: { 457 values_.AddEntriesFrom(input, _repeated_values_codec); 458 break; 459 } 460 case 26: 461 case 24: { 462 packedValues_.AddEntriesFrom(input, _repeated_packedValues_codec); 463 break; 464 } 465 } 466 } 467 } 468 469 } 470 471 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 472 public sealed partial class DeprecatedChild : pb::IMessage<DeprecatedChild> { 473 private static readonly pb::MessageParser<DeprecatedChild> _parser = new pb::MessageParser<DeprecatedChild>(() => new DeprecatedChild()); 474 public static pb::MessageParser<DeprecatedChild> Parser { get { return _parser; } } 475 476 public static pbr::MessageDescriptor Descriptor { 477 get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[2]; } 478 } 479 480 pbr::MessageDescriptor pb::IMessage.Descriptor { 481 get { return Descriptor; } 482 } 483 DeprecatedChild()484 public DeprecatedChild() { 485 OnConstruction(); 486 } 487 OnConstruction()488 partial void OnConstruction(); 489 DeprecatedChild(DeprecatedChild other)490 public DeprecatedChild(DeprecatedChild other) : this() { 491 } 492 Clone()493 public DeprecatedChild Clone() { 494 return new DeprecatedChild(this); 495 } 496 Equals(object other)497 public override bool Equals(object other) { 498 return Equals(other as DeprecatedChild); 499 } 500 Equals(DeprecatedChild other)501 public bool Equals(DeprecatedChild other) { 502 if (ReferenceEquals(other, null)) { 503 return false; 504 } 505 if (ReferenceEquals(other, this)) { 506 return true; 507 } 508 return true; 509 } 510 GetHashCode()511 public override int GetHashCode() { 512 int hash = 1; 513 return hash; 514 } 515 ToString()516 public override string ToString() { 517 return pb::JsonFormatter.ToDiagnosticString(this); 518 } 519 WriteTo(pb::CodedOutputStream output)520 public void WriteTo(pb::CodedOutputStream output) { 521 } 522 CalculateSize()523 public int CalculateSize() { 524 int size = 0; 525 return size; 526 } 527 MergeFrom(DeprecatedChild other)528 public void MergeFrom(DeprecatedChild other) { 529 if (other == null) { 530 return; 531 } 532 } 533 MergeFrom(pb::CodedInputStream input)534 public void MergeFrom(pb::CodedInputStream input) { 535 uint tag; 536 while ((tag = input.ReadTag()) != 0) { 537 switch(tag) { 538 default: 539 input.SkipLastField(); 540 break; 541 } 542 } 543 } 544 545 } 546 547 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 548 public sealed partial class DeprecatedFieldsMessage : pb::IMessage<DeprecatedFieldsMessage> { 549 private static readonly pb::MessageParser<DeprecatedFieldsMessage> _parser = new pb::MessageParser<DeprecatedFieldsMessage>(() => new DeprecatedFieldsMessage()); 550 public static pb::MessageParser<DeprecatedFieldsMessage> Parser { get { return _parser; } } 551 552 public static pbr::MessageDescriptor Descriptor { 553 get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[3]; } 554 } 555 556 pbr::MessageDescriptor pb::IMessage.Descriptor { 557 get { return Descriptor; } 558 } 559 DeprecatedFieldsMessage()560 public DeprecatedFieldsMessage() { 561 OnConstruction(); 562 } 563 OnConstruction()564 partial void OnConstruction(); 565 DeprecatedFieldsMessage(DeprecatedFieldsMessage other)566 public DeprecatedFieldsMessage(DeprecatedFieldsMessage other) : this() { 567 primitiveValue_ = other.primitiveValue_; 568 primitiveArray_ = other.primitiveArray_.Clone(); 569 MessageValue = other.messageValue_ != null ? other.MessageValue.Clone() : null; 570 messageArray_ = other.messageArray_.Clone(); 571 enumValue_ = other.enumValue_; 572 enumArray_ = other.enumArray_.Clone(); 573 } 574 Clone()575 public DeprecatedFieldsMessage Clone() { 576 return new DeprecatedFieldsMessage(this); 577 } 578 579 /// <summary>Field number for the "PrimitiveValue" field.</summary> 580 public const int PrimitiveValueFieldNumber = 1; 581 private int primitiveValue_; 582 [global::System.ObsoleteAttribute()] 583 public int PrimitiveValue { 584 get { return primitiveValue_; } 585 set { 586 primitiveValue_ = value; 587 } 588 } 589 590 /// <summary>Field number for the "PrimitiveArray" field.</summary> 591 public const int PrimitiveArrayFieldNumber = 2; 592 private static readonly pb::FieldCodec<int> _repeated_primitiveArray_codec 593 = pb::FieldCodec.ForInt32(18); 594 private readonly pbc::RepeatedField<int> primitiveArray_ = new pbc::RepeatedField<int>(); 595 [global::System.ObsoleteAttribute()] 596 public pbc::RepeatedField<int> PrimitiveArray { 597 get { return primitiveArray_; } 598 } 599 600 /// <summary>Field number for the "MessageValue" field.</summary> 601 public const int MessageValueFieldNumber = 3; 602 private global::UnitTest.Issues.TestProtos.DeprecatedChild messageValue_; 603 [global::System.ObsoleteAttribute()] 604 public global::UnitTest.Issues.TestProtos.DeprecatedChild MessageValue { 605 get { return messageValue_; } 606 set { 607 messageValue_ = value; 608 } 609 } 610 611 /// <summary>Field number for the "MessageArray" field.</summary> 612 public const int MessageArrayFieldNumber = 4; 613 private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.DeprecatedChild> _repeated_messageArray_codec 614 = pb::FieldCodec.ForMessage(34, global::UnitTest.Issues.TestProtos.DeprecatedChild.Parser); 615 private readonly pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedChild> messageArray_ = new pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedChild>(); 616 [global::System.ObsoleteAttribute()] 617 public pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedChild> MessageArray { 618 get { return messageArray_; } 619 } 620 621 /// <summary>Field number for the "EnumValue" field.</summary> 622 public const int EnumValueFieldNumber = 5; 623 private global::UnitTest.Issues.TestProtos.DeprecatedEnum enumValue_ = 0; 624 [global::System.ObsoleteAttribute()] 625 public global::UnitTest.Issues.TestProtos.DeprecatedEnum EnumValue { 626 get { return enumValue_; } 627 set { 628 enumValue_ = value; 629 } 630 } 631 632 /// <summary>Field number for the "EnumArray" field.</summary> 633 public const int EnumArrayFieldNumber = 6; 634 private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.DeprecatedEnum> _repeated_enumArray_codec 635 = pb::FieldCodec.ForEnum(50, x => (int) x, x => (global::UnitTest.Issues.TestProtos.DeprecatedEnum) x); 636 private readonly pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedEnum> enumArray_ = new pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedEnum>(); 637 [global::System.ObsoleteAttribute()] 638 public pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedEnum> EnumArray { 639 get { return enumArray_; } 640 } 641 Equals(object other)642 public override bool Equals(object other) { 643 return Equals(other as DeprecatedFieldsMessage); 644 } 645 Equals(DeprecatedFieldsMessage other)646 public bool Equals(DeprecatedFieldsMessage other) { 647 if (ReferenceEquals(other, null)) { 648 return false; 649 } 650 if (ReferenceEquals(other, this)) { 651 return true; 652 } 653 if (PrimitiveValue != other.PrimitiveValue) return false; 654 if(!primitiveArray_.Equals(other.primitiveArray_)) return false; 655 if (!object.Equals(MessageValue, other.MessageValue)) return false; 656 if(!messageArray_.Equals(other.messageArray_)) return false; 657 if (EnumValue != other.EnumValue) return false; 658 if(!enumArray_.Equals(other.enumArray_)) return false; 659 return true; 660 } 661 GetHashCode()662 public override int GetHashCode() { 663 int hash = 1; 664 if (PrimitiveValue != 0) hash ^= PrimitiveValue.GetHashCode(); 665 hash ^= primitiveArray_.GetHashCode(); 666 if (messageValue_ != null) hash ^= MessageValue.GetHashCode(); 667 hash ^= messageArray_.GetHashCode(); 668 if (EnumValue != 0) hash ^= EnumValue.GetHashCode(); 669 hash ^= enumArray_.GetHashCode(); 670 return hash; 671 } 672 ToString()673 public override string ToString() { 674 return pb::JsonFormatter.ToDiagnosticString(this); 675 } 676 WriteTo(pb::CodedOutputStream output)677 public void WriteTo(pb::CodedOutputStream output) { 678 if (PrimitiveValue != 0) { 679 output.WriteRawTag(8); 680 output.WriteInt32(PrimitiveValue); 681 } 682 primitiveArray_.WriteTo(output, _repeated_primitiveArray_codec); 683 if (messageValue_ != null) { 684 output.WriteRawTag(26); 685 output.WriteMessage(MessageValue); 686 } 687 messageArray_.WriteTo(output, _repeated_messageArray_codec); 688 if (EnumValue != 0) { 689 output.WriteRawTag(40); 690 output.WriteEnum((int) EnumValue); 691 } 692 enumArray_.WriteTo(output, _repeated_enumArray_codec); 693 } 694 CalculateSize()695 public int CalculateSize() { 696 int size = 0; 697 if (PrimitiveValue != 0) { 698 size += 1 + pb::CodedOutputStream.ComputeInt32Size(PrimitiveValue); 699 } 700 size += primitiveArray_.CalculateSize(_repeated_primitiveArray_codec); 701 if (messageValue_ != null) { 702 size += 1 + pb::CodedOutputStream.ComputeMessageSize(MessageValue); 703 } 704 size += messageArray_.CalculateSize(_repeated_messageArray_codec); 705 if (EnumValue != 0) { 706 size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) EnumValue); 707 } 708 size += enumArray_.CalculateSize(_repeated_enumArray_codec); 709 return size; 710 } 711 MergeFrom(DeprecatedFieldsMessage other)712 public void MergeFrom(DeprecatedFieldsMessage other) { 713 if (other == null) { 714 return; 715 } 716 if (other.PrimitiveValue != 0) { 717 PrimitiveValue = other.PrimitiveValue; 718 } 719 primitiveArray_.Add(other.primitiveArray_); 720 if (other.messageValue_ != null) { 721 if (messageValue_ == null) { 722 messageValue_ = new global::UnitTest.Issues.TestProtos.DeprecatedChild(); 723 } 724 MessageValue.MergeFrom(other.MessageValue); 725 } 726 messageArray_.Add(other.messageArray_); 727 if (other.EnumValue != 0) { 728 EnumValue = other.EnumValue; 729 } 730 enumArray_.Add(other.enumArray_); 731 } 732 MergeFrom(pb::CodedInputStream input)733 public void MergeFrom(pb::CodedInputStream input) { 734 uint tag; 735 while ((tag = input.ReadTag()) != 0) { 736 switch(tag) { 737 default: 738 input.SkipLastField(); 739 break; 740 case 8: { 741 PrimitiveValue = input.ReadInt32(); 742 break; 743 } 744 case 18: 745 case 16: { 746 primitiveArray_.AddEntriesFrom(input, _repeated_primitiveArray_codec); 747 break; 748 } 749 case 26: { 750 if (messageValue_ == null) { 751 messageValue_ = new global::UnitTest.Issues.TestProtos.DeprecatedChild(); 752 } 753 input.ReadMessage(messageValue_); 754 break; 755 } 756 case 34: { 757 messageArray_.AddEntriesFrom(input, _repeated_messageArray_codec); 758 break; 759 } 760 case 40: { 761 enumValue_ = (global::UnitTest.Issues.TestProtos.DeprecatedEnum) input.ReadEnum(); 762 break; 763 } 764 case 50: 765 case 48: { 766 enumArray_.AddEntriesFrom(input, _repeated_enumArray_codec); 767 break; 768 } 769 } 770 } 771 } 772 773 } 774 775 /// <summary> 776 /// Issue 45: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=45 777 /// </summary> 778 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 779 public sealed partial class ItemField : pb::IMessage<ItemField> { 780 private static readonly pb::MessageParser<ItemField> _parser = new pb::MessageParser<ItemField>(() => new ItemField()); 781 public static pb::MessageParser<ItemField> Parser { get { return _parser; } } 782 783 public static pbr::MessageDescriptor Descriptor { 784 get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[4]; } 785 } 786 787 pbr::MessageDescriptor pb::IMessage.Descriptor { 788 get { return Descriptor; } 789 } 790 ItemField()791 public ItemField() { 792 OnConstruction(); 793 } 794 OnConstruction()795 partial void OnConstruction(); 796 ItemField(ItemField other)797 public ItemField(ItemField other) : this() { 798 item_ = other.item_; 799 } 800 Clone()801 public ItemField Clone() { 802 return new ItemField(this); 803 } 804 805 /// <summary>Field number for the "item" field.</summary> 806 public const int ItemFieldNumber = 1; 807 private int item_; 808 public int Item { 809 get { return item_; } 810 set { 811 item_ = value; 812 } 813 } 814 Equals(object other)815 public override bool Equals(object other) { 816 return Equals(other as ItemField); 817 } 818 Equals(ItemField other)819 public bool Equals(ItemField other) { 820 if (ReferenceEquals(other, null)) { 821 return false; 822 } 823 if (ReferenceEquals(other, this)) { 824 return true; 825 } 826 if (Item != other.Item) return false; 827 return true; 828 } 829 GetHashCode()830 public override int GetHashCode() { 831 int hash = 1; 832 if (Item != 0) hash ^= Item.GetHashCode(); 833 return hash; 834 } 835 ToString()836 public override string ToString() { 837 return pb::JsonFormatter.ToDiagnosticString(this); 838 } 839 WriteTo(pb::CodedOutputStream output)840 public void WriteTo(pb::CodedOutputStream output) { 841 if (Item != 0) { 842 output.WriteRawTag(8); 843 output.WriteInt32(Item); 844 } 845 } 846 CalculateSize()847 public int CalculateSize() { 848 int size = 0; 849 if (Item != 0) { 850 size += 1 + pb::CodedOutputStream.ComputeInt32Size(Item); 851 } 852 return size; 853 } 854 MergeFrom(ItemField other)855 public void MergeFrom(ItemField other) { 856 if (other == null) { 857 return; 858 } 859 if (other.Item != 0) { 860 Item = other.Item; 861 } 862 } 863 MergeFrom(pb::CodedInputStream input)864 public void MergeFrom(pb::CodedInputStream input) { 865 uint tag; 866 while ((tag = input.ReadTag()) != 0) { 867 switch(tag) { 868 default: 869 input.SkipLastField(); 870 break; 871 case 8: { 872 Item = input.ReadInt32(); 873 break; 874 } 875 } 876 } 877 } 878 879 } 880 881 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 882 public sealed partial class ReservedNames : pb::IMessage<ReservedNames> { 883 private static readonly pb::MessageParser<ReservedNames> _parser = new pb::MessageParser<ReservedNames>(() => new ReservedNames()); 884 public static pb::MessageParser<ReservedNames> Parser { get { return _parser; } } 885 886 public static pbr::MessageDescriptor Descriptor { 887 get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[5]; } 888 } 889 890 pbr::MessageDescriptor pb::IMessage.Descriptor { 891 get { return Descriptor; } 892 } 893 ReservedNames()894 public ReservedNames() { 895 OnConstruction(); 896 } 897 OnConstruction()898 partial void OnConstruction(); 899 ReservedNames(ReservedNames other)900 public ReservedNames(ReservedNames other) : this() { 901 types_ = other.types_; 902 descriptor_ = other.descriptor_; 903 } 904 Clone()905 public ReservedNames Clone() { 906 return new ReservedNames(this); 907 } 908 909 /// <summary>Field number for the "types" field.</summary> 910 public const int Types_FieldNumber = 1; 911 private int types_; 912 public int Types_ { 913 get { return types_; } 914 set { 915 types_ = value; 916 } 917 } 918 919 /// <summary>Field number for the "descriptor" field.</summary> 920 public const int Descriptor_FieldNumber = 2; 921 private int descriptor_; 922 public int Descriptor_ { 923 get { return descriptor_; } 924 set { 925 descriptor_ = value; 926 } 927 } 928 Equals(object other)929 public override bool Equals(object other) { 930 return Equals(other as ReservedNames); 931 } 932 Equals(ReservedNames other)933 public bool Equals(ReservedNames other) { 934 if (ReferenceEquals(other, null)) { 935 return false; 936 } 937 if (ReferenceEquals(other, this)) { 938 return true; 939 } 940 if (Types_ != other.Types_) return false; 941 if (Descriptor_ != other.Descriptor_) return false; 942 return true; 943 } 944 GetHashCode()945 public override int GetHashCode() { 946 int hash = 1; 947 if (Types_ != 0) hash ^= Types_.GetHashCode(); 948 if (Descriptor_ != 0) hash ^= Descriptor_.GetHashCode(); 949 return hash; 950 } 951 ToString()952 public override string ToString() { 953 return pb::JsonFormatter.ToDiagnosticString(this); 954 } 955 WriteTo(pb::CodedOutputStream output)956 public void WriteTo(pb::CodedOutputStream output) { 957 if (Types_ != 0) { 958 output.WriteRawTag(8); 959 output.WriteInt32(Types_); 960 } 961 if (Descriptor_ != 0) { 962 output.WriteRawTag(16); 963 output.WriteInt32(Descriptor_); 964 } 965 } 966 CalculateSize()967 public int CalculateSize() { 968 int size = 0; 969 if (Types_ != 0) { 970 size += 1 + pb::CodedOutputStream.ComputeInt32Size(Types_); 971 } 972 if (Descriptor_ != 0) { 973 size += 1 + pb::CodedOutputStream.ComputeInt32Size(Descriptor_); 974 } 975 return size; 976 } 977 MergeFrom(ReservedNames other)978 public void MergeFrom(ReservedNames other) { 979 if (other == null) { 980 return; 981 } 982 if (other.Types_ != 0) { 983 Types_ = other.Types_; 984 } 985 if (other.Descriptor_ != 0) { 986 Descriptor_ = other.Descriptor_; 987 } 988 } 989 MergeFrom(pb::CodedInputStream input)990 public void MergeFrom(pb::CodedInputStream input) { 991 uint tag; 992 while ((tag = input.ReadTag()) != 0) { 993 switch(tag) { 994 default: 995 input.SkipLastField(); 996 break; 997 case 8: { 998 Types_ = input.ReadInt32(); 999 break; 1000 } 1001 case 16: { 1002 Descriptor_ = input.ReadInt32(); 1003 break; 1004 } 1005 } 1006 } 1007 } 1008 1009 #region Nested types 1010 /// <summary>Container for nested types declared in the ReservedNames message type.</summary> 1011 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 1012 public static partial class Types { 1013 /// <summary> 1014 /// Force a nested type called Types 1015 /// </summary> 1016 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 1017 public sealed partial class SomeNestedType : pb::IMessage<SomeNestedType> { 1018 private static readonly pb::MessageParser<SomeNestedType> _parser = new pb::MessageParser<SomeNestedType>(() => new SomeNestedType()); 1019 public static pb::MessageParser<SomeNestedType> Parser { get { return _parser; } } 1020 1021 public static pbr::MessageDescriptor Descriptor { 1022 get { return global::UnitTest.Issues.TestProtos.ReservedNames.Descriptor.NestedTypes[0]; } 1023 } 1024 1025 pbr::MessageDescriptor pb::IMessage.Descriptor { 1026 get { return Descriptor; } 1027 } 1028 SomeNestedType()1029 public SomeNestedType() { 1030 OnConstruction(); 1031 } 1032 OnConstruction()1033 partial void OnConstruction(); 1034 SomeNestedType(SomeNestedType other)1035 public SomeNestedType(SomeNestedType other) : this() { 1036 } 1037 Clone()1038 public SomeNestedType Clone() { 1039 return new SomeNestedType(this); 1040 } 1041 Equals(object other)1042 public override bool Equals(object other) { 1043 return Equals(other as SomeNestedType); 1044 } 1045 Equals(SomeNestedType other)1046 public bool Equals(SomeNestedType other) { 1047 if (ReferenceEquals(other, null)) { 1048 return false; 1049 } 1050 if (ReferenceEquals(other, this)) { 1051 return true; 1052 } 1053 return true; 1054 } 1055 GetHashCode()1056 public override int GetHashCode() { 1057 int hash = 1; 1058 return hash; 1059 } 1060 ToString()1061 public override string ToString() { 1062 return pb::JsonFormatter.ToDiagnosticString(this); 1063 } 1064 WriteTo(pb::CodedOutputStream output)1065 public void WriteTo(pb::CodedOutputStream output) { 1066 } 1067 CalculateSize()1068 public int CalculateSize() { 1069 int size = 0; 1070 return size; 1071 } 1072 MergeFrom(SomeNestedType other)1073 public void MergeFrom(SomeNestedType other) { 1074 if (other == null) { 1075 return; 1076 } 1077 } 1078 MergeFrom(pb::CodedInputStream input)1079 public void MergeFrom(pb::CodedInputStream input) { 1080 uint tag; 1081 while ((tag = input.ReadTag()) != 0) { 1082 switch(tag) { 1083 default: 1084 input.SkipLastField(); 1085 break; 1086 } 1087 } 1088 } 1089 1090 } 1091 1092 } 1093 #endregion 1094 1095 } 1096 1097 /// <summary> 1098 /// These fields are deliberately not declared in numeric 1099 /// order, and the oneof fields aren't contiguous either. 1100 /// This allows for reasonably robust tests of JSON output 1101 /// ordering. 1102 /// TestFieldOrderings in unittest_proto3.proto is similar, 1103 /// but doesn't include oneofs. 1104 /// TODO: Consider adding oneofs to TestFieldOrderings, although 1105 /// that will require fixing other tests in multiple platforms. 1106 /// Alternatively, consider just adding this to 1107 /// unittest_proto3.proto if multiple platforms want it. 1108 /// </summary> 1109 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 1110 public sealed partial class TestJsonFieldOrdering : pb::IMessage<TestJsonFieldOrdering> { 1111 private static readonly pb::MessageParser<TestJsonFieldOrdering> _parser = new pb::MessageParser<TestJsonFieldOrdering>(() => new TestJsonFieldOrdering()); 1112 public static pb::MessageParser<TestJsonFieldOrdering> Parser { get { return _parser; } } 1113 1114 public static pbr::MessageDescriptor Descriptor { 1115 get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[6]; } 1116 } 1117 1118 pbr::MessageDescriptor pb::IMessage.Descriptor { 1119 get { return Descriptor; } 1120 } 1121 TestJsonFieldOrdering()1122 public TestJsonFieldOrdering() { 1123 OnConstruction(); 1124 } 1125 OnConstruction()1126 partial void OnConstruction(); 1127 TestJsonFieldOrdering(TestJsonFieldOrdering other)1128 public TestJsonFieldOrdering(TestJsonFieldOrdering other) : this() { 1129 plainInt32_ = other.plainInt32_; 1130 plainString_ = other.plainString_; 1131 switch (other.O1Case) { 1132 case O1OneofCase.O1String: 1133 O1String = other.O1String; 1134 break; 1135 case O1OneofCase.O1Int32: 1136 O1Int32 = other.O1Int32; 1137 break; 1138 } 1139 1140 switch (other.O2Case) { 1141 case O2OneofCase.O2Int32: 1142 O2Int32 = other.O2Int32; 1143 break; 1144 case O2OneofCase.O2String: 1145 O2String = other.O2String; 1146 break; 1147 } 1148 1149 } 1150 Clone()1151 public TestJsonFieldOrdering Clone() { 1152 return new TestJsonFieldOrdering(this); 1153 } 1154 1155 /// <summary>Field number for the "plain_int32" field.</summary> 1156 public const int PlainInt32FieldNumber = 4; 1157 private int plainInt32_; 1158 public int PlainInt32 { 1159 get { return plainInt32_; } 1160 set { 1161 plainInt32_ = value; 1162 } 1163 } 1164 1165 /// <summary>Field number for the "o1_string" field.</summary> 1166 public const int O1StringFieldNumber = 2; 1167 public string O1String { 1168 get { return o1Case_ == O1OneofCase.O1String ? (string) o1_ : ""; } 1169 set { 1170 o1_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 1171 o1Case_ = O1OneofCase.O1String; 1172 } 1173 } 1174 1175 /// <summary>Field number for the "o1_int32" field.</summary> 1176 public const int O1Int32FieldNumber = 5; 1177 public int O1Int32 { 1178 get { return o1Case_ == O1OneofCase.O1Int32 ? (int) o1_ : 0; } 1179 set { 1180 o1_ = value; 1181 o1Case_ = O1OneofCase.O1Int32; 1182 } 1183 } 1184 1185 /// <summary>Field number for the "plain_string" field.</summary> 1186 public const int PlainStringFieldNumber = 1; 1187 private string plainString_ = ""; 1188 public string PlainString { 1189 get { return plainString_; } 1190 set { 1191 plainString_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 1192 } 1193 } 1194 1195 /// <summary>Field number for the "o2_int32" field.</summary> 1196 public const int O2Int32FieldNumber = 6; 1197 public int O2Int32 { 1198 get { return o2Case_ == O2OneofCase.O2Int32 ? (int) o2_ : 0; } 1199 set { 1200 o2_ = value; 1201 o2Case_ = O2OneofCase.O2Int32; 1202 } 1203 } 1204 1205 /// <summary>Field number for the "o2_string" field.</summary> 1206 public const int O2StringFieldNumber = 3; 1207 public string O2String { 1208 get { return o2Case_ == O2OneofCase.O2String ? (string) o2_ : ""; } 1209 set { 1210 o2_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 1211 o2Case_ = O2OneofCase.O2String; 1212 } 1213 } 1214 1215 private object o1_; 1216 /// <summary>Enum of possible cases for the "o1" oneof.</summary> 1217 public enum O1OneofCase { 1218 None = 0, 1219 O1String = 2, 1220 O1Int32 = 5, 1221 } 1222 private O1OneofCase o1Case_ = O1OneofCase.None; 1223 public O1OneofCase O1Case { 1224 get { return o1Case_; } 1225 } 1226 ClearO1()1227 public void ClearO1() { 1228 o1Case_ = O1OneofCase.None; 1229 o1_ = null; 1230 } 1231 1232 private object o2_; 1233 /// <summary>Enum of possible cases for the "o2" oneof.</summary> 1234 public enum O2OneofCase { 1235 None = 0, 1236 O2Int32 = 6, 1237 O2String = 3, 1238 } 1239 private O2OneofCase o2Case_ = O2OneofCase.None; 1240 public O2OneofCase O2Case { 1241 get { return o2Case_; } 1242 } 1243 ClearO2()1244 public void ClearO2() { 1245 o2Case_ = O2OneofCase.None; 1246 o2_ = null; 1247 } 1248 Equals(object other)1249 public override bool Equals(object other) { 1250 return Equals(other as TestJsonFieldOrdering); 1251 } 1252 Equals(TestJsonFieldOrdering other)1253 public bool Equals(TestJsonFieldOrdering other) { 1254 if (ReferenceEquals(other, null)) { 1255 return false; 1256 } 1257 if (ReferenceEquals(other, this)) { 1258 return true; 1259 } 1260 if (PlainInt32 != other.PlainInt32) return false; 1261 if (O1String != other.O1String) return false; 1262 if (O1Int32 != other.O1Int32) return false; 1263 if (PlainString != other.PlainString) return false; 1264 if (O2Int32 != other.O2Int32) return false; 1265 if (O2String != other.O2String) return false; 1266 if (O1Case != other.O1Case) return false; 1267 if (O2Case != other.O2Case) return false; 1268 return true; 1269 } 1270 GetHashCode()1271 public override int GetHashCode() { 1272 int hash = 1; 1273 if (PlainInt32 != 0) hash ^= PlainInt32.GetHashCode(); 1274 if (o1Case_ == O1OneofCase.O1String) hash ^= O1String.GetHashCode(); 1275 if (o1Case_ == O1OneofCase.O1Int32) hash ^= O1Int32.GetHashCode(); 1276 if (PlainString.Length != 0) hash ^= PlainString.GetHashCode(); 1277 if (o2Case_ == O2OneofCase.O2Int32) hash ^= O2Int32.GetHashCode(); 1278 if (o2Case_ == O2OneofCase.O2String) hash ^= O2String.GetHashCode(); 1279 hash ^= (int) o1Case_; 1280 hash ^= (int) o2Case_; 1281 return hash; 1282 } 1283 ToString()1284 public override string ToString() { 1285 return pb::JsonFormatter.ToDiagnosticString(this); 1286 } 1287 WriteTo(pb::CodedOutputStream output)1288 public void WriteTo(pb::CodedOutputStream output) { 1289 if (PlainString.Length != 0) { 1290 output.WriteRawTag(10); 1291 output.WriteString(PlainString); 1292 } 1293 if (o1Case_ == O1OneofCase.O1String) { 1294 output.WriteRawTag(18); 1295 output.WriteString(O1String); 1296 } 1297 if (o2Case_ == O2OneofCase.O2String) { 1298 output.WriteRawTag(26); 1299 output.WriteString(O2String); 1300 } 1301 if (PlainInt32 != 0) { 1302 output.WriteRawTag(32); 1303 output.WriteInt32(PlainInt32); 1304 } 1305 if (o1Case_ == O1OneofCase.O1Int32) { 1306 output.WriteRawTag(40); 1307 output.WriteInt32(O1Int32); 1308 } 1309 if (o2Case_ == O2OneofCase.O2Int32) { 1310 output.WriteRawTag(48); 1311 output.WriteInt32(O2Int32); 1312 } 1313 } 1314 CalculateSize()1315 public int CalculateSize() { 1316 int size = 0; 1317 if (PlainInt32 != 0) { 1318 size += 1 + pb::CodedOutputStream.ComputeInt32Size(PlainInt32); 1319 } 1320 if (o1Case_ == O1OneofCase.O1String) { 1321 size += 1 + pb::CodedOutputStream.ComputeStringSize(O1String); 1322 } 1323 if (o1Case_ == O1OneofCase.O1Int32) { 1324 size += 1 + pb::CodedOutputStream.ComputeInt32Size(O1Int32); 1325 } 1326 if (PlainString.Length != 0) { 1327 size += 1 + pb::CodedOutputStream.ComputeStringSize(PlainString); 1328 } 1329 if (o2Case_ == O2OneofCase.O2Int32) { 1330 size += 1 + pb::CodedOutputStream.ComputeInt32Size(O2Int32); 1331 } 1332 if (o2Case_ == O2OneofCase.O2String) { 1333 size += 1 + pb::CodedOutputStream.ComputeStringSize(O2String); 1334 } 1335 return size; 1336 } 1337 MergeFrom(TestJsonFieldOrdering other)1338 public void MergeFrom(TestJsonFieldOrdering other) { 1339 if (other == null) { 1340 return; 1341 } 1342 if (other.PlainInt32 != 0) { 1343 PlainInt32 = other.PlainInt32; 1344 } 1345 if (other.PlainString.Length != 0) { 1346 PlainString = other.PlainString; 1347 } 1348 switch (other.O1Case) { 1349 case O1OneofCase.O1String: 1350 O1String = other.O1String; 1351 break; 1352 case O1OneofCase.O1Int32: 1353 O1Int32 = other.O1Int32; 1354 break; 1355 } 1356 1357 switch (other.O2Case) { 1358 case O2OneofCase.O2Int32: 1359 O2Int32 = other.O2Int32; 1360 break; 1361 case O2OneofCase.O2String: 1362 O2String = other.O2String; 1363 break; 1364 } 1365 1366 } 1367 MergeFrom(pb::CodedInputStream input)1368 public void MergeFrom(pb::CodedInputStream input) { 1369 uint tag; 1370 while ((tag = input.ReadTag()) != 0) { 1371 switch(tag) { 1372 default: 1373 input.SkipLastField(); 1374 break; 1375 case 10: { 1376 PlainString = input.ReadString(); 1377 break; 1378 } 1379 case 18: { 1380 O1String = input.ReadString(); 1381 break; 1382 } 1383 case 26: { 1384 O2String = input.ReadString(); 1385 break; 1386 } 1387 case 32: { 1388 PlainInt32 = input.ReadInt32(); 1389 break; 1390 } 1391 case 40: { 1392 O1Int32 = input.ReadInt32(); 1393 break; 1394 } 1395 case 48: { 1396 O2Int32 = input.ReadInt32(); 1397 break; 1398 } 1399 } 1400 } 1401 } 1402 1403 } 1404 1405 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 1406 public sealed partial class TestJsonName : pb::IMessage<TestJsonName> { 1407 private static readonly pb::MessageParser<TestJsonName> _parser = new pb::MessageParser<TestJsonName>(() => new TestJsonName()); 1408 public static pb::MessageParser<TestJsonName> Parser { get { return _parser; } } 1409 1410 public static pbr::MessageDescriptor Descriptor { 1411 get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[7]; } 1412 } 1413 1414 pbr::MessageDescriptor pb::IMessage.Descriptor { 1415 get { return Descriptor; } 1416 } 1417 TestJsonName()1418 public TestJsonName() { 1419 OnConstruction(); 1420 } 1421 OnConstruction()1422 partial void OnConstruction(); 1423 TestJsonName(TestJsonName other)1424 public TestJsonName(TestJsonName other) : this() { 1425 name_ = other.name_; 1426 description_ = other.description_; 1427 guid_ = other.guid_; 1428 } 1429 Clone()1430 public TestJsonName Clone() { 1431 return new TestJsonName(this); 1432 } 1433 1434 /// <summary>Field number for the "name" field.</summary> 1435 public const int NameFieldNumber = 1; 1436 private string name_ = ""; 1437 /// <summary> 1438 /// Message for testing the effects for of the json_name option 1439 /// </summary> 1440 public string Name { 1441 get { return name_; } 1442 set { 1443 name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 1444 } 1445 } 1446 1447 /// <summary>Field number for the "description" field.</summary> 1448 public const int DescriptionFieldNumber = 2; 1449 private string description_ = ""; 1450 public string Description { 1451 get { return description_; } 1452 set { 1453 description_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 1454 } 1455 } 1456 1457 /// <summary>Field number for the "guid" field.</summary> 1458 public const int GuidFieldNumber = 3; 1459 private string guid_ = ""; 1460 public string Guid { 1461 get { return guid_; } 1462 set { 1463 guid_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 1464 } 1465 } 1466 Equals(object other)1467 public override bool Equals(object other) { 1468 return Equals(other as TestJsonName); 1469 } 1470 Equals(TestJsonName other)1471 public bool Equals(TestJsonName other) { 1472 if (ReferenceEquals(other, null)) { 1473 return false; 1474 } 1475 if (ReferenceEquals(other, this)) { 1476 return true; 1477 } 1478 if (Name != other.Name) return false; 1479 if (Description != other.Description) return false; 1480 if (Guid != other.Guid) return false; 1481 return true; 1482 } 1483 GetHashCode()1484 public override int GetHashCode() { 1485 int hash = 1; 1486 if (Name.Length != 0) hash ^= Name.GetHashCode(); 1487 if (Description.Length != 0) hash ^= Description.GetHashCode(); 1488 if (Guid.Length != 0) hash ^= Guid.GetHashCode(); 1489 return hash; 1490 } 1491 ToString()1492 public override string ToString() { 1493 return pb::JsonFormatter.ToDiagnosticString(this); 1494 } 1495 WriteTo(pb::CodedOutputStream output)1496 public void WriteTo(pb::CodedOutputStream output) { 1497 if (Name.Length != 0) { 1498 output.WriteRawTag(10); 1499 output.WriteString(Name); 1500 } 1501 if (Description.Length != 0) { 1502 output.WriteRawTag(18); 1503 output.WriteString(Description); 1504 } 1505 if (Guid.Length != 0) { 1506 output.WriteRawTag(26); 1507 output.WriteString(Guid); 1508 } 1509 } 1510 CalculateSize()1511 public int CalculateSize() { 1512 int size = 0; 1513 if (Name.Length != 0) { 1514 size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); 1515 } 1516 if (Description.Length != 0) { 1517 size += 1 + pb::CodedOutputStream.ComputeStringSize(Description); 1518 } 1519 if (Guid.Length != 0) { 1520 size += 1 + pb::CodedOutputStream.ComputeStringSize(Guid); 1521 } 1522 return size; 1523 } 1524 MergeFrom(TestJsonName other)1525 public void MergeFrom(TestJsonName other) { 1526 if (other == null) { 1527 return; 1528 } 1529 if (other.Name.Length != 0) { 1530 Name = other.Name; 1531 } 1532 if (other.Description.Length != 0) { 1533 Description = other.Description; 1534 } 1535 if (other.Guid.Length != 0) { 1536 Guid = other.Guid; 1537 } 1538 } 1539 MergeFrom(pb::CodedInputStream input)1540 public void MergeFrom(pb::CodedInputStream input) { 1541 uint tag; 1542 while ((tag = input.ReadTag()) != 0) { 1543 switch(tag) { 1544 default: 1545 input.SkipLastField(); 1546 break; 1547 case 10: { 1548 Name = input.ReadString(); 1549 break; 1550 } 1551 case 18: { 1552 Description = input.ReadString(); 1553 break; 1554 } 1555 case 26: { 1556 Guid = input.ReadString(); 1557 break; 1558 } 1559 } 1560 } 1561 } 1562 1563 } 1564 1565 #endregion 1566 1567 } 1568 1569 #endregion Designer generated code 1570