UnittestIssues.cs 43 KB
Newer Older
1 2 3 4 5
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: unittest_issues.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code

6 7
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
8
using pbr = global::Google.Protobuf.Reflection;
9 10 11 12 13 14 15
using scg = global::System.Collections.Generic;
namespace UnitTest.Issues.TestProtos {

  [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  public static partial class UnittestIssues {

    #region Descriptor
16
    public static pbr::FileDescriptor Descriptor {
17 18
      get { return descriptor; }
    }
19
    private static pbr::FileDescriptor descriptor;
20 21 22 23

    static UnittestIssues() {
      byte[] descriptorData = global::System.Convert.FromBase64String(
          string.Concat(
24 25 26 27 28 29 30 31 32 33 34 35 36
            "ChV1bml0dGVzdF9pc3N1ZXMucHJvdG8SD3VuaXR0ZXN0X2lzc3VlcyInCghJ", 
            "c3N1ZTMwNxobCgpOZXN0ZWRPbmNlGg0KC05lc3RlZFR3aWNlIrABChNOZWdh", 
            "dGl2ZUVudW1NZXNzYWdlEiwKBXZhbHVlGAEgASgOMh0udW5pdHRlc3RfaXNz", 
            "dWVzLk5lZ2F0aXZlRW51bRIxCgZ2YWx1ZXMYAiADKA4yHS51bml0dGVzdF9p", 
            "c3N1ZXMuTmVnYXRpdmVFbnVtQgIQABI4Cg1wYWNrZWRfdmFsdWVzGAMgAygO", 
            "Mh0udW5pdHRlc3RfaXNzdWVzLk5lZ2F0aXZlRW51bUICEAEiEQoPRGVwcmVj", 
            "YXRlZENoaWxkIrkCChdEZXByZWNhdGVkRmllbGRzTWVzc2FnZRIaCg5Qcmlt", 
            "aXRpdmVWYWx1ZRgBIAEoBUICGAESGgoOUHJpbWl0aXZlQXJyYXkYAiADKAVC", 
            "AhgBEjoKDE1lc3NhZ2VWYWx1ZRgDIAEoCzIgLnVuaXR0ZXN0X2lzc3Vlcy5E", 
            "ZXByZWNhdGVkQ2hpbGRCAhgBEjoKDE1lc3NhZ2VBcnJheRgEIAMoCzIgLnVu", 
            "aXR0ZXN0X2lzc3Vlcy5EZXByZWNhdGVkQ2hpbGRCAhgBEjYKCUVudW1WYWx1", 
            "ZRgFIAEoDjIfLnVuaXR0ZXN0X2lzc3Vlcy5EZXByZWNhdGVkRW51bUICGAES", 
            "NgoJRW51bUFycmF5GAYgAygOMh8udW5pdHRlc3RfaXNzdWVzLkRlcHJlY2F0", 
37 38
            "ZWRFbnVtQgIYASIZCglJdGVtRmllbGQSDAoEaXRlbRgBIAEoBSJECg1SZXNl", 
            "cnZlZE5hbWVzEg0KBXR5cGVzGAEgASgFEhIKCmRlc2NyaXB0b3IYAiABKAUa", 
39 40 41 42 43 44 45 46
            "EAoOU29tZU5lc3RlZFR5cGUioAEKFVRlc3RKc29uRmllbGRPcmRlcmluZxIT", 
            "CgtwbGFpbl9pbnQzMhgEIAEoBRITCglvMV9zdHJpbmcYAiABKAlIABISCghv", 
            "MV9pbnQzMhgFIAEoBUgAEhQKDHBsYWluX3N0cmluZxgBIAEoCRISCghvMl9p", 
            "bnQzMhgGIAEoBUgBEhMKCW8yX3N0cmluZxgDIAEoCUgBQgQKAm8xQgQKAm8y", 
            "KlUKDE5lZ2F0aXZlRW51bRIWChJORUdBVElWRV9FTlVNX1pFUk8QABIWCglG", 
            "aXZlQmVsb3cQ+///////////ARIVCghNaW51c09uZRD///////////8BKi4K", 
            "DkRlcHJlY2F0ZWRFbnVtEhMKD0RFUFJFQ0FURURfWkVSTxAAEgcKA29uZRAB", 
            "Qh9IAaoCGlVuaXRUZXN0Lklzc3Vlcy5UZXN0UHJvdG9zYgZwcm90bzM="));
47
      descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
48
          new pbr::FileDescriptor[] { },
49 50 51 52 53
          new pbr::GeneratedCodeInfo(new[] {typeof(global::UnitTest.Issues.TestProtos.NegativeEnum), typeof(global::UnitTest.Issues.TestProtos.DeprecatedEnum), }, new pbr::GeneratedCodeInfo[] {
            new pbr::GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos.Issue307), null, null, null, new pbr::GeneratedCodeInfo[] { new pbr::GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce), null, null, null, new pbr::GeneratedCodeInfo[] { new pbr::GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce.Types.NestedTwice), null, null, null, null)})}),
            new pbr::GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos.NegativeEnumMessage), new[]{ "Value", "Values", "PackedValues" }, null, null, null),
            new pbr::GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos.DeprecatedChild), null, null, null, null),
            new pbr::GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos.DeprecatedFieldsMessage), new[]{ "PrimitiveValue", "PrimitiveArray", "MessageValue", "MessageArray", "EnumValue", "EnumArray" }, null, null, null),
54
            new pbr::GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos.ItemField), new[]{ "Item" }, null, null, null),
55 56
            new pbr::GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos.ReservedNames), new[]{ "Types_", "Descriptor_" }, null, null, new pbr::GeneratedCodeInfo[] { new pbr::GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos.ReservedNames.Types.SomeNestedType), null, null, null, null)}),
            new pbr::GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos.TestJsonFieldOrdering), new[]{ "PlainInt32", "O1String", "O1Int32", "PlainString", "O2Int32", "O2String" }, new[]{ "O1", "O2" }, null, null)
57
          }));
58 59 60 61 62
    }
    #endregion

  }
  #region Enums
63
  public enum NegativeEnum {
64
    NEGATIVE_ENUM_ZERO = 0,
65 66 67 68
    FiveBelow = -5,
    MinusOne = -1,
  }

69
  public enum DeprecatedEnum {
70
    DEPRECATED_ZERO = 0,
71 72 73 74 75 76
    one = 1,
  }

  #endregion

  #region Messages
77 78 79 80 81
  [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  public sealed partial class Issue307 : pb::IMessage<Issue307> {
    private static readonly pb::MessageParser<Issue307> _parser = new pb::MessageParser<Issue307>(() => new Issue307());
    public static pb::MessageParser<Issue307> Parser { get { return _parser; } }

82
    public static pbr::MessageDescriptor Descriptor {
83
      get { return global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor.MessageTypes[0]; }
84 85
    }

86 87
    pbr::MessageDescriptor pb::IMessage.Descriptor {
      get { return Descriptor; }
88 89
    }

90 91 92 93 94
    public Issue307() {
      OnConstruction();
    }

    partial void OnConstruction();
95

96
    public Issue307(Issue307 other) : this() {
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
    }

    public Issue307 Clone() {
      return new Issue307(this);
    }

    public override bool Equals(object other) {
      return Equals(other as Issue307);
    }

    public bool Equals(Issue307 other) {
      if (ReferenceEquals(other, null)) {
        return false;
      }
      if (ReferenceEquals(other, this)) {
        return true;
      }
      return true;
    }

    public override int GetHashCode() {
      int hash = 1;
      return hash;
    }

122 123 124 125
    public override string ToString() {
      return pb::JsonFormatter.Default.Format(this);
    }

126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162
    public void WriteTo(pb::CodedOutputStream output) {
    }

    public int CalculateSize() {
      int size = 0;
      return size;
    }

    public void MergeFrom(Issue307 other) {
      if (other == null) {
        return;
      }
    }

    public void MergeFrom(pb::CodedInputStream input) {
      uint tag;
      while (input.ReadTag(out tag)) {
        switch(tag) {
          case 0:
            throw pb::InvalidProtocolBufferException.InvalidTag();
          default:
            if (pb::WireFormat.IsEndGroupTag(tag)) {
              return;
            }
            break;
        }
      }
    }

    #region Nested types
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    public static partial class Types {
      [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
      public sealed partial class NestedOnce : pb::IMessage<NestedOnce> {
        private static readonly pb::MessageParser<NestedOnce> _parser = new pb::MessageParser<NestedOnce>(() => new NestedOnce());
        public static pb::MessageParser<NestedOnce> Parser { get { return _parser; } }

163
        public static pbr::MessageDescriptor Descriptor {
164
          get { return global::UnitTest.Issues.TestProtos.Issue307.Descriptor.NestedTypes[0]; }
165 166
        }

167 168
        pbr::MessageDescriptor pb::IMessage.Descriptor {
          get { return Descriptor; }
169 170
        }

171 172 173 174 175
        public NestedOnce() {
          OnConstruction();
        }

        partial void OnConstruction();
176

177
        public NestedOnce(NestedOnce other) : this() {
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202
        }

        public NestedOnce Clone() {
          return new NestedOnce(this);
        }

        public override bool Equals(object other) {
          return Equals(other as NestedOnce);
        }

        public bool Equals(NestedOnce other) {
          if (ReferenceEquals(other, null)) {
            return false;
          }
          if (ReferenceEquals(other, this)) {
            return true;
          }
          return true;
        }

        public override int GetHashCode() {
          int hash = 1;
          return hash;
        }

203 204 205 206
        public override string ToString() {
          return pb::JsonFormatter.Default.Format(this);
        }

207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243
        public void WriteTo(pb::CodedOutputStream output) {
        }

        public int CalculateSize() {
          int size = 0;
          return size;
        }

        public void MergeFrom(NestedOnce other) {
          if (other == null) {
            return;
          }
        }

        public void MergeFrom(pb::CodedInputStream input) {
          uint tag;
          while (input.ReadTag(out tag)) {
            switch(tag) {
              case 0:
                throw pb::InvalidProtocolBufferException.InvalidTag();
              default:
                if (pb::WireFormat.IsEndGroupTag(tag)) {
                  return;
                }
                break;
            }
          }
        }

        #region Nested types
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        public static partial class Types {
          [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
          public sealed partial class NestedTwice : pb::IMessage<NestedTwice> {
            private static readonly pb::MessageParser<NestedTwice> _parser = new pb::MessageParser<NestedTwice>(() => new NestedTwice());
            public static pb::MessageParser<NestedTwice> Parser { get { return _parser; } }

244
            public static pbr::MessageDescriptor Descriptor {
245
              get { return global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce.Descriptor.NestedTypes[0]; }
246 247
            }

248 249
            pbr::MessageDescriptor pb::IMessage.Descriptor {
              get { return Descriptor; }
250 251
            }

252 253 254 255 256
            public NestedTwice() {
              OnConstruction();
            }

            partial void OnConstruction();
257

258
            public NestedTwice(NestedTwice other) : this() {
259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283
            }

            public NestedTwice Clone() {
              return new NestedTwice(this);
            }

            public override bool Equals(object other) {
              return Equals(other as NestedTwice);
            }

            public bool Equals(NestedTwice other) {
              if (ReferenceEquals(other, null)) {
                return false;
              }
              if (ReferenceEquals(other, this)) {
                return true;
              }
              return true;
            }

            public override int GetHashCode() {
              int hash = 1;
              return hash;
            }

284 285 286 287
            public override string ToString() {
              return pb::JsonFormatter.Default.Format(this);
            }

288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328
            public void WriteTo(pb::CodedOutputStream output) {
            }

            public int CalculateSize() {
              int size = 0;
              return size;
            }

            public void MergeFrom(NestedTwice other) {
              if (other == null) {
                return;
              }
            }

            public void MergeFrom(pb::CodedInputStream input) {
              uint tag;
              while (input.ReadTag(out tag)) {
                switch(tag) {
                  case 0:
                    throw pb::InvalidProtocolBufferException.InvalidTag();
                  default:
                    if (pb::WireFormat.IsEndGroupTag(tag)) {
                      return;
                    }
                    break;
                }
              }
            }

          }

        }
        #endregion

      }

    }
    #endregion

  }

329
  [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
330
  public sealed partial class NegativeEnumMessage : pb::IMessage<NegativeEnumMessage> {
331 332
    private static readonly pb::MessageParser<NegativeEnumMessage> _parser = new pb::MessageParser<NegativeEnumMessage>(() => new NegativeEnumMessage());
    public static pb::MessageParser<NegativeEnumMessage> Parser { get { return _parser; } }
333

334
    public static pbr::MessageDescriptor Descriptor {
335
      get { return global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor.MessageTypes[1]; }
336 337
    }

338 339
    pbr::MessageDescriptor pb::IMessage.Descriptor {
      get { return Descriptor; }
340 341
    }

342 343 344 345 346
    public NegativeEnumMessage() {
      OnConstruction();
    }

    partial void OnConstruction();
Jon Skeet's avatar
Jon Skeet committed
347

348
    public NegativeEnumMessage(NegativeEnumMessage other) : this() {
Jon Skeet's avatar
Jon Skeet committed
349 350 351 352 353 354 355
      value_ = other.value_;
      values_ = other.values_.Clone();
      packedValues_ = other.packedValues_.Clone();
    }

    public NegativeEnumMessage Clone() {
      return new NegativeEnumMessage(this);
356
    }
Jon Skeet's avatar
Jon Skeet committed
357

358 359 360 361
    public const int ValueFieldNumber = 1;
    private global::UnitTest.Issues.TestProtos.NegativeEnum value_ = global::UnitTest.Issues.TestProtos.NegativeEnum.NEGATIVE_ENUM_ZERO;
    public global::UnitTest.Issues.TestProtos.NegativeEnum Value {
      get { return value_; }
362 363 364
      set {
        value_ = value;
      }
365 366
    }

367
    public const int ValuesFieldNumber = 2;
368
    private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.NegativeEnum> _repeated_values_codec
369 370
        = pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::UnitTest.Issues.TestProtos.NegativeEnum) x);
    private readonly pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum> values_ = new pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum>();
371 372
    public pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum> Values {
      get { return values_; }
373 374
    }

375
    public const int PackedValuesFieldNumber = 3;
376
    private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.NegativeEnum> _repeated_packedValues_codec
377 378
        = pb::FieldCodec.ForEnum(26, x => (int) x, x => (global::UnitTest.Issues.TestProtos.NegativeEnum) x);
    private readonly pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum> packedValues_ = new pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum>();
379 380
    public pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum> PackedValues {
      get { return packedValues_; }
381 382
    }

383 384
    public override bool Equals(object other) {
      return Equals(other as NegativeEnumMessage);
385 386
    }

387 388 389
    public bool Equals(NegativeEnumMessage other) {
      if (ReferenceEquals(other, null)) {
        return false;
390
      }
391 392
      if (ReferenceEquals(other, this)) {
        return true;
393
      }
394 395 396 397 398
      if (Value != other.Value) return false;
      if(!values_.Equals(other.values_)) return false;
      if(!packedValues_.Equals(other.packedValues_)) return false;
      return true;
    }
399

400
    public override int GetHashCode() {
401
      int hash = 1;
402 403 404 405 406
      if (Value != global::UnitTest.Issues.TestProtos.NegativeEnum.NEGATIVE_ENUM_ZERO) hash ^= Value.GetHashCode();
      hash ^= values_.GetHashCode();
      hash ^= packedValues_.GetHashCode();
      return hash;
    }
407

408 409 410 411
    public override string ToString() {
      return pb::JsonFormatter.Default.Format(this);
    }

Jon Skeet's avatar
Jon Skeet committed
412
    public void WriteTo(pb::CodedOutputStream output) {
413
      if (Value != global::UnitTest.Issues.TestProtos.NegativeEnum.NEGATIVE_ENUM_ZERO) {
414 415
        output.WriteRawTag(8);
        output.WriteEnum((int) Value);
416
      }
417 418
      values_.WriteTo(output, _repeated_values_codec);
      packedValues_.WriteTo(output, _repeated_packedValues_codec);
419
    }
420

421 422 423
    public int CalculateSize() {
      int size = 0;
      if (Value != global::UnitTest.Issues.TestProtos.NegativeEnum.NEGATIVE_ENUM_ZERO) {
424
        size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Value);
425
      }
426 427
      size += values_.CalculateSize(_repeated_values_codec);
      size += packedValues_.CalculateSize(_repeated_packedValues_codec);
428 429
      return size;
    }
430

431 432 433
    public void MergeFrom(NegativeEnumMessage other) {
      if (other == null) {
        return;
434
      }
435 436
      if (other.Value != global::UnitTest.Issues.TestProtos.NegativeEnum.NEGATIVE_ENUM_ZERO) {
        Value = other.Value;
437
      }
438 439 440
      values_.Add(other.values_);
      packedValues_.Add(other.packedValues_);
    }
441

Jon Skeet's avatar
Jon Skeet committed
442
    public void MergeFrom(pb::CodedInputStream input) {
443
      uint tag;
Jon Skeet's avatar
Jon Skeet committed
444
      while (input.ReadTag(out tag)) {
445 446 447 448 449 450
        switch(tag) {
          case 0:
            throw pb::InvalidProtocolBufferException.InvalidTag();
          default:
            if (pb::WireFormat.IsEndGroupTag(tag)) {
              return;
451
            }
452 453
            break;
          case 8: {
Jon Skeet's avatar
Jon Skeet committed
454 455
            value_ = (global::UnitTest.Issues.TestProtos.NegativeEnum) input.ReadEnum();
            break;
456 457 458
          }
          case 18:
          case 16: {
459
            values_.AddEntriesFrom(input, _repeated_values_codec);
460 461 462 463
            break;
          }
          case 26:
          case 24: {
464
            packedValues_.AddEntriesFrom(input, _repeated_packedValues_codec);
465
            break;
466 467 468 469
          }
        }
      }
    }
470

471 472 473
  }

  [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
474
  public sealed partial class DeprecatedChild : pb::IMessage<DeprecatedChild> {
475 476
    private static readonly pb::MessageParser<DeprecatedChild> _parser = new pb::MessageParser<DeprecatedChild>(() => new DeprecatedChild());
    public static pb::MessageParser<DeprecatedChild> Parser { get { return _parser; } }
477

478
    public static pbr::MessageDescriptor Descriptor {
479
      get { return global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor.MessageTypes[2]; }
480 481
    }

482 483
    pbr::MessageDescriptor pb::IMessage.Descriptor {
      get { return Descriptor; }
484 485
    }

486 487 488 489 490
    public DeprecatedChild() {
      OnConstruction();
    }

    partial void OnConstruction();
Jon Skeet's avatar
Jon Skeet committed
491

492
    public DeprecatedChild(DeprecatedChild other) : this() {
493
    }
Jon Skeet's avatar
Jon Skeet committed
494 495 496 497 498

    public DeprecatedChild Clone() {
      return new DeprecatedChild(this);
    }

499 500
    public override bool Equals(object other) {
      return Equals(other as DeprecatedChild);
501 502
    }

503 504 505 506 507
    public bool Equals(DeprecatedChild other) {
      if (ReferenceEquals(other, null)) {
        return false;
      }
      if (ReferenceEquals(other, this)) {
508 509
        return true;
      }
510
      return true;
511 512
    }

513
    public override int GetHashCode() {
514
      int hash = 1;
515
      return hash;
516 517
    }

518 519 520 521
    public override string ToString() {
      return pb::JsonFormatter.Default.Format(this);
    }

Jon Skeet's avatar
Jon Skeet committed
522
    public void WriteTo(pb::CodedOutputStream output) {
523 524
    }

525 526
    public int CalculateSize() {
      int size = 0;
527 528
      return size;
    }
529

530 531 532 533
    public void MergeFrom(DeprecatedChild other) {
      if (other == null) {
        return;
      }
534
    }
535

Jon Skeet's avatar
Jon Skeet committed
536
    public void MergeFrom(pb::CodedInputStream input) {
537
      uint tag;
Jon Skeet's avatar
Jon Skeet committed
538
      while (input.ReadTag(out tag)) {
539 540 541 542 543 544 545 546 547 548
        switch(tag) {
          case 0:
            throw pb::InvalidProtocolBufferException.InvalidTag();
          default:
            if (pb::WireFormat.IsEndGroupTag(tag)) {
              return;
            }
            break;
        }
      }
549
    }
550 551 552 553

  }

  [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
554
  public sealed partial class DeprecatedFieldsMessage : pb::IMessage<DeprecatedFieldsMessage> {
555 556 557
    private static readonly pb::MessageParser<DeprecatedFieldsMessage> _parser = new pb::MessageParser<DeprecatedFieldsMessage>(() => new DeprecatedFieldsMessage());
    public static pb::MessageParser<DeprecatedFieldsMessage> Parser { get { return _parser; } }

558
    public static pbr::MessageDescriptor Descriptor {
559
      get { return global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor.MessageTypes[3]; }
560
    }
561

562 563
    pbr::MessageDescriptor pb::IMessage.Descriptor {
      get { return Descriptor; }
564
    }
565

566 567 568
    public DeprecatedFieldsMessage() {
      OnConstruction();
    }
Jon Skeet's avatar
Jon Skeet committed
569

570 571 572
    partial void OnConstruction();

    public DeprecatedFieldsMessage(DeprecatedFieldsMessage other) : this() {
Jon Skeet's avatar
Jon Skeet committed
573 574 575 576 577 578 579 580 581 582
      primitiveValue_ = other.primitiveValue_;
      primitiveArray_ = other.primitiveArray_.Clone();
      MessageValue = other.messageValue_ != null ? other.MessageValue.Clone() : null;
      messageArray_ = other.messageArray_.Clone();
      enumValue_ = other.enumValue_;
      enumArray_ = other.enumArray_.Clone();
    }

    public DeprecatedFieldsMessage Clone() {
      return new DeprecatedFieldsMessage(this);
583
    }
Jon Skeet's avatar
Jon Skeet committed
584

585 586 587 588 589
    public const int PrimitiveValueFieldNumber = 1;
    private int primitiveValue_;
    [global::System.ObsoleteAttribute()]
    public int PrimitiveValue {
      get { return primitiveValue_; }
590 591 592
      set {
        primitiveValue_ = value;
      }
593
    }
594 595

    public const int PrimitiveArrayFieldNumber = 2;
596 597
    private static readonly pb::FieldCodec<int> _repeated_primitiveArray_codec
        = pb::FieldCodec.ForInt32(18);
598 599 600 601
    private readonly pbc::RepeatedField<int> primitiveArray_ = new pbc::RepeatedField<int>();
    [global::System.ObsoleteAttribute()]
    public pbc::RepeatedField<int> PrimitiveArray {
      get { return primitiveArray_; }
602
    }
603 604 605 606 607 608

    public const int MessageValueFieldNumber = 3;
    private global::UnitTest.Issues.TestProtos.DeprecatedChild messageValue_;
    [global::System.ObsoleteAttribute()]
    public global::UnitTest.Issues.TestProtos.DeprecatedChild MessageValue {
      get { return messageValue_; }
609 610 611
      set {
        messageValue_ = value;
      }
612
    }
613 614

    public const int MessageArrayFieldNumber = 4;
615 616
    private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.DeprecatedChild> _repeated_messageArray_codec
        = pb::FieldCodec.ForMessage(34, global::UnitTest.Issues.TestProtos.DeprecatedChild.Parser);
617 618 619 620
    private readonly pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedChild> messageArray_ = new pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedChild>();
    [global::System.ObsoleteAttribute()]
    public pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedChild> MessageArray {
      get { return messageArray_; }
621
    }
622 623 624 625 626 627

    public const int EnumValueFieldNumber = 5;
    private global::UnitTest.Issues.TestProtos.DeprecatedEnum enumValue_ = global::UnitTest.Issues.TestProtos.DeprecatedEnum.DEPRECATED_ZERO;
    [global::System.ObsoleteAttribute()]
    public global::UnitTest.Issues.TestProtos.DeprecatedEnum EnumValue {
      get { return enumValue_; }
628 629 630
      set {
        enumValue_ = value;
      }
631
    }
632 633

    public const int EnumArrayFieldNumber = 6;
634
    private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.DeprecatedEnum> _repeated_enumArray_codec
635 636
        = pb::FieldCodec.ForEnum(50, x => (int) x, x => (global::UnitTest.Issues.TestProtos.DeprecatedEnum) x);
    private readonly pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedEnum> enumArray_ = new pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedEnum>();
637 638 639
    [global::System.ObsoleteAttribute()]
    public pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedEnum> EnumArray {
      get { return enumArray_; }
640 641
    }

642 643
    public override bool Equals(object other) {
      return Equals(other as DeprecatedFieldsMessage);
644 645
    }

646 647 648
    public bool Equals(DeprecatedFieldsMessage other) {
      if (ReferenceEquals(other, null)) {
        return false;
649
      }
650 651
      if (ReferenceEquals(other, this)) {
        return true;
652
      }
653 654
      if (PrimitiveValue != other.PrimitiveValue) return false;
      if(!primitiveArray_.Equals(other.primitiveArray_)) return false;
655 656
      if (!object.Equals(MessageValue, other.MessageValue)) return false;
      if(!messageArray_.Equals(other.messageArray_)) return false;
657 658 659 660
      if (EnumValue != other.EnumValue) return false;
      if(!enumArray_.Equals(other.enumArray_)) return false;
      return true;
    }
661

662
    public override int GetHashCode() {
663
      int hash = 1;
664 665 666 667 668 669 670 671
      if (PrimitiveValue != 0) hash ^= PrimitiveValue.GetHashCode();
      hash ^= primitiveArray_.GetHashCode();
      if (messageValue_ != null) hash ^= MessageValue.GetHashCode();
      hash ^= messageArray_.GetHashCode();
      if (EnumValue != global::UnitTest.Issues.TestProtos.DeprecatedEnum.DEPRECATED_ZERO) hash ^= EnumValue.GetHashCode();
      hash ^= enumArray_.GetHashCode();
      return hash;
    }
672

673 674 675 676
    public override string ToString() {
      return pb::JsonFormatter.Default.Format(this);
    }

Jon Skeet's avatar
Jon Skeet committed
677
    public void WriteTo(pb::CodedOutputStream output) {
678
      if (PrimitiveValue != 0) {
679 680
        output.WriteRawTag(8);
        output.WriteInt32(PrimitiveValue);
681
      }
682
      primitiveArray_.WriteTo(output, _repeated_primitiveArray_codec);
683
      if (messageValue_ != null) {
684 685
        output.WriteRawTag(26);
        output.WriteMessage(MessageValue);
686
      }
687
      messageArray_.WriteTo(output, _repeated_messageArray_codec);
688
      if (EnumValue != global::UnitTest.Issues.TestProtos.DeprecatedEnum.DEPRECATED_ZERO) {
689 690
        output.WriteRawTag(40);
        output.WriteEnum((int) EnumValue);
691
      }
692
      enumArray_.WriteTo(output, _repeated_enumArray_codec);
693
    }
694

695 696 697
    public int CalculateSize() {
      int size = 0;
      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 != global::UnitTest.Issues.TestProtos.DeprecatedEnum.DEPRECATED_ZERO) {
706
        size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) EnumValue);
707
      }
708
      size += enumArray_.CalculateSize(_repeated_enumArray_codec);
709 710
      return size;
    }
711

712 713 714 715 716 717 718 719 720 721 722
    public void MergeFrom(DeprecatedFieldsMessage other) {
      if (other == null) {
        return;
      }
      if (other.PrimitiveValue != 0) {
        PrimitiveValue = other.PrimitiveValue;
      }
      primitiveArray_.Add(other.primitiveArray_);
      if (other.messageValue_ != null) {
        if (messageValue_ == null) {
          messageValue_ = new global::UnitTest.Issues.TestProtos.DeprecatedChild();
723
        }
724
        MessageValue.MergeFrom(other.MessageValue);
725
      }
726 727 728
      messageArray_.Add(other.messageArray_);
      if (other.EnumValue != global::UnitTest.Issues.TestProtos.DeprecatedEnum.DEPRECATED_ZERO) {
        EnumValue = other.EnumValue;
729
      }
730 731
      enumArray_.Add(other.enumArray_);
    }
732

Jon Skeet's avatar
Jon Skeet committed
733
    public void MergeFrom(pb::CodedInputStream input) {
734
      uint tag;
Jon Skeet's avatar
Jon Skeet committed
735
      while (input.ReadTag(out tag)) {
736 737 738 739 740 741
        switch(tag) {
          case 0:
            throw pb::InvalidProtocolBufferException.InvalidTag();
          default:
            if (pb::WireFormat.IsEndGroupTag(tag)) {
              return;
742
            }
743 744
            break;
          case 8: {
Jon Skeet's avatar
Jon Skeet committed
745
            PrimitiveValue = input.ReadInt32();
746 747 748 749
            break;
          }
          case 18:
          case 16: {
750
            primitiveArray_.AddEntriesFrom(input, _repeated_primitiveArray_codec);
751 752 753 754 755
            break;
          }
          case 26: {
            if (messageValue_ == null) {
              messageValue_ = new global::UnitTest.Issues.TestProtos.DeprecatedChild();
756
            }
757 758 759 760
            input.ReadMessage(messageValue_);
            break;
          }
          case 34: {
761
            messageArray_.AddEntriesFrom(input, _repeated_messageArray_codec);
762 763 764
            break;
          }
          case 40: {
Jon Skeet's avatar
Jon Skeet committed
765 766
            enumValue_ = (global::UnitTest.Issues.TestProtos.DeprecatedEnum) input.ReadEnum();
            break;
767 768 769
          }
          case 50:
          case 48: {
770
            enumArray_.AddEntriesFrom(input, _repeated_enumArray_codec);
771
            break;
772 773 774 775
          }
        }
      }
    }
776

777 778 779
  }

  [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
780
  public sealed partial class ItemField : pb::IMessage<ItemField> {
781 782
    private static readonly pb::MessageParser<ItemField> _parser = new pb::MessageParser<ItemField>(() => new ItemField());
    public static pb::MessageParser<ItemField> Parser { get { return _parser; } }
783

784
    public static pbr::MessageDescriptor Descriptor {
785
      get { return global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor.MessageTypes[4]; }
786 787
    }

788 789
    pbr::MessageDescriptor pb::IMessage.Descriptor {
      get { return Descriptor; }
790 791
    }

792 793 794 795 796
    public ItemField() {
      OnConstruction();
    }

    partial void OnConstruction();
Jon Skeet's avatar
Jon Skeet committed
797

798
    public ItemField(ItemField other) : this() {
Jon Skeet's avatar
Jon Skeet committed
799 800 801 802 803
      item_ = other.item_;
    }

    public ItemField Clone() {
      return new ItemField(this);
804
    }
Jon Skeet's avatar
Jon Skeet committed
805

806 807 808 809
    public const int ItemFieldNumber = 1;
    private int item_;
    public int Item {
      get { return item_; }
810 811 812
      set {
        item_ = value;
      }
813 814
    }

815 816
    public override bool Equals(object other) {
      return Equals(other as ItemField);
817 818
    }

819 820 821 822 823
    public bool Equals(ItemField other) {
      if (ReferenceEquals(other, null)) {
        return false;
      }
      if (ReferenceEquals(other, this)) {
824 825
        return true;
      }
826 827
      if (Item != other.Item) return false;
      return true;
828 829
    }

830
    public override int GetHashCode() {
831
      int hash = 1;
832 833
      if (Item != 0) hash ^= Item.GetHashCode();
      return hash;
834
    }
835 836 837 838

    public override string ToString() {
      return pb::JsonFormatter.Default.Format(this);
    }
839

Jon Skeet's avatar
Jon Skeet committed
840
    public void WriteTo(pb::CodedOutputStream output) {
841
      if (Item != 0) {
842 843
        output.WriteRawTag(8);
        output.WriteInt32(Item);
844 845 846
      }
    }

847 848 849
    public int CalculateSize() {
      int size = 0;
      if (Item != 0) {
850
        size += 1 + pb::CodedOutputStream.ComputeInt32Size(Item);
851
      }
852 853
      return size;
    }
854

855 856 857 858 859 860 861 862 863
    public void MergeFrom(ItemField other) {
      if (other == null) {
        return;
      }
      if (other.Item != 0) {
        Item = other.Item;
      }
    }

Jon Skeet's avatar
Jon Skeet committed
864
    public void MergeFrom(pb::CodedInputStream input) {
865
      uint tag;
Jon Skeet's avatar
Jon Skeet committed
866
      while (input.ReadTag(out tag)) {
867 868 869 870 871 872 873 874 875
        switch(tag) {
          case 0:
            throw pb::InvalidProtocolBufferException.InvalidTag();
          default:
            if (pb::WireFormat.IsEndGroupTag(tag)) {
              return;
            }
            break;
          case 8: {
Jon Skeet's avatar
Jon Skeet committed
876
            Item = input.ReadInt32();
877
            break;
878 879 880 881 882 883 884
          }
        }
      }
    }

  }

885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102
  [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  public sealed partial class ReservedNames : pb::IMessage<ReservedNames> {
    private static readonly pb::MessageParser<ReservedNames> _parser = new pb::MessageParser<ReservedNames>(() => new ReservedNames());
    public static pb::MessageParser<ReservedNames> Parser { get { return _parser; } }

    public static pbr::MessageDescriptor Descriptor {
      get { return global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor.MessageTypes[5]; }
    }

    pbr::MessageDescriptor pb::IMessage.Descriptor {
      get { return Descriptor; }
    }

    public ReservedNames() {
      OnConstruction();
    }

    partial void OnConstruction();

    public ReservedNames(ReservedNames other) : this() {
      types_ = other.types_;
      descriptor_ = other.descriptor_;
    }

    public ReservedNames Clone() {
      return new ReservedNames(this);
    }

    public const int Types_FieldNumber = 1;
    private int types_;
    public int Types_ {
      get { return types_; }
      set {
        types_ = value;
      }
    }

    public const int Descriptor_FieldNumber = 2;
    private int descriptor_;
    public int Descriptor_ {
      get { return descriptor_; }
      set {
        descriptor_ = value;
      }
    }

    public override bool Equals(object other) {
      return Equals(other as ReservedNames);
    }

    public bool Equals(ReservedNames other) {
      if (ReferenceEquals(other, null)) {
        return false;
      }
      if (ReferenceEquals(other, this)) {
        return true;
      }
      if (Types_ != other.Types_) return false;
      if (Descriptor_ != other.Descriptor_) return false;
      return true;
    }

    public override int GetHashCode() {
      int hash = 1;
      if (Types_ != 0) hash ^= Types_.GetHashCode();
      if (Descriptor_ != 0) hash ^= Descriptor_.GetHashCode();
      return hash;
    }

    public override string ToString() {
      return pb::JsonFormatter.Default.Format(this);
    }

    public void WriteTo(pb::CodedOutputStream output) {
      if (Types_ != 0) {
        output.WriteRawTag(8);
        output.WriteInt32(Types_);
      }
      if (Descriptor_ != 0) {
        output.WriteRawTag(16);
        output.WriteInt32(Descriptor_);
      }
    }

    public int CalculateSize() {
      int size = 0;
      if (Types_ != 0) {
        size += 1 + pb::CodedOutputStream.ComputeInt32Size(Types_);
      }
      if (Descriptor_ != 0) {
        size += 1 + pb::CodedOutputStream.ComputeInt32Size(Descriptor_);
      }
      return size;
    }

    public void MergeFrom(ReservedNames other) {
      if (other == null) {
        return;
      }
      if (other.Types_ != 0) {
        Types_ = other.Types_;
      }
      if (other.Descriptor_ != 0) {
        Descriptor_ = other.Descriptor_;
      }
    }

    public void MergeFrom(pb::CodedInputStream input) {
      uint tag;
      while (input.ReadTag(out tag)) {
        switch(tag) {
          case 0:
            throw pb::InvalidProtocolBufferException.InvalidTag();
          default:
            if (pb::WireFormat.IsEndGroupTag(tag)) {
              return;
            }
            break;
          case 8: {
            Types_ = input.ReadInt32();
            break;
          }
          case 16: {
            Descriptor_ = input.ReadInt32();
            break;
          }
        }
      }
    }

    #region Nested types
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    public static partial class Types {
      [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
      public sealed partial class SomeNestedType : pb::IMessage<SomeNestedType> {
        private static readonly pb::MessageParser<SomeNestedType> _parser = new pb::MessageParser<SomeNestedType>(() => new SomeNestedType());
        public static pb::MessageParser<SomeNestedType> Parser { get { return _parser; } }

        public static pbr::MessageDescriptor Descriptor {
          get { return global::UnitTest.Issues.TestProtos.ReservedNames.Descriptor.NestedTypes[0]; }
        }

        pbr::MessageDescriptor pb::IMessage.Descriptor {
          get { return Descriptor; }
        }

        public SomeNestedType() {
          OnConstruction();
        }

        partial void OnConstruction();

        public SomeNestedType(SomeNestedType other) : this() {
        }

        public SomeNestedType Clone() {
          return new SomeNestedType(this);
        }

        public override bool Equals(object other) {
          return Equals(other as SomeNestedType);
        }

        public bool Equals(SomeNestedType other) {
          if (ReferenceEquals(other, null)) {
            return false;
          }
          if (ReferenceEquals(other, this)) {
            return true;
          }
          return true;
        }

        public override int GetHashCode() {
          int hash = 1;
          return hash;
        }

        public override string ToString() {
          return pb::JsonFormatter.Default.Format(this);
        }

        public void WriteTo(pb::CodedOutputStream output) {
        }

        public int CalculateSize() {
          int size = 0;
          return size;
        }

        public void MergeFrom(SomeNestedType other) {
          if (other == null) {
            return;
          }
        }

        public void MergeFrom(pb::CodedInputStream input) {
          uint tag;
          while (input.ReadTag(out tag)) {
            switch(tag) {
              case 0:
                throw pb::InvalidProtocolBufferException.InvalidTag();
              default:
                if (pb::WireFormat.IsEndGroupTag(tag)) {
                  return;
                }
                break;
            }
          }
        }

      }

    }
    #endregion

  }

1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390
  [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  public sealed partial class TestJsonFieldOrdering : pb::IMessage<TestJsonFieldOrdering> {
    private static readonly pb::MessageParser<TestJsonFieldOrdering> _parser = new pb::MessageParser<TestJsonFieldOrdering>(() => new TestJsonFieldOrdering());
    public static pb::MessageParser<TestJsonFieldOrdering> Parser { get { return _parser; } }

    public static pbr::MessageDescriptor Descriptor {
      get { return global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor.MessageTypes[6]; }
    }

    pbr::MessageDescriptor pb::IMessage.Descriptor {
      get { return Descriptor; }
    }

    public TestJsonFieldOrdering() {
      OnConstruction();
    }

    partial void OnConstruction();

    public TestJsonFieldOrdering(TestJsonFieldOrdering other) : this() {
      plainInt32_ = other.plainInt32_;
      plainString_ = other.plainString_;
      switch (other.O1Case) {
        case O1OneofCase.O1String:
          O1String = other.O1String;
          break;
        case O1OneofCase.O1Int32:
          O1Int32 = other.O1Int32;
          break;
      }

      switch (other.O2Case) {
        case O2OneofCase.O2Int32:
          O2Int32 = other.O2Int32;
          break;
        case O2OneofCase.O2String:
          O2String = other.O2String;
          break;
      }

    }

    public TestJsonFieldOrdering Clone() {
      return new TestJsonFieldOrdering(this);
    }

    public const int PlainInt32FieldNumber = 4;
    private int plainInt32_;
    public int PlainInt32 {
      get { return plainInt32_; }
      set {
        plainInt32_ = value;
      }
    }

    public const int O1StringFieldNumber = 2;
    public string O1String {
      get { return o1Case_ == O1OneofCase.O1String ? (string) o1_ : ""; }
      set {
        o1_ = pb::Preconditions.CheckNotNull(value, "value");
        o1Case_ = O1OneofCase.O1String;
      }
    }

    public const int O1Int32FieldNumber = 5;
    public int O1Int32 {
      get { return o1Case_ == O1OneofCase.O1Int32 ? (int) o1_ : 0; }
      set {
        o1_ = value;
        o1Case_ = O1OneofCase.O1Int32;
      }
    }

    public const int PlainStringFieldNumber = 1;
    private string plainString_ = "";
    public string PlainString {
      get { return plainString_; }
      set {
        plainString_ = pb::Preconditions.CheckNotNull(value, "value");
      }
    }

    public const int O2Int32FieldNumber = 6;
    public int O2Int32 {
      get { return o2Case_ == O2OneofCase.O2Int32 ? (int) o2_ : 0; }
      set {
        o2_ = value;
        o2Case_ = O2OneofCase.O2Int32;
      }
    }

    public const int O2StringFieldNumber = 3;
    public string O2String {
      get { return o2Case_ == O2OneofCase.O2String ? (string) o2_ : ""; }
      set {
        o2_ = pb::Preconditions.CheckNotNull(value, "value");
        o2Case_ = O2OneofCase.O2String;
      }
    }

    private object o1_;
    public enum O1OneofCase {
      None = 0,
      O1String = 2,
      O1Int32 = 5,
    }
    private O1OneofCase o1Case_ = O1OneofCase.None;
    public O1OneofCase O1Case {
      get { return o1Case_; }
    }

    public void ClearO1() {
      o1Case_ = O1OneofCase.None;
      o1_ = null;
    }

    private object o2_;
    public enum O2OneofCase {
      None = 0,
      O2Int32 = 6,
      O2String = 3,
    }
    private O2OneofCase o2Case_ = O2OneofCase.None;
    public O2OneofCase O2Case {
      get { return o2Case_; }
    }

    public void ClearO2() {
      o2Case_ = O2OneofCase.None;
      o2_ = null;
    }

    public override bool Equals(object other) {
      return Equals(other as TestJsonFieldOrdering);
    }

    public bool Equals(TestJsonFieldOrdering other) {
      if (ReferenceEquals(other, null)) {
        return false;
      }
      if (ReferenceEquals(other, this)) {
        return true;
      }
      if (PlainInt32 != other.PlainInt32) return false;
      if (O1String != other.O1String) return false;
      if (O1Int32 != other.O1Int32) return false;
      if (PlainString != other.PlainString) return false;
      if (O2Int32 != other.O2Int32) return false;
      if (O2String != other.O2String) return false;
      return true;
    }

    public override int GetHashCode() {
      int hash = 1;
      if (PlainInt32 != 0) hash ^= PlainInt32.GetHashCode();
      if (o1Case_ == O1OneofCase.O1String) hash ^= O1String.GetHashCode();
      if (o1Case_ == O1OneofCase.O1Int32) hash ^= O1Int32.GetHashCode();
      if (PlainString.Length != 0) hash ^= PlainString.GetHashCode();
      if (o2Case_ == O2OneofCase.O2Int32) hash ^= O2Int32.GetHashCode();
      if (o2Case_ == O2OneofCase.O2String) hash ^= O2String.GetHashCode();
      return hash;
    }

    public override string ToString() {
      return pb::JsonFormatter.Default.Format(this);
    }

    public void WriteTo(pb::CodedOutputStream output) {
      if (PlainString.Length != 0) {
        output.WriteRawTag(10);
        output.WriteString(PlainString);
      }
      if (o1Case_ == O1OneofCase.O1String) {
        output.WriteRawTag(18);
        output.WriteString(O1String);
      }
      if (o2Case_ == O2OneofCase.O2String) {
        output.WriteRawTag(26);
        output.WriteString(O2String);
      }
      if (PlainInt32 != 0) {
        output.WriteRawTag(32);
        output.WriteInt32(PlainInt32);
      }
      if (o1Case_ == O1OneofCase.O1Int32) {
        output.WriteRawTag(40);
        output.WriteInt32(O1Int32);
      }
      if (o2Case_ == O2OneofCase.O2Int32) {
        output.WriteRawTag(48);
        output.WriteInt32(O2Int32);
      }
    }

    public int CalculateSize() {
      int size = 0;
      if (PlainInt32 != 0) {
        size += 1 + pb::CodedOutputStream.ComputeInt32Size(PlainInt32);
      }
      if (o1Case_ == O1OneofCase.O1String) {
        size += 1 + pb::CodedOutputStream.ComputeStringSize(O1String);
      }
      if (o1Case_ == O1OneofCase.O1Int32) {
        size += 1 + pb::CodedOutputStream.ComputeInt32Size(O1Int32);
      }
      if (PlainString.Length != 0) {
        size += 1 + pb::CodedOutputStream.ComputeStringSize(PlainString);
      }
      if (o2Case_ == O2OneofCase.O2Int32) {
        size += 1 + pb::CodedOutputStream.ComputeInt32Size(O2Int32);
      }
      if (o2Case_ == O2OneofCase.O2String) {
        size += 1 + pb::CodedOutputStream.ComputeStringSize(O2String);
      }
      return size;
    }

    public void MergeFrom(TestJsonFieldOrdering other) {
      if (other == null) {
        return;
      }
      if (other.PlainInt32 != 0) {
        PlainInt32 = other.PlainInt32;
      }
      if (other.PlainString.Length != 0) {
        PlainString = other.PlainString;
      }
      switch (other.O1Case) {
        case O1OneofCase.O1String:
          O1String = other.O1String;
          break;
        case O1OneofCase.O1Int32:
          O1Int32 = other.O1Int32;
          break;
      }

      switch (other.O2Case) {
        case O2OneofCase.O2Int32:
          O2Int32 = other.O2Int32;
          break;
        case O2OneofCase.O2String:
          O2String = other.O2String;
          break;
      }

    }

    public void MergeFrom(pb::CodedInputStream input) {
      uint tag;
      while (input.ReadTag(out tag)) {
        switch(tag) {
          case 0:
            throw pb::InvalidProtocolBufferException.InvalidTag();
          default:
            if (pb::WireFormat.IsEndGroupTag(tag)) {
              return;
            }
            break;
          case 10: {
            PlainString = input.ReadString();
            break;
          }
          case 18: {
            O1String = input.ReadString();
            break;
          }
          case 26: {
            O2String = input.ReadString();
            break;
          }
          case 32: {
            PlainInt32 = input.ReadInt32();
            break;
          }
          case 40: {
            O1Int32 = input.ReadInt32();
            break;
          }
          case 48: {
            O2Int32 = input.ReadInt32();
            break;
          }
        }
      }
    }

  }

1391 1392 1393 1394 1395
  #endregion

}

#endregion Designer generated code