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