• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // <auto-generated>
2 //     Generated by the protocol buffer compiler.  DO NOT EDIT!
3 //     source: google/protobuf/unittest_proto3_optional.proto
4 // </auto-generated>
5 #pragma warning disable 1591, 0612, 3021
6 #region Designer generated code
7 
8 using pb = global::Google.Protobuf;
9 using pbc = global::Google.Protobuf.Collections;
10 using pbr = global::Google.Protobuf.Reflection;
11 using scg = global::System.Collections.Generic;
12 namespace ProtobufUnittest {
13 
14   /// <summary>Holder for reflection information generated from google/protobuf/unittest_proto3_optional.proto</summary>
15   public static partial class UnittestProto3OptionalReflection {
16 
17     #region Descriptor
18     /// <summary>File descriptor for google/protobuf/unittest_proto3_optional.proto</summary>
19     public static pbr::FileDescriptor Descriptor {
20       get { return descriptor; }
21     }
22     private static pbr::FileDescriptor descriptor;
23 
UnittestProto3OptionalReflection()24     static UnittestProto3OptionalReflection() {
25       byte[] descriptorData = global::System.Convert.FromBase64String(
26           string.Concat(
27             "Ci5nb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfcHJvdG8zX29wdGlvbmFsLnBy",
28             "b3RvEhFwcm90b2J1Zl91bml0dGVzdCKxCgoSVGVzdFByb3RvM09wdGlvbmFs",
29             "EhsKDm9wdGlvbmFsX2ludDMyGAEgASgFSACIAQESGwoOb3B0aW9uYWxfaW50",
30             "NjQYAiABKANIAYgBARIcCg9vcHRpb25hbF91aW50MzIYAyABKA1IAogBARIc",
31             "Cg9vcHRpb25hbF91aW50NjQYBCABKARIA4gBARIcCg9vcHRpb25hbF9zaW50",
32             "MzIYBSABKBFIBIgBARIcCg9vcHRpb25hbF9zaW50NjQYBiABKBJIBYgBARId",
33             "ChBvcHRpb25hbF9maXhlZDMyGAcgASgHSAaIAQESHQoQb3B0aW9uYWxfZml4",
34             "ZWQ2NBgIIAEoBkgHiAEBEh4KEW9wdGlvbmFsX3NmaXhlZDMyGAkgASgPSAiI",
35             "AQESHgoRb3B0aW9uYWxfc2ZpeGVkNjQYCiABKBBICYgBARIbCg5vcHRpb25h",
36             "bF9mbG9hdBgLIAEoAkgKiAEBEhwKD29wdGlvbmFsX2RvdWJsZRgMIAEoAUgL",
37             "iAEBEhoKDW9wdGlvbmFsX2Jvb2wYDSABKAhIDIgBARIcCg9vcHRpb25hbF9z",
38             "dHJpbmcYDiABKAlIDYgBARIbCg5vcHRpb25hbF9ieXRlcxgPIAEoDEgOiAEB",
39             "Eh4KDW9wdGlvbmFsX2NvcmQYECABKAlCAggBSA+IAQESWQoXb3B0aW9uYWxf",
40             "bmVzdGVkX21lc3NhZ2UYEiABKAsyMy5wcm90b2J1Zl91bml0dGVzdC5UZXN0",
41             "UHJvdG8zT3B0aW9uYWwuTmVzdGVkTWVzc2FnZUgQiAEBElkKE2xhenlfbmVz",
42             "dGVkX21lc3NhZ2UYEyABKAsyMy5wcm90b2J1Zl91bml0dGVzdC5UZXN0UHJv",
43             "dG8zT3B0aW9uYWwuTmVzdGVkTWVzc2FnZUICKAFIEYgBARJTChRvcHRpb25h",
44             "bF9uZXN0ZWRfZW51bRgVIAEoDjIwLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RQ",
45             "cm90bzNPcHRpb25hbC5OZXN0ZWRFbnVtSBKIAQESFgoOc2luZ3VsYXJfaW50",
46             "MzIYFiABKAUSFgoOc2luZ3VsYXJfaW50NjQYFyABKAMaJwoNTmVzdGVkTWVz",
47             "c2FnZRIPCgJiYhgBIAEoBUgAiAEBQgUKA19iYiJKCgpOZXN0ZWRFbnVtEg8K",
48             "C1VOU1BFQ0lGSUVEEAASBwoDRk9PEAESBwoDQkFSEAISBwoDQkFaEAMSEAoD",
49             "TkVHEP///////////wFCEQoPX29wdGlvbmFsX2ludDMyQhEKD19vcHRpb25h",
50             "bF9pbnQ2NEISChBfb3B0aW9uYWxfdWludDMyQhIKEF9vcHRpb25hbF91aW50",
51             "NjRCEgoQX29wdGlvbmFsX3NpbnQzMkISChBfb3B0aW9uYWxfc2ludDY0QhMK",
52             "EV9vcHRpb25hbF9maXhlZDMyQhMKEV9vcHRpb25hbF9maXhlZDY0QhQKEl9v",
53             "cHRpb25hbF9zZml4ZWQzMkIUChJfb3B0aW9uYWxfc2ZpeGVkNjRCEQoPX29w",
54             "dGlvbmFsX2Zsb2F0QhIKEF9vcHRpb25hbF9kb3VibGVCEAoOX29wdGlvbmFs",
55             "X2Jvb2xCEgoQX29wdGlvbmFsX3N0cmluZ0IRCg9fb3B0aW9uYWxfYnl0ZXNC",
56             "EAoOX29wdGlvbmFsX2NvcmRCGgoYX29wdGlvbmFsX25lc3RlZF9tZXNzYWdl",
57             "QhYKFF9sYXp5X25lc3RlZF9tZXNzYWdlQhcKFV9vcHRpb25hbF9uZXN0ZWRf",
58             "ZW51bUIlCiFjb20uZ29vZ2xlLnByb3RvYnVmLnRlc3RpbmcucHJvdG9QAWIG",
59             "cHJvdG8z"));
60       descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
61           new pbr::FileDescriptor[] { },
62           new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
63             new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufUnittest.TestProto3Optional), global::ProtobufUnittest.TestProto3Optional.Parser, new[]{ "OptionalInt32", "OptionalInt64", "OptionalUint32", "OptionalUint64", "OptionalSint32", "OptionalSint64", "OptionalFixed32", "OptionalFixed64", "OptionalSfixed32", "OptionalSfixed64", "OptionalFloat", "OptionalDouble", "OptionalBool", "OptionalString", "OptionalBytes", "OptionalCord", "OptionalNestedMessage", "LazyNestedMessage", "OptionalNestedEnum", "SingularInt32", "SingularInt64" }, new[]{ "OptionalInt32", "OptionalInt64", "OptionalUint32", "OptionalUint64", "OptionalSint32", "OptionalSint64", "OptionalFixed32", "OptionalFixed64", "OptionalSfixed32", "OptionalSfixed64", "OptionalFloat", "OptionalDouble", "OptionalBool", "OptionalString", "OptionalBytes", "OptionalCord", "OptionalNestedMessage", "LazyNestedMessage", "OptionalNestedEnum" }, new[]{ typeof(global::ProtobufUnittest.TestProto3Optional.Types.NestedEnum) }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage), global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage.Parser, new[]{ "Bb" }, new[]{ "Bb" }, null, null, null)})
64           }));
65     }
66     #endregion
67 
68   }
69   #region Messages
70   public sealed partial class TestProto3Optional : pb::IMessage<TestProto3Optional>
71   #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
72       , pb::IBufferMessage
73   #endif
74   {
75     private static readonly pb::MessageParser<TestProto3Optional> _parser = new pb::MessageParser<TestProto3Optional>(() => new TestProto3Optional());
76     private pb::UnknownFieldSet _unknownFields;
77     private int _hasBits0;
78     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
79     public static pb::MessageParser<TestProto3Optional> Parser { get { return _parser; } }
80 
81     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
82     public static pbr::MessageDescriptor Descriptor {
83       get { return global::ProtobufUnittest.UnittestProto3OptionalReflection.Descriptor.MessageTypes[0]; }
84     }
85 
86     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
87     pbr::MessageDescriptor pb::IMessage.Descriptor {
88       get { return Descriptor; }
89     }
90 
91     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
TestProto3Optional()92     public TestProto3Optional() {
93       OnConstruction();
94     }
95 
OnConstruction()96     partial void OnConstruction();
97 
98     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
TestProto3Optional(TestProto3Optional other)99     public TestProto3Optional(TestProto3Optional other) : this() {
100       _hasBits0 = other._hasBits0;
101       optionalInt32_ = other.optionalInt32_;
102       optionalInt64_ = other.optionalInt64_;
103       optionalUint32_ = other.optionalUint32_;
104       optionalUint64_ = other.optionalUint64_;
105       optionalSint32_ = other.optionalSint32_;
106       optionalSint64_ = other.optionalSint64_;
107       optionalFixed32_ = other.optionalFixed32_;
108       optionalFixed64_ = other.optionalFixed64_;
109       optionalSfixed32_ = other.optionalSfixed32_;
110       optionalSfixed64_ = other.optionalSfixed64_;
111       optionalFloat_ = other.optionalFloat_;
112       optionalDouble_ = other.optionalDouble_;
113       optionalBool_ = other.optionalBool_;
114       optionalString_ = other.optionalString_;
115       optionalBytes_ = other.optionalBytes_;
116       optionalCord_ = other.optionalCord_;
117       optionalNestedMessage_ = other.optionalNestedMessage_ != null ? other.optionalNestedMessage_.Clone() : null;
118       lazyNestedMessage_ = other.lazyNestedMessage_ != null ? other.lazyNestedMessage_.Clone() : null;
119       optionalNestedEnum_ = other.optionalNestedEnum_;
120       singularInt32_ = other.singularInt32_;
121       singularInt64_ = other.singularInt64_;
122       _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
123     }
124 
125     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Clone()126     public TestProto3Optional Clone() {
127       return new TestProto3Optional(this);
128     }
129 
130     /// <summary>Field number for the "optional_int32" field.</summary>
131     public const int OptionalInt32FieldNumber = 1;
132     private int optionalInt32_;
133     /// <summary>
134     /// Singular
135     /// </summary>
136     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
137     public int OptionalInt32 {
138       get { if ((_hasBits0 & 1) != 0) { return optionalInt32_; } else { return 0; } }
139       set {
140         _hasBits0 |= 1;
141         optionalInt32_ = value;
142       }
143     }
144     /// <summary>Gets whether the "optional_int32" field is set</summary>
145     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
146     public bool HasOptionalInt32 {
147       get { return (_hasBits0 & 1) != 0; }
148     }
149     /// <summary>Clears the value of the "optional_int32" field</summary>
150     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
ClearOptionalInt32()151     public void ClearOptionalInt32() {
152       _hasBits0 &= ~1;
153     }
154 
155     /// <summary>Field number for the "optional_int64" field.</summary>
156     public const int OptionalInt64FieldNumber = 2;
157     private long optionalInt64_;
158     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
159     public long OptionalInt64 {
160       get { if ((_hasBits0 & 2) != 0) { return optionalInt64_; } else { return 0L; } }
161       set {
162         _hasBits0 |= 2;
163         optionalInt64_ = value;
164       }
165     }
166     /// <summary>Gets whether the "optional_int64" field is set</summary>
167     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
168     public bool HasOptionalInt64 {
169       get { return (_hasBits0 & 2) != 0; }
170     }
171     /// <summary>Clears the value of the "optional_int64" field</summary>
172     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
ClearOptionalInt64()173     public void ClearOptionalInt64() {
174       _hasBits0 &= ~2;
175     }
176 
177     /// <summary>Field number for the "optional_uint32" field.</summary>
178     public const int OptionalUint32FieldNumber = 3;
179     private uint optionalUint32_;
180     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
181     public uint OptionalUint32 {
182       get { if ((_hasBits0 & 4) != 0) { return optionalUint32_; } else { return 0; } }
183       set {
184         _hasBits0 |= 4;
185         optionalUint32_ = value;
186       }
187     }
188     /// <summary>Gets whether the "optional_uint32" field is set</summary>
189     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
190     public bool HasOptionalUint32 {
191       get { return (_hasBits0 & 4) != 0; }
192     }
193     /// <summary>Clears the value of the "optional_uint32" field</summary>
194     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
ClearOptionalUint32()195     public void ClearOptionalUint32() {
196       _hasBits0 &= ~4;
197     }
198 
199     /// <summary>Field number for the "optional_uint64" field.</summary>
200     public const int OptionalUint64FieldNumber = 4;
201     private ulong optionalUint64_;
202     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
203     public ulong OptionalUint64 {
204       get { if ((_hasBits0 & 8) != 0) { return optionalUint64_; } else { return 0UL; } }
205       set {
206         _hasBits0 |= 8;
207         optionalUint64_ = value;
208       }
209     }
210     /// <summary>Gets whether the "optional_uint64" field is set</summary>
211     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
212     public bool HasOptionalUint64 {
213       get { return (_hasBits0 & 8) != 0; }
214     }
215     /// <summary>Clears the value of the "optional_uint64" field</summary>
216     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
ClearOptionalUint64()217     public void ClearOptionalUint64() {
218       _hasBits0 &= ~8;
219     }
220 
221     /// <summary>Field number for the "optional_sint32" field.</summary>
222     public const int OptionalSint32FieldNumber = 5;
223     private int optionalSint32_;
224     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
225     public int OptionalSint32 {
226       get { if ((_hasBits0 & 16) != 0) { return optionalSint32_; } else { return 0; } }
227       set {
228         _hasBits0 |= 16;
229         optionalSint32_ = value;
230       }
231     }
232     /// <summary>Gets whether the "optional_sint32" field is set</summary>
233     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
234     public bool HasOptionalSint32 {
235       get { return (_hasBits0 & 16) != 0; }
236     }
237     /// <summary>Clears the value of the "optional_sint32" field</summary>
238     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
ClearOptionalSint32()239     public void ClearOptionalSint32() {
240       _hasBits0 &= ~16;
241     }
242 
243     /// <summary>Field number for the "optional_sint64" field.</summary>
244     public const int OptionalSint64FieldNumber = 6;
245     private long optionalSint64_;
246     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
247     public long OptionalSint64 {
248       get { if ((_hasBits0 & 32) != 0) { return optionalSint64_; } else { return 0L; } }
249       set {
250         _hasBits0 |= 32;
251         optionalSint64_ = value;
252       }
253     }
254     /// <summary>Gets whether the "optional_sint64" field is set</summary>
255     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
256     public bool HasOptionalSint64 {
257       get { return (_hasBits0 & 32) != 0; }
258     }
259     /// <summary>Clears the value of the "optional_sint64" field</summary>
260     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
ClearOptionalSint64()261     public void ClearOptionalSint64() {
262       _hasBits0 &= ~32;
263     }
264 
265     /// <summary>Field number for the "optional_fixed32" field.</summary>
266     public const int OptionalFixed32FieldNumber = 7;
267     private uint optionalFixed32_;
268     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
269     public uint OptionalFixed32 {
270       get { if ((_hasBits0 & 64) != 0) { return optionalFixed32_; } else { return 0; } }
271       set {
272         _hasBits0 |= 64;
273         optionalFixed32_ = value;
274       }
275     }
276     /// <summary>Gets whether the "optional_fixed32" field is set</summary>
277     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
278     public bool HasOptionalFixed32 {
279       get { return (_hasBits0 & 64) != 0; }
280     }
281     /// <summary>Clears the value of the "optional_fixed32" field</summary>
282     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
ClearOptionalFixed32()283     public void ClearOptionalFixed32() {
284       _hasBits0 &= ~64;
285     }
286 
287     /// <summary>Field number for the "optional_fixed64" field.</summary>
288     public const int OptionalFixed64FieldNumber = 8;
289     private ulong optionalFixed64_;
290     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
291     public ulong OptionalFixed64 {
292       get { if ((_hasBits0 & 128) != 0) { return optionalFixed64_; } else { return 0UL; } }
293       set {
294         _hasBits0 |= 128;
295         optionalFixed64_ = value;
296       }
297     }
298     /// <summary>Gets whether the "optional_fixed64" field is set</summary>
299     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
300     public bool HasOptionalFixed64 {
301       get { return (_hasBits0 & 128) != 0; }
302     }
303     /// <summary>Clears the value of the "optional_fixed64" field</summary>
304     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
ClearOptionalFixed64()305     public void ClearOptionalFixed64() {
306       _hasBits0 &= ~128;
307     }
308 
309     /// <summary>Field number for the "optional_sfixed32" field.</summary>
310     public const int OptionalSfixed32FieldNumber = 9;
311     private int optionalSfixed32_;
312     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
313     public int OptionalSfixed32 {
314       get { if ((_hasBits0 & 256) != 0) { return optionalSfixed32_; } else { return 0; } }
315       set {
316         _hasBits0 |= 256;
317         optionalSfixed32_ = value;
318       }
319     }
320     /// <summary>Gets whether the "optional_sfixed32" field is set</summary>
321     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
322     public bool HasOptionalSfixed32 {
323       get { return (_hasBits0 & 256) != 0; }
324     }
325     /// <summary>Clears the value of the "optional_sfixed32" field</summary>
326     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
ClearOptionalSfixed32()327     public void ClearOptionalSfixed32() {
328       _hasBits0 &= ~256;
329     }
330 
331     /// <summary>Field number for the "optional_sfixed64" field.</summary>
332     public const int OptionalSfixed64FieldNumber = 10;
333     private long optionalSfixed64_;
334     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
335     public long OptionalSfixed64 {
336       get { if ((_hasBits0 & 512) != 0) { return optionalSfixed64_; } else { return 0L; } }
337       set {
338         _hasBits0 |= 512;
339         optionalSfixed64_ = value;
340       }
341     }
342     /// <summary>Gets whether the "optional_sfixed64" field is set</summary>
343     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
344     public bool HasOptionalSfixed64 {
345       get { return (_hasBits0 & 512) != 0; }
346     }
347     /// <summary>Clears the value of the "optional_sfixed64" field</summary>
348     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
ClearOptionalSfixed64()349     public void ClearOptionalSfixed64() {
350       _hasBits0 &= ~512;
351     }
352 
353     /// <summary>Field number for the "optional_float" field.</summary>
354     public const int OptionalFloatFieldNumber = 11;
355     private float optionalFloat_;
356     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
357     public float OptionalFloat {
358       get { if ((_hasBits0 & 1024) != 0) { return optionalFloat_; } else { return 0F; } }
359       set {
360         _hasBits0 |= 1024;
361         optionalFloat_ = value;
362       }
363     }
364     /// <summary>Gets whether the "optional_float" field is set</summary>
365     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
366     public bool HasOptionalFloat {
367       get { return (_hasBits0 & 1024) != 0; }
368     }
369     /// <summary>Clears the value of the "optional_float" field</summary>
370     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
ClearOptionalFloat()371     public void ClearOptionalFloat() {
372       _hasBits0 &= ~1024;
373     }
374 
375     /// <summary>Field number for the "optional_double" field.</summary>
376     public const int OptionalDoubleFieldNumber = 12;
377     private double optionalDouble_;
378     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
379     public double OptionalDouble {
380       get { if ((_hasBits0 & 2048) != 0) { return optionalDouble_; } else { return 0D; } }
381       set {
382         _hasBits0 |= 2048;
383         optionalDouble_ = value;
384       }
385     }
386     /// <summary>Gets whether the "optional_double" field is set</summary>
387     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
388     public bool HasOptionalDouble {
389       get { return (_hasBits0 & 2048) != 0; }
390     }
391     /// <summary>Clears the value of the "optional_double" field</summary>
392     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
ClearOptionalDouble()393     public void ClearOptionalDouble() {
394       _hasBits0 &= ~2048;
395     }
396 
397     /// <summary>Field number for the "optional_bool" field.</summary>
398     public const int OptionalBoolFieldNumber = 13;
399     private bool optionalBool_;
400     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
401     public bool OptionalBool {
402       get { if ((_hasBits0 & 4096) != 0) { return optionalBool_; } else { return false; } }
403       set {
404         _hasBits0 |= 4096;
405         optionalBool_ = value;
406       }
407     }
408     /// <summary>Gets whether the "optional_bool" field is set</summary>
409     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
410     public bool HasOptionalBool {
411       get { return (_hasBits0 & 4096) != 0; }
412     }
413     /// <summary>Clears the value of the "optional_bool" field</summary>
414     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
ClearOptionalBool()415     public void ClearOptionalBool() {
416       _hasBits0 &= ~4096;
417     }
418 
419     /// <summary>Field number for the "optional_string" field.</summary>
420     public const int OptionalStringFieldNumber = 14;
421     private string optionalString_;
422     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
423     public string OptionalString {
424       get { return optionalString_ ?? ""; }
425       set {
426         optionalString_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
427       }
428     }
429     /// <summary>Gets whether the "optional_string" field is set</summary>
430     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
431     public bool HasOptionalString {
432       get { return optionalString_ != null; }
433     }
434     /// <summary>Clears the value of the "optional_string" field</summary>
435     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
ClearOptionalString()436     public void ClearOptionalString() {
437       optionalString_ = null;
438     }
439 
440     /// <summary>Field number for the "optional_bytes" field.</summary>
441     public const int OptionalBytesFieldNumber = 15;
442     private pb::ByteString optionalBytes_;
443     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
444     public pb::ByteString OptionalBytes {
445       get { return optionalBytes_ ?? pb::ByteString.Empty; }
446       set {
447         optionalBytes_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
448       }
449     }
450     /// <summary>Gets whether the "optional_bytes" field is set</summary>
451     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
452     public bool HasOptionalBytes {
453       get { return optionalBytes_ != null; }
454     }
455     /// <summary>Clears the value of the "optional_bytes" field</summary>
456     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
ClearOptionalBytes()457     public void ClearOptionalBytes() {
458       optionalBytes_ = null;
459     }
460 
461     /// <summary>Field number for the "optional_cord" field.</summary>
462     public const int OptionalCordFieldNumber = 16;
463     private string optionalCord_;
464     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
465     public string OptionalCord {
466       get { return optionalCord_ ?? ""; }
467       set {
468         optionalCord_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
469       }
470     }
471     /// <summary>Gets whether the "optional_cord" field is set</summary>
472     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
473     public bool HasOptionalCord {
474       get { return optionalCord_ != null; }
475     }
476     /// <summary>Clears the value of the "optional_cord" field</summary>
477     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
ClearOptionalCord()478     public void ClearOptionalCord() {
479       optionalCord_ = null;
480     }
481 
482     /// <summary>Field number for the "optional_nested_message" field.</summary>
483     public const int OptionalNestedMessageFieldNumber = 18;
484     private global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage optionalNestedMessage_;
485     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
486     public global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage OptionalNestedMessage {
487       get { return optionalNestedMessage_; }
488       set {
489         optionalNestedMessage_ = value;
490       }
491     }
492 
493     /// <summary>Field number for the "lazy_nested_message" field.</summary>
494     public const int LazyNestedMessageFieldNumber = 19;
495     private global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage lazyNestedMessage_;
496     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
497     public global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage LazyNestedMessage {
498       get { return lazyNestedMessage_; }
499       set {
500         lazyNestedMessage_ = value;
501       }
502     }
503 
504     /// <summary>Field number for the "optional_nested_enum" field.</summary>
505     public const int OptionalNestedEnumFieldNumber = 21;
506     private global::ProtobufUnittest.TestProto3Optional.Types.NestedEnum optionalNestedEnum_;
507     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
508     public global::ProtobufUnittest.TestProto3Optional.Types.NestedEnum OptionalNestedEnum {
509       get { if ((_hasBits0 & 8192) != 0) { return optionalNestedEnum_; } else { return global::ProtobufUnittest.TestProto3Optional.Types.NestedEnum.Unspecified; } }
510       set {
511         _hasBits0 |= 8192;
512         optionalNestedEnum_ = value;
513       }
514     }
515     /// <summary>Gets whether the "optional_nested_enum" field is set</summary>
516     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
517     public bool HasOptionalNestedEnum {
518       get { return (_hasBits0 & 8192) != 0; }
519     }
520     /// <summary>Clears the value of the "optional_nested_enum" field</summary>
521     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
ClearOptionalNestedEnum()522     public void ClearOptionalNestedEnum() {
523       _hasBits0 &= ~8192;
524     }
525 
526     /// <summary>Field number for the "singular_int32" field.</summary>
527     public const int SingularInt32FieldNumber = 22;
528     private int singularInt32_;
529     /// <summary>
530     /// Add some non-optional fields to verify we can mix them.
531     /// </summary>
532     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
533     public int SingularInt32 {
534       get { return singularInt32_; }
535       set {
536         singularInt32_ = value;
537       }
538     }
539 
540     /// <summary>Field number for the "singular_int64" field.</summary>
541     public const int SingularInt64FieldNumber = 23;
542     private long singularInt64_;
543     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
544     public long SingularInt64 {
545       get { return singularInt64_; }
546       set {
547         singularInt64_ = value;
548       }
549     }
550 
551     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Equals(object other)552     public override bool Equals(object other) {
553       return Equals(other as TestProto3Optional);
554     }
555 
556     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Equals(TestProto3Optional other)557     public bool Equals(TestProto3Optional other) {
558       if (ReferenceEquals(other, null)) {
559         return false;
560       }
561       if (ReferenceEquals(other, this)) {
562         return true;
563       }
564       if (OptionalInt32 != other.OptionalInt32) return false;
565       if (OptionalInt64 != other.OptionalInt64) return false;
566       if (OptionalUint32 != other.OptionalUint32) return false;
567       if (OptionalUint64 != other.OptionalUint64) return false;
568       if (OptionalSint32 != other.OptionalSint32) return false;
569       if (OptionalSint64 != other.OptionalSint64) return false;
570       if (OptionalFixed32 != other.OptionalFixed32) return false;
571       if (OptionalFixed64 != other.OptionalFixed64) return false;
572       if (OptionalSfixed32 != other.OptionalSfixed32) return false;
573       if (OptionalSfixed64 != other.OptionalSfixed64) return false;
574       if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(OptionalFloat, other.OptionalFloat)) return false;
575       if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(OptionalDouble, other.OptionalDouble)) return false;
576       if (OptionalBool != other.OptionalBool) return false;
577       if (OptionalString != other.OptionalString) return false;
578       if (OptionalBytes != other.OptionalBytes) return false;
579       if (OptionalCord != other.OptionalCord) return false;
580       if (!object.Equals(OptionalNestedMessage, other.OptionalNestedMessage)) return false;
581       if (!object.Equals(LazyNestedMessage, other.LazyNestedMessage)) return false;
582       if (OptionalNestedEnum != other.OptionalNestedEnum) return false;
583       if (SingularInt32 != other.SingularInt32) return false;
584       if (SingularInt64 != other.SingularInt64) return false;
585       return Equals(_unknownFields, other._unknownFields);
586     }
587 
588     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
GetHashCode()589     public override int GetHashCode() {
590       int hash = 1;
591       if (HasOptionalInt32) hash ^= OptionalInt32.GetHashCode();
592       if (HasOptionalInt64) hash ^= OptionalInt64.GetHashCode();
593       if (HasOptionalUint32) hash ^= OptionalUint32.GetHashCode();
594       if (HasOptionalUint64) hash ^= OptionalUint64.GetHashCode();
595       if (HasOptionalSint32) hash ^= OptionalSint32.GetHashCode();
596       if (HasOptionalSint64) hash ^= OptionalSint64.GetHashCode();
597       if (HasOptionalFixed32) hash ^= OptionalFixed32.GetHashCode();
598       if (HasOptionalFixed64) hash ^= OptionalFixed64.GetHashCode();
599       if (HasOptionalSfixed32) hash ^= OptionalSfixed32.GetHashCode();
600       if (HasOptionalSfixed64) hash ^= OptionalSfixed64.GetHashCode();
601       if (HasOptionalFloat) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(OptionalFloat);
602       if (HasOptionalDouble) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(OptionalDouble);
603       if (HasOptionalBool) hash ^= OptionalBool.GetHashCode();
604       if (HasOptionalString) hash ^= OptionalString.GetHashCode();
605       if (HasOptionalBytes) hash ^= OptionalBytes.GetHashCode();
606       if (HasOptionalCord) hash ^= OptionalCord.GetHashCode();
607       if (optionalNestedMessage_ != null) hash ^= OptionalNestedMessage.GetHashCode();
608       if (lazyNestedMessage_ != null) hash ^= LazyNestedMessage.GetHashCode();
609       if (HasOptionalNestedEnum) hash ^= OptionalNestedEnum.GetHashCode();
610       if (SingularInt32 != 0) hash ^= SingularInt32.GetHashCode();
611       if (SingularInt64 != 0L) hash ^= SingularInt64.GetHashCode();
612       if (_unknownFields != null) {
613         hash ^= _unknownFields.GetHashCode();
614       }
615       return hash;
616     }
617 
618     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
ToString()619     public override string ToString() {
620       return pb::JsonFormatter.ToDiagnosticString(this);
621     }
622 
623     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
WriteTo(pb::CodedOutputStream output)624     public void WriteTo(pb::CodedOutputStream output) {
625     #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
626       output.WriteRawMessage(this);
627     #else
628       if (HasOptionalInt32) {
629         output.WriteRawTag(8);
630         output.WriteInt32(OptionalInt32);
631       }
632       if (HasOptionalInt64) {
633         output.WriteRawTag(16);
634         output.WriteInt64(OptionalInt64);
635       }
636       if (HasOptionalUint32) {
637         output.WriteRawTag(24);
638         output.WriteUInt32(OptionalUint32);
639       }
640       if (HasOptionalUint64) {
641         output.WriteRawTag(32);
642         output.WriteUInt64(OptionalUint64);
643       }
644       if (HasOptionalSint32) {
645         output.WriteRawTag(40);
646         output.WriteSInt32(OptionalSint32);
647       }
648       if (HasOptionalSint64) {
649         output.WriteRawTag(48);
650         output.WriteSInt64(OptionalSint64);
651       }
652       if (HasOptionalFixed32) {
653         output.WriteRawTag(61);
654         output.WriteFixed32(OptionalFixed32);
655       }
656       if (HasOptionalFixed64) {
657         output.WriteRawTag(65);
658         output.WriteFixed64(OptionalFixed64);
659       }
660       if (HasOptionalSfixed32) {
661         output.WriteRawTag(77);
662         output.WriteSFixed32(OptionalSfixed32);
663       }
664       if (HasOptionalSfixed64) {
665         output.WriteRawTag(81);
666         output.WriteSFixed64(OptionalSfixed64);
667       }
668       if (HasOptionalFloat) {
669         output.WriteRawTag(93);
670         output.WriteFloat(OptionalFloat);
671       }
672       if (HasOptionalDouble) {
673         output.WriteRawTag(97);
674         output.WriteDouble(OptionalDouble);
675       }
676       if (HasOptionalBool) {
677         output.WriteRawTag(104);
678         output.WriteBool(OptionalBool);
679       }
680       if (HasOptionalString) {
681         output.WriteRawTag(114);
682         output.WriteString(OptionalString);
683       }
684       if (HasOptionalBytes) {
685         output.WriteRawTag(122);
686         output.WriteBytes(OptionalBytes);
687       }
688       if (HasOptionalCord) {
689         output.WriteRawTag(130, 1);
690         output.WriteString(OptionalCord);
691       }
692       if (optionalNestedMessage_ != null) {
693         output.WriteRawTag(146, 1);
694         output.WriteMessage(OptionalNestedMessage);
695       }
696       if (lazyNestedMessage_ != null) {
697         output.WriteRawTag(154, 1);
698         output.WriteMessage(LazyNestedMessage);
699       }
700       if (HasOptionalNestedEnum) {
701         output.WriteRawTag(168, 1);
702         output.WriteEnum((int) OptionalNestedEnum);
703       }
704       if (SingularInt32 != 0) {
705         output.WriteRawTag(176, 1);
706         output.WriteInt32(SingularInt32);
707       }
708       if (SingularInt64 != 0L) {
709         output.WriteRawTag(184, 1);
710         output.WriteInt64(SingularInt64);
711       }
712       if (_unknownFields != null) {
713         _unknownFields.WriteTo(output);
714       }
715     #endif
716     }
717 
718     #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
719     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
IBufferMessage.InternalWriteTo(ref pb::WriteContext output)720     void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
721       if (HasOptionalInt32) {
722         output.WriteRawTag(8);
723         output.WriteInt32(OptionalInt32);
724       }
725       if (HasOptionalInt64) {
726         output.WriteRawTag(16);
727         output.WriteInt64(OptionalInt64);
728       }
729       if (HasOptionalUint32) {
730         output.WriteRawTag(24);
731         output.WriteUInt32(OptionalUint32);
732       }
733       if (HasOptionalUint64) {
734         output.WriteRawTag(32);
735         output.WriteUInt64(OptionalUint64);
736       }
737       if (HasOptionalSint32) {
738         output.WriteRawTag(40);
739         output.WriteSInt32(OptionalSint32);
740       }
741       if (HasOptionalSint64) {
742         output.WriteRawTag(48);
743         output.WriteSInt64(OptionalSint64);
744       }
745       if (HasOptionalFixed32) {
746         output.WriteRawTag(61);
747         output.WriteFixed32(OptionalFixed32);
748       }
749       if (HasOptionalFixed64) {
750         output.WriteRawTag(65);
751         output.WriteFixed64(OptionalFixed64);
752       }
753       if (HasOptionalSfixed32) {
754         output.WriteRawTag(77);
755         output.WriteSFixed32(OptionalSfixed32);
756       }
757       if (HasOptionalSfixed64) {
758         output.WriteRawTag(81);
759         output.WriteSFixed64(OptionalSfixed64);
760       }
761       if (HasOptionalFloat) {
762         output.WriteRawTag(93);
763         output.WriteFloat(OptionalFloat);
764       }
765       if (HasOptionalDouble) {
766         output.WriteRawTag(97);
767         output.WriteDouble(OptionalDouble);
768       }
769       if (HasOptionalBool) {
770         output.WriteRawTag(104);
771         output.WriteBool(OptionalBool);
772       }
773       if (HasOptionalString) {
774         output.WriteRawTag(114);
775         output.WriteString(OptionalString);
776       }
777       if (HasOptionalBytes) {
778         output.WriteRawTag(122);
779         output.WriteBytes(OptionalBytes);
780       }
781       if (HasOptionalCord) {
782         output.WriteRawTag(130, 1);
783         output.WriteString(OptionalCord);
784       }
785       if (optionalNestedMessage_ != null) {
786         output.WriteRawTag(146, 1);
787         output.WriteMessage(OptionalNestedMessage);
788       }
789       if (lazyNestedMessage_ != null) {
790         output.WriteRawTag(154, 1);
791         output.WriteMessage(LazyNestedMessage);
792       }
793       if (HasOptionalNestedEnum) {
794         output.WriteRawTag(168, 1);
795         output.WriteEnum((int) OptionalNestedEnum);
796       }
797       if (SingularInt32 != 0) {
798         output.WriteRawTag(176, 1);
799         output.WriteInt32(SingularInt32);
800       }
801       if (SingularInt64 != 0L) {
802         output.WriteRawTag(184, 1);
803         output.WriteInt64(SingularInt64);
804       }
805       if (_unknownFields != null) {
806         _unknownFields.WriteTo(ref output);
807       }
808     }
809     #endif
810 
811     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
CalculateSize()812     public int CalculateSize() {
813       int size = 0;
814       if (HasOptionalInt32) {
815         size += 1 + pb::CodedOutputStream.ComputeInt32Size(OptionalInt32);
816       }
817       if (HasOptionalInt64) {
818         size += 1 + pb::CodedOutputStream.ComputeInt64Size(OptionalInt64);
819       }
820       if (HasOptionalUint32) {
821         size += 1 + pb::CodedOutputStream.ComputeUInt32Size(OptionalUint32);
822       }
823       if (HasOptionalUint64) {
824         size += 1 + pb::CodedOutputStream.ComputeUInt64Size(OptionalUint64);
825       }
826       if (HasOptionalSint32) {
827         size += 1 + pb::CodedOutputStream.ComputeSInt32Size(OptionalSint32);
828       }
829       if (HasOptionalSint64) {
830         size += 1 + pb::CodedOutputStream.ComputeSInt64Size(OptionalSint64);
831       }
832       if (HasOptionalFixed32) {
833         size += 1 + 4;
834       }
835       if (HasOptionalFixed64) {
836         size += 1 + 8;
837       }
838       if (HasOptionalSfixed32) {
839         size += 1 + 4;
840       }
841       if (HasOptionalSfixed64) {
842         size += 1 + 8;
843       }
844       if (HasOptionalFloat) {
845         size += 1 + 4;
846       }
847       if (HasOptionalDouble) {
848         size += 1 + 8;
849       }
850       if (HasOptionalBool) {
851         size += 1 + 1;
852       }
853       if (HasOptionalString) {
854         size += 1 + pb::CodedOutputStream.ComputeStringSize(OptionalString);
855       }
856       if (HasOptionalBytes) {
857         size += 1 + pb::CodedOutputStream.ComputeBytesSize(OptionalBytes);
858       }
859       if (HasOptionalCord) {
860         size += 2 + pb::CodedOutputStream.ComputeStringSize(OptionalCord);
861       }
862       if (optionalNestedMessage_ != null) {
863         size += 2 + pb::CodedOutputStream.ComputeMessageSize(OptionalNestedMessage);
864       }
865       if (lazyNestedMessage_ != null) {
866         size += 2 + pb::CodedOutputStream.ComputeMessageSize(LazyNestedMessage);
867       }
868       if (HasOptionalNestedEnum) {
869         size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) OptionalNestedEnum);
870       }
871       if (SingularInt32 != 0) {
872         size += 2 + pb::CodedOutputStream.ComputeInt32Size(SingularInt32);
873       }
874       if (SingularInt64 != 0L) {
875         size += 2 + pb::CodedOutputStream.ComputeInt64Size(SingularInt64);
876       }
877       if (_unknownFields != null) {
878         size += _unknownFields.CalculateSize();
879       }
880       return size;
881     }
882 
883     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
MergeFrom(TestProto3Optional other)884     public void MergeFrom(TestProto3Optional other) {
885       if (other == null) {
886         return;
887       }
888       if (other.HasOptionalInt32) {
889         OptionalInt32 = other.OptionalInt32;
890       }
891       if (other.HasOptionalInt64) {
892         OptionalInt64 = other.OptionalInt64;
893       }
894       if (other.HasOptionalUint32) {
895         OptionalUint32 = other.OptionalUint32;
896       }
897       if (other.HasOptionalUint64) {
898         OptionalUint64 = other.OptionalUint64;
899       }
900       if (other.HasOptionalSint32) {
901         OptionalSint32 = other.OptionalSint32;
902       }
903       if (other.HasOptionalSint64) {
904         OptionalSint64 = other.OptionalSint64;
905       }
906       if (other.HasOptionalFixed32) {
907         OptionalFixed32 = other.OptionalFixed32;
908       }
909       if (other.HasOptionalFixed64) {
910         OptionalFixed64 = other.OptionalFixed64;
911       }
912       if (other.HasOptionalSfixed32) {
913         OptionalSfixed32 = other.OptionalSfixed32;
914       }
915       if (other.HasOptionalSfixed64) {
916         OptionalSfixed64 = other.OptionalSfixed64;
917       }
918       if (other.HasOptionalFloat) {
919         OptionalFloat = other.OptionalFloat;
920       }
921       if (other.HasOptionalDouble) {
922         OptionalDouble = other.OptionalDouble;
923       }
924       if (other.HasOptionalBool) {
925         OptionalBool = other.OptionalBool;
926       }
927       if (other.HasOptionalString) {
928         OptionalString = other.OptionalString;
929       }
930       if (other.HasOptionalBytes) {
931         OptionalBytes = other.OptionalBytes;
932       }
933       if (other.HasOptionalCord) {
934         OptionalCord = other.OptionalCord;
935       }
936       if (other.optionalNestedMessage_ != null) {
937         if (optionalNestedMessage_ == null) {
938           OptionalNestedMessage = new global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage();
939         }
940         OptionalNestedMessage.MergeFrom(other.OptionalNestedMessage);
941       }
942       if (other.lazyNestedMessage_ != null) {
943         if (lazyNestedMessage_ == null) {
944           LazyNestedMessage = new global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage();
945         }
946         LazyNestedMessage.MergeFrom(other.LazyNestedMessage);
947       }
948       if (other.HasOptionalNestedEnum) {
949         OptionalNestedEnum = other.OptionalNestedEnum;
950       }
951       if (other.SingularInt32 != 0) {
952         SingularInt32 = other.SingularInt32;
953       }
954       if (other.SingularInt64 != 0L) {
955         SingularInt64 = other.SingularInt64;
956       }
957       _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
958     }
959 
960     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
MergeFrom(pb::CodedInputStream input)961     public void MergeFrom(pb::CodedInputStream input) {
962     #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
963       input.ReadRawMessage(this);
964     #else
965       uint tag;
966       while ((tag = input.ReadTag()) != 0) {
967         switch(tag) {
968           default:
969             _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
970             break;
971           case 8: {
972             OptionalInt32 = input.ReadInt32();
973             break;
974           }
975           case 16: {
976             OptionalInt64 = input.ReadInt64();
977             break;
978           }
979           case 24: {
980             OptionalUint32 = input.ReadUInt32();
981             break;
982           }
983           case 32: {
984             OptionalUint64 = input.ReadUInt64();
985             break;
986           }
987           case 40: {
988             OptionalSint32 = input.ReadSInt32();
989             break;
990           }
991           case 48: {
992             OptionalSint64 = input.ReadSInt64();
993             break;
994           }
995           case 61: {
996             OptionalFixed32 = input.ReadFixed32();
997             break;
998           }
999           case 65: {
1000             OptionalFixed64 = input.ReadFixed64();
1001             break;
1002           }
1003           case 77: {
1004             OptionalSfixed32 = input.ReadSFixed32();
1005             break;
1006           }
1007           case 81: {
1008             OptionalSfixed64 = input.ReadSFixed64();
1009             break;
1010           }
1011           case 93: {
1012             OptionalFloat = input.ReadFloat();
1013             break;
1014           }
1015           case 97: {
1016             OptionalDouble = input.ReadDouble();
1017             break;
1018           }
1019           case 104: {
1020             OptionalBool = input.ReadBool();
1021             break;
1022           }
1023           case 114: {
1024             OptionalString = input.ReadString();
1025             break;
1026           }
1027           case 122: {
1028             OptionalBytes = input.ReadBytes();
1029             break;
1030           }
1031           case 130: {
1032             OptionalCord = input.ReadString();
1033             break;
1034           }
1035           case 146: {
1036             if (optionalNestedMessage_ == null) {
1037               OptionalNestedMessage = new global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage();
1038             }
1039             input.ReadMessage(OptionalNestedMessage);
1040             break;
1041           }
1042           case 154: {
1043             if (lazyNestedMessage_ == null) {
1044               LazyNestedMessage = new global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage();
1045             }
1046             input.ReadMessage(LazyNestedMessage);
1047             break;
1048           }
1049           case 168: {
1050             OptionalNestedEnum = (global::ProtobufUnittest.TestProto3Optional.Types.NestedEnum) input.ReadEnum();
1051             break;
1052           }
1053           case 176: {
1054             SingularInt32 = input.ReadInt32();
1055             break;
1056           }
1057           case 184: {
1058             SingularInt64 = input.ReadInt64();
1059             break;
1060           }
1061         }
1062       }
1063     #endif
1064     }
1065 
1066     #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
1067     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
IBufferMessage.InternalMergeFrom(ref pb::ParseContext input)1068     void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
1069       uint tag;
1070       while ((tag = input.ReadTag()) != 0) {
1071         switch(tag) {
1072           default:
1073             _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
1074             break;
1075           case 8: {
1076             OptionalInt32 = input.ReadInt32();
1077             break;
1078           }
1079           case 16: {
1080             OptionalInt64 = input.ReadInt64();
1081             break;
1082           }
1083           case 24: {
1084             OptionalUint32 = input.ReadUInt32();
1085             break;
1086           }
1087           case 32: {
1088             OptionalUint64 = input.ReadUInt64();
1089             break;
1090           }
1091           case 40: {
1092             OptionalSint32 = input.ReadSInt32();
1093             break;
1094           }
1095           case 48: {
1096             OptionalSint64 = input.ReadSInt64();
1097             break;
1098           }
1099           case 61: {
1100             OptionalFixed32 = input.ReadFixed32();
1101             break;
1102           }
1103           case 65: {
1104             OptionalFixed64 = input.ReadFixed64();
1105             break;
1106           }
1107           case 77: {
1108             OptionalSfixed32 = input.ReadSFixed32();
1109             break;
1110           }
1111           case 81: {
1112             OptionalSfixed64 = input.ReadSFixed64();
1113             break;
1114           }
1115           case 93: {
1116             OptionalFloat = input.ReadFloat();
1117             break;
1118           }
1119           case 97: {
1120             OptionalDouble = input.ReadDouble();
1121             break;
1122           }
1123           case 104: {
1124             OptionalBool = input.ReadBool();
1125             break;
1126           }
1127           case 114: {
1128             OptionalString = input.ReadString();
1129             break;
1130           }
1131           case 122: {
1132             OptionalBytes = input.ReadBytes();
1133             break;
1134           }
1135           case 130: {
1136             OptionalCord = input.ReadString();
1137             break;
1138           }
1139           case 146: {
1140             if (optionalNestedMessage_ == null) {
1141               OptionalNestedMessage = new global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage();
1142             }
1143             input.ReadMessage(OptionalNestedMessage);
1144             break;
1145           }
1146           case 154: {
1147             if (lazyNestedMessage_ == null) {
1148               LazyNestedMessage = new global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage();
1149             }
1150             input.ReadMessage(LazyNestedMessage);
1151             break;
1152           }
1153           case 168: {
1154             OptionalNestedEnum = (global::ProtobufUnittest.TestProto3Optional.Types.NestedEnum) input.ReadEnum();
1155             break;
1156           }
1157           case 176: {
1158             SingularInt32 = input.ReadInt32();
1159             break;
1160           }
1161           case 184: {
1162             SingularInt64 = input.ReadInt64();
1163             break;
1164           }
1165         }
1166       }
1167     }
1168     #endif
1169 
1170     #region Nested types
1171     /// <summary>Container for nested types declared in the TestProto3Optional message type.</summary>
1172     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
1173     public static partial class Types {
1174       public enum NestedEnum {
1175         [pbr::OriginalName("UNSPECIFIED")] Unspecified = 0,
1176         [pbr::OriginalName("FOO")] Foo = 1,
1177         [pbr::OriginalName("BAR")] Bar = 2,
1178         [pbr::OriginalName("BAZ")] Baz = 3,
1179         /// <summary>
1180         /// Intentionally negative.
1181         /// </summary>
1182         [pbr::OriginalName("NEG")] Neg = -1,
1183       }
1184 
1185       public sealed partial class NestedMessage : pb::IMessage<NestedMessage>
1186       #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
1187           , pb::IBufferMessage
1188       #endif
1189       {
1190         private static readonly pb::MessageParser<NestedMessage> _parser = new pb::MessageParser<NestedMessage>(() => new NestedMessage());
1191         private pb::UnknownFieldSet _unknownFields;
1192         private int _hasBits0;
1193         [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
1194         public static pb::MessageParser<NestedMessage> Parser { get { return _parser; } }
1195 
1196         [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
1197         public static pbr::MessageDescriptor Descriptor {
1198           get { return global::ProtobufUnittest.TestProto3Optional.Descriptor.NestedTypes[0]; }
1199         }
1200 
1201         [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
1202         pbr::MessageDescriptor pb::IMessage.Descriptor {
1203           get { return Descriptor; }
1204         }
1205 
1206         [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
NestedMessage()1207         public NestedMessage() {
1208           OnConstruction();
1209         }
1210 
OnConstruction()1211         partial void OnConstruction();
1212 
1213         [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
NestedMessage(NestedMessage other)1214         public NestedMessage(NestedMessage other) : this() {
1215           _hasBits0 = other._hasBits0;
1216           bb_ = other.bb_;
1217           _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
1218         }
1219 
1220         [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Clone()1221         public NestedMessage Clone() {
1222           return new NestedMessage(this);
1223         }
1224 
1225         /// <summary>Field number for the "bb" field.</summary>
1226         public const int BbFieldNumber = 1;
1227         private int bb_;
1228         /// <summary>
1229         /// The field name "b" fails to compile in proto1 because it conflicts with
1230         /// a local variable named "b" in one of the generated methods.  Doh.
1231         /// This file needs to compile in proto1 to test backwards-compatibility.
1232         /// </summary>
1233         [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
1234         public int Bb {
1235           get { if ((_hasBits0 & 1) != 0) { return bb_; } else { return 0; } }
1236           set {
1237             _hasBits0 |= 1;
1238             bb_ = value;
1239           }
1240         }
1241         /// <summary>Gets whether the "bb" field is set</summary>
1242         [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
1243         public bool HasBb {
1244           get { return (_hasBits0 & 1) != 0; }
1245         }
1246         /// <summary>Clears the value of the "bb" field</summary>
1247         [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
ClearBb()1248         public void ClearBb() {
1249           _hasBits0 &= ~1;
1250         }
1251 
1252         [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Equals(object other)1253         public override bool Equals(object other) {
1254           return Equals(other as NestedMessage);
1255         }
1256 
1257         [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Equals(NestedMessage other)1258         public bool Equals(NestedMessage other) {
1259           if (ReferenceEquals(other, null)) {
1260             return false;
1261           }
1262           if (ReferenceEquals(other, this)) {
1263             return true;
1264           }
1265           if (Bb != other.Bb) return false;
1266           return Equals(_unknownFields, other._unknownFields);
1267         }
1268 
1269         [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
GetHashCode()1270         public override int GetHashCode() {
1271           int hash = 1;
1272           if (HasBb) hash ^= Bb.GetHashCode();
1273           if (_unknownFields != null) {
1274             hash ^= _unknownFields.GetHashCode();
1275           }
1276           return hash;
1277         }
1278 
1279         [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
ToString()1280         public override string ToString() {
1281           return pb::JsonFormatter.ToDiagnosticString(this);
1282         }
1283 
1284         [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
WriteTo(pb::CodedOutputStream output)1285         public void WriteTo(pb::CodedOutputStream output) {
1286         #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
1287           output.WriteRawMessage(this);
1288         #else
1289           if (HasBb) {
1290             output.WriteRawTag(8);
1291             output.WriteInt32(Bb);
1292           }
1293           if (_unknownFields != null) {
1294             _unknownFields.WriteTo(output);
1295           }
1296         #endif
1297         }
1298 
1299         #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
1300         [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
IBufferMessage.InternalWriteTo(ref pb::WriteContext output)1301         void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
1302           if (HasBb) {
1303             output.WriteRawTag(8);
1304             output.WriteInt32(Bb);
1305           }
1306           if (_unknownFields != null) {
1307             _unknownFields.WriteTo(ref output);
1308           }
1309         }
1310         #endif
1311 
1312         [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
CalculateSize()1313         public int CalculateSize() {
1314           int size = 0;
1315           if (HasBb) {
1316             size += 1 + pb::CodedOutputStream.ComputeInt32Size(Bb);
1317           }
1318           if (_unknownFields != null) {
1319             size += _unknownFields.CalculateSize();
1320           }
1321           return size;
1322         }
1323 
1324         [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
MergeFrom(NestedMessage other)1325         public void MergeFrom(NestedMessage other) {
1326           if (other == null) {
1327             return;
1328           }
1329           if (other.HasBb) {
1330             Bb = other.Bb;
1331           }
1332           _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
1333         }
1334 
1335         [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
MergeFrom(pb::CodedInputStream input)1336         public void MergeFrom(pb::CodedInputStream input) {
1337         #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
1338           input.ReadRawMessage(this);
1339         #else
1340           uint tag;
1341           while ((tag = input.ReadTag()) != 0) {
1342             switch(tag) {
1343               default:
1344                 _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
1345                 break;
1346               case 8: {
1347                 Bb = input.ReadInt32();
1348                 break;
1349               }
1350             }
1351           }
1352         #endif
1353         }
1354 
1355         #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
1356         [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
IBufferMessage.InternalMergeFrom(ref pb::ParseContext input)1357         void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
1358           uint tag;
1359           while ((tag = input.ReadTag()) != 0) {
1360             switch(tag) {
1361               default:
1362                 _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
1363                 break;
1364               case 8: {
1365                 Bb = input.ReadInt32();
1366                 break;
1367               }
1368             }
1369           }
1370         }
1371         #endif
1372 
1373       }
1374 
1375     }
1376     #endregion
1377 
1378   }
1379 
1380   #endregion
1381 
1382 }
1383 
1384 #endregion Designer generated code
1385