OLD | NEW |
1 // Generated by the protocol buffer compiler. DO NOT EDIT! | 1 // Generated by the protocol buffer compiler. DO NOT EDIT! |
2 // source: unittest_issues.proto | 2 // source: unittest_issues.proto |
3 #pragma warning disable 1591, 0612, 3021 | 3 #pragma warning disable 1591, 0612, 3021 |
4 #region Designer generated code | 4 #region Designer generated code |
5 | 5 |
6 using pb = global::Google.Protobuf; | 6 using pb = global::Google.Protobuf; |
7 using pbc = global::Google.Protobuf.Collections; | 7 using pbc = global::Google.Protobuf.Collections; |
8 using pbr = global::Google.Protobuf.Reflection; | 8 using pbr = global::Google.Protobuf.Reflection; |
9 using scg = global::System.Collections.Generic; | 9 using scg = global::System.Collections.Generic; |
10 namespace UnitTest.Issues.TestProtos { | 10 namespace UnitTest.Issues.TestProtos { |
(...skipping 24 matching lines...) Expand all Loading... |
35 "ZXByZWNhdGVkQ2hpbGRCAhgBEjoKDE1lc3NhZ2VBcnJheRgEIAMoCzIgLnVu", | 35 "ZXByZWNhdGVkQ2hpbGRCAhgBEjoKDE1lc3NhZ2VBcnJheRgEIAMoCzIgLnVu", |
36 "aXR0ZXN0X2lzc3Vlcy5EZXByZWNhdGVkQ2hpbGRCAhgBEjYKCUVudW1WYWx1", | 36 "aXR0ZXN0X2lzc3Vlcy5EZXByZWNhdGVkQ2hpbGRCAhgBEjYKCUVudW1WYWx1", |
37 "ZRgFIAEoDjIfLnVuaXR0ZXN0X2lzc3Vlcy5EZXByZWNhdGVkRW51bUICGAES", | 37 "ZRgFIAEoDjIfLnVuaXR0ZXN0X2lzc3Vlcy5EZXByZWNhdGVkRW51bUICGAES", |
38 "NgoJRW51bUFycmF5GAYgAygOMh8udW5pdHRlc3RfaXNzdWVzLkRlcHJlY2F0", | 38 "NgoJRW51bUFycmF5GAYgAygOMh8udW5pdHRlc3RfaXNzdWVzLkRlcHJlY2F0", |
39 "ZWRFbnVtQgIYASIZCglJdGVtRmllbGQSDAoEaXRlbRgBIAEoBSJECg1SZXNl", | 39 "ZWRFbnVtQgIYASIZCglJdGVtRmllbGQSDAoEaXRlbRgBIAEoBSJECg1SZXNl", |
40 "cnZlZE5hbWVzEg0KBXR5cGVzGAEgASgFEhIKCmRlc2NyaXB0b3IYAiABKAUa", | 40 "cnZlZE5hbWVzEg0KBXR5cGVzGAEgASgFEhIKCmRlc2NyaXB0b3IYAiABKAUa", |
41 "EAoOU29tZU5lc3RlZFR5cGUioAEKFVRlc3RKc29uRmllbGRPcmRlcmluZxIT", | 41 "EAoOU29tZU5lc3RlZFR5cGUioAEKFVRlc3RKc29uRmllbGRPcmRlcmluZxIT", |
42 "CgtwbGFpbl9pbnQzMhgEIAEoBRITCglvMV9zdHJpbmcYAiABKAlIABISCghv", | 42 "CgtwbGFpbl9pbnQzMhgEIAEoBRITCglvMV9zdHJpbmcYAiABKAlIABISCghv", |
43 "MV9pbnQzMhgFIAEoBUgAEhQKDHBsYWluX3N0cmluZxgBIAEoCRISCghvMl9p", | 43 "MV9pbnQzMhgFIAEoBUgAEhQKDHBsYWluX3N0cmluZxgBIAEoCRISCghvMl9p", |
44 "bnQzMhgGIAEoBUgBEhMKCW8yX3N0cmluZxgDIAEoCUgBQgQKAm8xQgQKAm8y", | 44 "bnQzMhgGIAEoBUgBEhMKCW8yX3N0cmluZxgDIAEoCUgBQgQKAm8xQgQKAm8y", |
45 "KlUKDE5lZ2F0aXZlRW51bRIWChJORUdBVElWRV9FTlVNX1pFUk8QABIWCglG", | 45 "IksKDFRlc3RKc29uTmFtZRIMCgRuYW1lGAEgASgJEhkKC2Rlc2NyaXB0aW9u", |
46 "aXZlQmVsb3cQ+///////////ARIVCghNaW51c09uZRD///////////8BKi4K", | 46 "GAIgASgJUgRkZXNjEhIKBGd1aWQYAyABKAlSBGV4aWQqVQoMTmVnYXRpdmVF", |
47 "DkRlcHJlY2F0ZWRFbnVtEhMKD0RFUFJFQ0FURURfWkVSTxAAEgcKA29uZRAB", | 47 "bnVtEhYKEk5FR0FUSVZFX0VOVU1fWkVSTxAAEhYKCUZpdmVCZWxvdxD7////", |
48 "Qh9IAaoCGlVuaXRUZXN0Lklzc3Vlcy5UZXN0UHJvdG9zYgZwcm90bzM=")); | 48 "//////8BEhUKCE1pbnVzT25lEP///////////wEqLgoORGVwcmVjYXRlZEVu", |
| 49 "dW0SEwoPREVQUkVDQVRFRF9aRVJPEAASBwoDb25lEAFCH0gBqgIaVW5pdFRl", |
| 50 "c3QuSXNzdWVzLlRlc3RQcm90b3NiBnByb3RvMw==")); |
49 descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, | 51 descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, |
50 new pbr::FileDescriptor[] { }, | 52 new pbr::FileDescriptor[] { }, |
51 new pbr::GeneratedCodeInfo(new[] {typeof(global::UnitTest.Issues.TestP
rotos.NegativeEnum), typeof(global::UnitTest.Issues.TestProtos.DeprecatedEnum),
}, new pbr::GeneratedCodeInfo[] { | 53 new pbr::GeneratedClrTypeInfo(new[] {typeof(global::UnitTest.Issues.Te
stProtos.NegativeEnum), typeof(global::UnitTest.Issues.TestProtos.DeprecatedEnum
), }, new pbr::GeneratedClrTypeInfo[] { |
52 new pbr::GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos
.Issue307), global::UnitTest.Issues.TestProtos.Issue307.Parser, null, null, null
, new pbr::GeneratedCodeInfo[] { new pbr::GeneratedCodeInfo(typeof(global::UnitT
est.Issues.TestProtos.Issue307.Types.NestedOnce), global::UnitTest.Issues.TestPr
otos.Issue307.Types.NestedOnce.Parser, null, null, null, new pbr::GeneratedCodeI
nfo[] { new pbr::GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos.Iss
ue307.Types.NestedOnce.Types.NestedTwice), global::UnitTest.Issues.TestProtos.Is
sue307.Types.NestedOnce.Types.NestedTwice.Parser, null, null, null, null)})}), | 54 new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestPro
tos.Issue307), global::UnitTest.Issues.TestProtos.Issue307.Parser, null, null, n
ull, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(glob
al::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce), global::UnitTest.Issu
es.TestProtos.Issue307.Types.NestedOnce.Parser, null, null, null, new pbr::Gener
atedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues
.TestProtos.Issue307.Types.NestedOnce.Types.NestedTwice), global::UnitTest.Issue
s.TestProtos.Issue307.Types.NestedOnce.Types.NestedTwice.Parser, null, null, nul
l, null)})}), |
53 new pbr::GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos
.NegativeEnumMessage), global::UnitTest.Issues.TestProtos.NegativeEnumMessage.Pa
rser, new[]{ "Value", "Values", "PackedValues" }, null, null, null), | 55 new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestPro
tos.NegativeEnumMessage), global::UnitTest.Issues.TestProtos.NegativeEnumMessage
.Parser, new[]{ "Value", "Values", "PackedValues" }, null, null, null), |
54 new pbr::GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos
.DeprecatedChild), global::UnitTest.Issues.TestProtos.DeprecatedChild.Parser, nu
ll, null, null, null), | 56 new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestPro
tos.DeprecatedChild), global::UnitTest.Issues.TestProtos.DeprecatedChild.Parser,
null, null, null, null), |
55 new pbr::GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos
.DeprecatedFieldsMessage), global::UnitTest.Issues.TestProtos.DeprecatedFieldsMe
ssage.Parser, new[]{ "PrimitiveValue", "PrimitiveArray", "MessageValue", "Messag
eArray", "EnumValue", "EnumArray" }, null, null, null), | 57 new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestPro
tos.DeprecatedFieldsMessage), global::UnitTest.Issues.TestProtos.DeprecatedField
sMessage.Parser, new[]{ "PrimitiveValue", "PrimitiveArray", "MessageValue", "Mes
sageArray", "EnumValue", "EnumArray" }, null, null, null), |
56 new pbr::GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos
.ItemField), global::UnitTest.Issues.TestProtos.ItemField.Parser, new[]{ "Item"
}, null, null, null), | 58 new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestPro
tos.ItemField), global::UnitTest.Issues.TestProtos.ItemField.Parser, new[]{ "Ite
m" }, null, null, null), |
57 new pbr::GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos
.ReservedNames), global::UnitTest.Issues.TestProtos.ReservedNames.Parser, new[]{
"Types_", "Descriptor_" }, null, null, new pbr::GeneratedCodeInfo[] { new pbr::
GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos.ReservedNames.Types.
SomeNestedType), global::UnitTest.Issues.TestProtos.ReservedNames.Types.SomeNest
edType.Parser, null, null, null, null)}), | 59 new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestPro
tos.ReservedNames), global::UnitTest.Issues.TestProtos.ReservedNames.Parser, new
[]{ "Types_", "Descriptor_" }, null, null, new pbr::GeneratedClrTypeInfo[] { new
pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.ReservedNam
es.Types.SomeNestedType), global::UnitTest.Issues.TestProtos.ReservedNames.Types
.SomeNestedType.Parser, null, null, null, null)}), |
58 new pbr::GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos
.TestJsonFieldOrdering), global::UnitTest.Issues.TestProtos.TestJsonFieldOrderin
g.Parser, new[]{ "PlainInt32", "O1String", "O1Int32", "PlainString", "O2Int32",
"O2String" }, new[]{ "O1", "O2" }, null, null) | 60 new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestPro
tos.TestJsonFieldOrdering), global::UnitTest.Issues.TestProtos.TestJsonFieldOrde
ring.Parser, new[]{ "PlainInt32", "O1String", "O1Int32", "PlainString", "O2Int32
", "O2String" }, new[]{ "O1", "O2" }, null, null), |
| 61 new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestPro
tos.TestJsonName), global::UnitTest.Issues.TestProtos.TestJsonName.Parser, new[]
{ "Name", "Description", "Guid" }, null, null, null) |
59 })); | 62 })); |
60 } | 63 } |
61 #endregion | 64 #endregion |
62 | 65 |
63 } | 66 } |
64 #region Enums | 67 #region Enums |
65 public enum NegativeEnum { | 68 public enum NegativeEnum { |
66 NEGATIVE_ENUM_ZERO = 0, | 69 [pbr::OriginalName("NEGATIVE_ENUM_ZERO")] Zero = 0, |
67 FiveBelow = -5, | 70 [pbr::OriginalName("FiveBelow")] FiveBelow = -5, |
68 MinusOne = -1, | 71 [pbr::OriginalName("MinusOne")] MinusOne = -1, |
69 } | 72 } |
70 | 73 |
71 public enum DeprecatedEnum { | 74 public enum DeprecatedEnum { |
72 DEPRECATED_ZERO = 0, | 75 [pbr::OriginalName("DEPRECATED_ZERO")] DeprecatedZero = 0, |
73 one = 1, | 76 [pbr::OriginalName("one")] One = 1, |
74 } | 77 } |
75 | 78 |
76 #endregion | 79 #endregion |
77 | 80 |
78 #region Messages | 81 #region Messages |
79 /// <summary> | 82 /// <summary> |
80 /// Issue 307: when generating doubly-nested types, any references | 83 /// Issue 307: when generating doubly-nested types, any references |
81 /// should be of the form A.Types.B.Types.C. | 84 /// should be of the form A.Types.B.Types.C. |
82 /// </summary> | 85 /// </summary> |
83 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] | 86 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 values_ = other.values_.Clone(); | 349 values_ = other.values_.Clone(); |
347 packedValues_ = other.packedValues_.Clone(); | 350 packedValues_ = other.packedValues_.Clone(); |
348 } | 351 } |
349 | 352 |
350 public NegativeEnumMessage Clone() { | 353 public NegativeEnumMessage Clone() { |
351 return new NegativeEnumMessage(this); | 354 return new NegativeEnumMessage(this); |
352 } | 355 } |
353 | 356 |
354 /// <summary>Field number for the "value" field.</summary> | 357 /// <summary>Field number for the "value" field.</summary> |
355 public const int ValueFieldNumber = 1; | 358 public const int ValueFieldNumber = 1; |
356 private global::UnitTest.Issues.TestProtos.NegativeEnum value_ = global::Uni
tTest.Issues.TestProtos.NegativeEnum.NEGATIVE_ENUM_ZERO; | 359 private global::UnitTest.Issues.TestProtos.NegativeEnum value_ = 0; |
357 public global::UnitTest.Issues.TestProtos.NegativeEnum Value { | 360 public global::UnitTest.Issues.TestProtos.NegativeEnum Value { |
358 get { return value_; } | 361 get { return value_; } |
359 set { | 362 set { |
360 value_ = value; | 363 value_ = value; |
361 } | 364 } |
362 } | 365 } |
363 | 366 |
364 /// <summary>Field number for the "values" field.</summary> | 367 /// <summary>Field number for the "values" field.</summary> |
365 public const int ValuesFieldNumber = 2; | 368 public const int ValuesFieldNumber = 2; |
366 private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.Ne
gativeEnum> _repeated_values_codec | 369 private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.Ne
gativeEnum> _repeated_values_codec |
(...skipping 24 matching lines...) Expand all Loading... |
391 return true; | 394 return true; |
392 } | 395 } |
393 if (Value != other.Value) return false; | 396 if (Value != other.Value) return false; |
394 if(!values_.Equals(other.values_)) return false; | 397 if(!values_.Equals(other.values_)) return false; |
395 if(!packedValues_.Equals(other.packedValues_)) return false; | 398 if(!packedValues_.Equals(other.packedValues_)) return false; |
396 return true; | 399 return true; |
397 } | 400 } |
398 | 401 |
399 public override int GetHashCode() { | 402 public override int GetHashCode() { |
400 int hash = 1; | 403 int hash = 1; |
401 if (Value != global::UnitTest.Issues.TestProtos.NegativeEnum.NEGATIVE_ENUM
_ZERO) hash ^= Value.GetHashCode(); | 404 if (Value != 0) hash ^= Value.GetHashCode(); |
402 hash ^= values_.GetHashCode(); | 405 hash ^= values_.GetHashCode(); |
403 hash ^= packedValues_.GetHashCode(); | 406 hash ^= packedValues_.GetHashCode(); |
404 return hash; | 407 return hash; |
405 } | 408 } |
406 | 409 |
407 public override string ToString() { | 410 public override string ToString() { |
408 return pb::JsonFormatter.ToDiagnosticString(this); | 411 return pb::JsonFormatter.ToDiagnosticString(this); |
409 } | 412 } |
410 | 413 |
411 public void WriteTo(pb::CodedOutputStream output) { | 414 public void WriteTo(pb::CodedOutputStream output) { |
412 if (Value != global::UnitTest.Issues.TestProtos.NegativeEnum.NEGATIVE_ENUM
_ZERO) { | 415 if (Value != 0) { |
413 output.WriteRawTag(8); | 416 output.WriteRawTag(8); |
414 output.WriteEnum((int) Value); | 417 output.WriteEnum((int) Value); |
415 } | 418 } |
416 values_.WriteTo(output, _repeated_values_codec); | 419 values_.WriteTo(output, _repeated_values_codec); |
417 packedValues_.WriteTo(output, _repeated_packedValues_codec); | 420 packedValues_.WriteTo(output, _repeated_packedValues_codec); |
418 } | 421 } |
419 | 422 |
420 public int CalculateSize() { | 423 public int CalculateSize() { |
421 int size = 0; | 424 int size = 0; |
422 if (Value != global::UnitTest.Issues.TestProtos.NegativeEnum.NEGATIVE_ENUM
_ZERO) { | 425 if (Value != 0) { |
423 size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Value); | 426 size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Value); |
424 } | 427 } |
425 size += values_.CalculateSize(_repeated_values_codec); | 428 size += values_.CalculateSize(_repeated_values_codec); |
426 size += packedValues_.CalculateSize(_repeated_packedValues_codec); | 429 size += packedValues_.CalculateSize(_repeated_packedValues_codec); |
427 return size; | 430 return size; |
428 } | 431 } |
429 | 432 |
430 public void MergeFrom(NegativeEnumMessage other) { | 433 public void MergeFrom(NegativeEnumMessage other) { |
431 if (other == null) { | 434 if (other == null) { |
432 return; | 435 return; |
433 } | 436 } |
434 if (other.Value != global::UnitTest.Issues.TestProtos.NegativeEnum.NEGATIV
E_ENUM_ZERO) { | 437 if (other.Value != 0) { |
435 Value = other.Value; | 438 Value = other.Value; |
436 } | 439 } |
437 values_.Add(other.values_); | 440 values_.Add(other.values_); |
438 packedValues_.Add(other.packedValues_); | 441 packedValues_.Add(other.packedValues_); |
439 } | 442 } |
440 | 443 |
441 public void MergeFrom(pb::CodedInputStream input) { | 444 public void MergeFrom(pb::CodedInputStream input) { |
442 uint tag; | 445 uint tag; |
443 while ((tag = input.ReadTag()) != 0) { | 446 while ((tag = input.ReadTag()) != 0) { |
444 switch(tag) { | 447 switch(tag) { |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.De
precatedChild> _repeated_messageArray_codec | 613 private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.De
precatedChild> _repeated_messageArray_codec |
611 = pb::FieldCodec.ForMessage(34, global::UnitTest.Issues.TestProtos.Depre
catedChild.Parser); | 614 = pb::FieldCodec.ForMessage(34, global::UnitTest.Issues.TestProtos.Depre
catedChild.Parser); |
612 private readonly pbc::RepeatedField<global::UnitTest.Issues.TestProtos.Depre
catedChild> messageArray_ = new pbc::RepeatedField<global::UnitTest.Issues.TestP
rotos.DeprecatedChild>(); | 615 private readonly pbc::RepeatedField<global::UnitTest.Issues.TestProtos.Depre
catedChild> messageArray_ = new pbc::RepeatedField<global::UnitTest.Issues.TestP
rotos.DeprecatedChild>(); |
613 [global::System.ObsoleteAttribute()] | 616 [global::System.ObsoleteAttribute()] |
614 public pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedChild
> MessageArray { | 617 public pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedChild
> MessageArray { |
615 get { return messageArray_; } | 618 get { return messageArray_; } |
616 } | 619 } |
617 | 620 |
618 /// <summary>Field number for the "EnumValue" field.</summary> | 621 /// <summary>Field number for the "EnumValue" field.</summary> |
619 public const int EnumValueFieldNumber = 5; | 622 public const int EnumValueFieldNumber = 5; |
620 private global::UnitTest.Issues.TestProtos.DeprecatedEnum enumValue_ = globa
l::UnitTest.Issues.TestProtos.DeprecatedEnum.DEPRECATED_ZERO; | 623 private global::UnitTest.Issues.TestProtos.DeprecatedEnum enumValue_ = 0; |
621 [global::System.ObsoleteAttribute()] | 624 [global::System.ObsoleteAttribute()] |
622 public global::UnitTest.Issues.TestProtos.DeprecatedEnum EnumValue { | 625 public global::UnitTest.Issues.TestProtos.DeprecatedEnum EnumValue { |
623 get { return enumValue_; } | 626 get { return enumValue_; } |
624 set { | 627 set { |
625 enumValue_ = value; | 628 enumValue_ = value; |
626 } | 629 } |
627 } | 630 } |
628 | 631 |
629 /// <summary>Field number for the "EnumArray" field.</summary> | 632 /// <summary>Field number for the "EnumArray" field.</summary> |
630 public const int EnumArrayFieldNumber = 6; | 633 public const int EnumArrayFieldNumber = 6; |
(...skipping 24 matching lines...) Expand all Loading... |
655 if(!enumArray_.Equals(other.enumArray_)) return false; | 658 if(!enumArray_.Equals(other.enumArray_)) return false; |
656 return true; | 659 return true; |
657 } | 660 } |
658 | 661 |
659 public override int GetHashCode() { | 662 public override int GetHashCode() { |
660 int hash = 1; | 663 int hash = 1; |
661 if (PrimitiveValue != 0) hash ^= PrimitiveValue.GetHashCode(); | 664 if (PrimitiveValue != 0) hash ^= PrimitiveValue.GetHashCode(); |
662 hash ^= primitiveArray_.GetHashCode(); | 665 hash ^= primitiveArray_.GetHashCode(); |
663 if (messageValue_ != null) hash ^= MessageValue.GetHashCode(); | 666 if (messageValue_ != null) hash ^= MessageValue.GetHashCode(); |
664 hash ^= messageArray_.GetHashCode(); | 667 hash ^= messageArray_.GetHashCode(); |
665 if (EnumValue != global::UnitTest.Issues.TestProtos.DeprecatedEnum.DEPRECA
TED_ZERO) hash ^= EnumValue.GetHashCode(); | 668 if (EnumValue != 0) hash ^= EnumValue.GetHashCode(); |
666 hash ^= enumArray_.GetHashCode(); | 669 hash ^= enumArray_.GetHashCode(); |
667 return hash; | 670 return hash; |
668 } | 671 } |
669 | 672 |
670 public override string ToString() { | 673 public override string ToString() { |
671 return pb::JsonFormatter.ToDiagnosticString(this); | 674 return pb::JsonFormatter.ToDiagnosticString(this); |
672 } | 675 } |
673 | 676 |
674 public void WriteTo(pb::CodedOutputStream output) { | 677 public void WriteTo(pb::CodedOutputStream output) { |
675 if (PrimitiveValue != 0) { | 678 if (PrimitiveValue != 0) { |
676 output.WriteRawTag(8); | 679 output.WriteRawTag(8); |
677 output.WriteInt32(PrimitiveValue); | 680 output.WriteInt32(PrimitiveValue); |
678 } | 681 } |
679 primitiveArray_.WriteTo(output, _repeated_primitiveArray_codec); | 682 primitiveArray_.WriteTo(output, _repeated_primitiveArray_codec); |
680 if (messageValue_ != null) { | 683 if (messageValue_ != null) { |
681 output.WriteRawTag(26); | 684 output.WriteRawTag(26); |
682 output.WriteMessage(MessageValue); | 685 output.WriteMessage(MessageValue); |
683 } | 686 } |
684 messageArray_.WriteTo(output, _repeated_messageArray_codec); | 687 messageArray_.WriteTo(output, _repeated_messageArray_codec); |
685 if (EnumValue != global::UnitTest.Issues.TestProtos.DeprecatedEnum.DEPRECA
TED_ZERO) { | 688 if (EnumValue != 0) { |
686 output.WriteRawTag(40); | 689 output.WriteRawTag(40); |
687 output.WriteEnum((int) EnumValue); | 690 output.WriteEnum((int) EnumValue); |
688 } | 691 } |
689 enumArray_.WriteTo(output, _repeated_enumArray_codec); | 692 enumArray_.WriteTo(output, _repeated_enumArray_codec); |
690 } | 693 } |
691 | 694 |
692 public int CalculateSize() { | 695 public int CalculateSize() { |
693 int size = 0; | 696 int size = 0; |
694 if (PrimitiveValue != 0) { | 697 if (PrimitiveValue != 0) { |
695 size += 1 + pb::CodedOutputStream.ComputeInt32Size(PrimitiveValue); | 698 size += 1 + pb::CodedOutputStream.ComputeInt32Size(PrimitiveValue); |
696 } | 699 } |
697 size += primitiveArray_.CalculateSize(_repeated_primitiveArray_codec); | 700 size += primitiveArray_.CalculateSize(_repeated_primitiveArray_codec); |
698 if (messageValue_ != null) { | 701 if (messageValue_ != null) { |
699 size += 1 + pb::CodedOutputStream.ComputeMessageSize(MessageValue); | 702 size += 1 + pb::CodedOutputStream.ComputeMessageSize(MessageValue); |
700 } | 703 } |
701 size += messageArray_.CalculateSize(_repeated_messageArray_codec); | 704 size += messageArray_.CalculateSize(_repeated_messageArray_codec); |
702 if (EnumValue != global::UnitTest.Issues.TestProtos.DeprecatedEnum.DEPRECA
TED_ZERO) { | 705 if (EnumValue != 0) { |
703 size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) EnumValue); | 706 size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) EnumValue); |
704 } | 707 } |
705 size += enumArray_.CalculateSize(_repeated_enumArray_codec); | 708 size += enumArray_.CalculateSize(_repeated_enumArray_codec); |
706 return size; | 709 return size; |
707 } | 710 } |
708 | 711 |
709 public void MergeFrom(DeprecatedFieldsMessage other) { | 712 public void MergeFrom(DeprecatedFieldsMessage other) { |
710 if (other == null) { | 713 if (other == null) { |
711 return; | 714 return; |
712 } | 715 } |
713 if (other.PrimitiveValue != 0) { | 716 if (other.PrimitiveValue != 0) { |
714 PrimitiveValue = other.PrimitiveValue; | 717 PrimitiveValue = other.PrimitiveValue; |
715 } | 718 } |
716 primitiveArray_.Add(other.primitiveArray_); | 719 primitiveArray_.Add(other.primitiveArray_); |
717 if (other.messageValue_ != null) { | 720 if (other.messageValue_ != null) { |
718 if (messageValue_ == null) { | 721 if (messageValue_ == null) { |
719 messageValue_ = new global::UnitTest.Issues.TestProtos.DeprecatedChild
(); | 722 messageValue_ = new global::UnitTest.Issues.TestProtos.DeprecatedChild
(); |
720 } | 723 } |
721 MessageValue.MergeFrom(other.MessageValue); | 724 MessageValue.MergeFrom(other.MessageValue); |
722 } | 725 } |
723 messageArray_.Add(other.messageArray_); | 726 messageArray_.Add(other.messageArray_); |
724 if (other.EnumValue != global::UnitTest.Issues.TestProtos.DeprecatedEnum.D
EPRECATED_ZERO) { | 727 if (other.EnumValue != 0) { |
725 EnumValue = other.EnumValue; | 728 EnumValue = other.EnumValue; |
726 } | 729 } |
727 enumArray_.Add(other.enumArray_); | 730 enumArray_.Add(other.enumArray_); |
728 } | 731 } |
729 | 732 |
730 public void MergeFrom(pb::CodedInputStream input) { | 733 public void MergeFrom(pb::CodedInputStream input) { |
731 uint tag; | 734 uint tag; |
732 while ((tag = input.ReadTag()) != 0) { | 735 while ((tag = input.ReadTag()) != 0) { |
733 switch(tag) { | 736 switch(tag) { |
734 default: | 737 default: |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1157 set { | 1160 set { |
1158 plainInt32_ = value; | 1161 plainInt32_ = value; |
1159 } | 1162 } |
1160 } | 1163 } |
1161 | 1164 |
1162 /// <summary>Field number for the "o1_string" field.</summary> | 1165 /// <summary>Field number for the "o1_string" field.</summary> |
1163 public const int O1StringFieldNumber = 2; | 1166 public const int O1StringFieldNumber = 2; |
1164 public string O1String { | 1167 public string O1String { |
1165 get { return o1Case_ == O1OneofCase.O1String ? (string) o1_ : ""; } | 1168 get { return o1Case_ == O1OneofCase.O1String ? (string) o1_ : ""; } |
1166 set { | 1169 set { |
1167 o1_ = pb::Preconditions.CheckNotNull(value, "value"); | 1170 o1_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); |
1168 o1Case_ = O1OneofCase.O1String; | 1171 o1Case_ = O1OneofCase.O1String; |
1169 } | 1172 } |
1170 } | 1173 } |
1171 | 1174 |
1172 /// <summary>Field number for the "o1_int32" field.</summary> | 1175 /// <summary>Field number for the "o1_int32" field.</summary> |
1173 public const int O1Int32FieldNumber = 5; | 1176 public const int O1Int32FieldNumber = 5; |
1174 public int O1Int32 { | 1177 public int O1Int32 { |
1175 get { return o1Case_ == O1OneofCase.O1Int32 ? (int) o1_ : 0; } | 1178 get { return o1Case_ == O1OneofCase.O1Int32 ? (int) o1_ : 0; } |
1176 set { | 1179 set { |
1177 o1_ = value; | 1180 o1_ = value; |
1178 o1Case_ = O1OneofCase.O1Int32; | 1181 o1Case_ = O1OneofCase.O1Int32; |
1179 } | 1182 } |
1180 } | 1183 } |
1181 | 1184 |
1182 /// <summary>Field number for the "plain_string" field.</summary> | 1185 /// <summary>Field number for the "plain_string" field.</summary> |
1183 public const int PlainStringFieldNumber = 1; | 1186 public const int PlainStringFieldNumber = 1; |
1184 private string plainString_ = ""; | 1187 private string plainString_ = ""; |
1185 public string PlainString { | 1188 public string PlainString { |
1186 get { return plainString_; } | 1189 get { return plainString_; } |
1187 set { | 1190 set { |
1188 plainString_ = pb::Preconditions.CheckNotNull(value, "value"); | 1191 plainString_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); |
1189 } | 1192 } |
1190 } | 1193 } |
1191 | 1194 |
1192 /// <summary>Field number for the "o2_int32" field.</summary> | 1195 /// <summary>Field number for the "o2_int32" field.</summary> |
1193 public const int O2Int32FieldNumber = 6; | 1196 public const int O2Int32FieldNumber = 6; |
1194 public int O2Int32 { | 1197 public int O2Int32 { |
1195 get { return o2Case_ == O2OneofCase.O2Int32 ? (int) o2_ : 0; } | 1198 get { return o2Case_ == O2OneofCase.O2Int32 ? (int) o2_ : 0; } |
1196 set { | 1199 set { |
1197 o2_ = value; | 1200 o2_ = value; |
1198 o2Case_ = O2OneofCase.O2Int32; | 1201 o2Case_ = O2OneofCase.O2Int32; |
1199 } | 1202 } |
1200 } | 1203 } |
1201 | 1204 |
1202 /// <summary>Field number for the "o2_string" field.</summary> | 1205 /// <summary>Field number for the "o2_string" field.</summary> |
1203 public const int O2StringFieldNumber = 3; | 1206 public const int O2StringFieldNumber = 3; |
1204 public string O2String { | 1207 public string O2String { |
1205 get { return o2Case_ == O2OneofCase.O2String ? (string) o2_ : ""; } | 1208 get { return o2Case_ == O2OneofCase.O2String ? (string) o2_ : ""; } |
1206 set { | 1209 set { |
1207 o2_ = pb::Preconditions.CheckNotNull(value, "value"); | 1210 o2_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); |
1208 o2Case_ = O2OneofCase.O2String; | 1211 o2Case_ = O2OneofCase.O2String; |
1209 } | 1212 } |
1210 } | 1213 } |
1211 | 1214 |
1212 private object o1_; | 1215 private object o1_; |
1213 /// <summary>Enum of possible cases for the "o1" oneof.</summary> | 1216 /// <summary>Enum of possible cases for the "o1" oneof.</summary> |
1214 public enum O1OneofCase { | 1217 public enum O1OneofCase { |
1215 None = 0, | 1218 None = 0, |
1216 O1String = 2, | 1219 O1String = 2, |
1217 O1Int32 = 5, | 1220 O1Int32 = 5, |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1392 case 48: { | 1395 case 48: { |
1393 O2Int32 = input.ReadInt32(); | 1396 O2Int32 = input.ReadInt32(); |
1394 break; | 1397 break; |
1395 } | 1398 } |
1396 } | 1399 } |
1397 } | 1400 } |
1398 } | 1401 } |
1399 | 1402 |
1400 } | 1403 } |
1401 | 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::Me
ssageParser<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.D
escriptor.MessageTypes[7]; } |
| 1412 } |
| 1413 |
| 1414 pbr::MessageDescriptor pb::IMessage.Descriptor { |
| 1415 get { return Descriptor; } |
| 1416 } |
| 1417 |
| 1418 public TestJsonName() { |
| 1419 OnConstruction(); |
| 1420 } |
| 1421 |
| 1422 partial void OnConstruction(); |
| 1423 |
| 1424 public TestJsonName(TestJsonName other) : this() { |
| 1425 name_ = other.name_; |
| 1426 description_ = other.description_; |
| 1427 guid_ = other.guid_; |
| 1428 } |
| 1429 |
| 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 |
| 1467 public override bool Equals(object other) { |
| 1468 return Equals(other as TestJsonName); |
| 1469 } |
| 1470 |
| 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 |
| 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 |
| 1492 public override string ToString() { |
| 1493 return pb::JsonFormatter.ToDiagnosticString(this); |
| 1494 } |
| 1495 |
| 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 |
| 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 |
| 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 |
| 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 |
1402 #endregion | 1565 #endregion |
1403 | 1566 |
1404 } | 1567 } |
1405 | 1568 |
1406 #endregion Designer generated code | 1569 #endregion Designer generated code |
OLD | NEW |