blob: 7d4451b0931f2efd5a3690d0c84650922149e7ee [file] [log] [blame]
Jon Skeetce66c5f2015-04-28 15:06:59 +01001// Generated by the protocol buffer compiler. DO NOT EDIT!
2// source: unittest_issues.proto
3#pragma warning disable 1591, 0612, 3021
4#region Designer generated code
5
Jon Skeete38294a2015-06-09 19:30:44 +01006using pb = global::Google.Protobuf;
7using pbc = global::Google.Protobuf.Collections;
Jon Skeet76940942015-07-14 10:25:40 +01008using pbr = global::Google.Protobuf.Reflection;
Jon Skeetce66c5f2015-04-28 15:06:59 +01009using scg = global::System.Collections.Generic;
10namespace UnitTest.Issues.TestProtos {
11
Jon Skeetb0888a42015-09-29 13:37:30 +010012 /// <summary>Holder for reflection information generated from unittest_issues.proto</summary>
Jon Skeete2c82302015-09-29 14:34:31 +010013 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
Jon Skeet284bb452015-11-05 09:13:53 +000014 public static partial class UnittestIssuesReflection {
Jon Skeetce66c5f2015-04-28 15:06:59 +010015
Jon Skeetce66c5f2015-04-28 15:06:59 +010016 #region Descriptor
Jon Skeetb0888a42015-09-29 13:37:30 +010017 /// <summary>File descriptor for unittest_issues.proto</summary>
Jon Skeet76940942015-07-14 10:25:40 +010018 public static pbr::FileDescriptor Descriptor {
Jon Skeetce66c5f2015-04-28 15:06:59 +010019 get { return descriptor; }
20 }
Jon Skeet76940942015-07-14 10:25:40 +010021 private static pbr::FileDescriptor descriptor;
Jon Skeetce66c5f2015-04-28 15:06:59 +010022
Jon Skeet284bb452015-11-05 09:13:53 +000023 static UnittestIssuesReflection() {
Jon Skeetce66c5f2015-04-28 15:06:59 +010024 byte[] descriptorData = global::System.Convert.FromBase64String(
25 string.Concat(
Jon Skeet94898172015-09-01 15:47:48 +010026 "ChV1bml0dGVzdF9pc3N1ZXMucHJvdG8SD3VuaXR0ZXN0X2lzc3VlcyInCghJ",
27 "c3N1ZTMwNxobCgpOZXN0ZWRPbmNlGg0KC05lc3RlZFR3aWNlIrABChNOZWdh",
28 "dGl2ZUVudW1NZXNzYWdlEiwKBXZhbHVlGAEgASgOMh0udW5pdHRlc3RfaXNz",
29 "dWVzLk5lZ2F0aXZlRW51bRIxCgZ2YWx1ZXMYAiADKA4yHS51bml0dGVzdF9p",
30 "c3N1ZXMuTmVnYXRpdmVFbnVtQgIQABI4Cg1wYWNrZWRfdmFsdWVzGAMgAygO",
31 "Mh0udW5pdHRlc3RfaXNzdWVzLk5lZ2F0aXZlRW51bUICEAEiEQoPRGVwcmVj",
32 "YXRlZENoaWxkIrkCChdEZXByZWNhdGVkRmllbGRzTWVzc2FnZRIaCg5Qcmlt",
33 "aXRpdmVWYWx1ZRgBIAEoBUICGAESGgoOUHJpbWl0aXZlQXJyYXkYAiADKAVC",
34 "AhgBEjoKDE1lc3NhZ2VWYWx1ZRgDIAEoCzIgLnVuaXR0ZXN0X2lzc3Vlcy5E",
35 "ZXByZWNhdGVkQ2hpbGRCAhgBEjoKDE1lc3NhZ2VBcnJheRgEIAMoCzIgLnVu",
36 "aXR0ZXN0X2lzc3Vlcy5EZXByZWNhdGVkQ2hpbGRCAhgBEjYKCUVudW1WYWx1",
37 "ZRgFIAEoDjIfLnVuaXR0ZXN0X2lzc3Vlcy5EZXByZWNhdGVkRW51bUICGAES",
38 "NgoJRW51bUFycmF5GAYgAygOMh8udW5pdHRlc3RfaXNzdWVzLkRlcHJlY2F0",
39 "ZWRFbnVtQgIYASIZCglJdGVtRmllbGQSDAoEaXRlbRgBIAEoBSJECg1SZXNl",
40 "cnZlZE5hbWVzEg0KBXR5cGVzGAEgASgFEhIKCmRlc2NyaXB0b3IYAiABKAUa",
41 "EAoOU29tZU5lc3RlZFR5cGUioAEKFVRlc3RKc29uRmllbGRPcmRlcmluZxIT",
42 "CgtwbGFpbl9pbnQzMhgEIAEoBRITCglvMV9zdHJpbmcYAiABKAlIABISCghv",
43 "MV9pbnQzMhgFIAEoBUgAEhQKDHBsYWluX3N0cmluZxgBIAEoCRISCghvMl9p",
44 "bnQzMhgGIAEoBUgBEhMKCW8yX3N0cmluZxgDIAEoCUgBQgQKAm8xQgQKAm8y",
alien0d32ab32016-03-17 15:19:04 +030045 "IksKDFRlc3RKc29uTmFtZRIMCgRuYW1lGAEgASgJEhkKC2Rlc2NyaXB0aW9u",
46 "GAIgASgJUgRkZXNjEhIKBGd1aWQYAyABKAlSBGV4aWQqVQoMTmVnYXRpdmVF",
47 "bnVtEhYKEk5FR0FUSVZFX0VOVU1fWkVSTxAAEhYKCUZpdmVCZWxvdxD7////",
48 "//////8BEhUKCE1pbnVzT25lEP///////////wEqLgoORGVwcmVjYXRlZEVu",
49 "dW0SEwoPREVQUkVDQVRFRF9aRVJPEAASBwoDb25lEAFCH0gBqgIaVW5pdFRl",
50 "c3QuSXNzdWVzLlRlc3RQcm90b3NiBnByb3RvMw=="));
Jon Skeeta2667aa2015-11-19 17:14:23 +000051 descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
Jon Skeet96cffaa2015-07-20 19:25:07 +010052 new pbr::FileDescriptor[] { },
Jon Skeetb6159962016-02-04 07:08:55 +000053 new pbr::GeneratedClrTypeInfo(new[] {typeof(global::UnitTest.Issues.TestProtos.NegativeEnum), typeof(global::UnitTest.Issues.TestProtos.DeprecatedEnum), }, new pbr::GeneratedClrTypeInfo[] {
54 new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.Issue307), global::UnitTest.Issues.TestProtos.Issue307.Parser, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce), global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce.Parser, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce.Types.NestedTwice), global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce.Types.NestedTwice.Parser, null, null, null, null)})}),
55 new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.NegativeEnumMessage), global::UnitTest.Issues.TestProtos.NegativeEnumMessage.Parser, new[]{ "Value", "Values", "PackedValues" }, null, null, null),
56 new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.DeprecatedChild), global::UnitTest.Issues.TestProtos.DeprecatedChild.Parser, null, null, null, null),
57 new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.DeprecatedFieldsMessage), global::UnitTest.Issues.TestProtos.DeprecatedFieldsMessage.Parser, new[]{ "PrimitiveValue", "PrimitiveArray", "MessageValue", "MessageArray", "EnumValue", "EnumArray" }, null, null, null),
58 new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.ItemField), global::UnitTest.Issues.TestProtos.ItemField.Parser, new[]{ "Item" }, null, null, null),
59 new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.ReservedNames), global::UnitTest.Issues.TestProtos.ReservedNames.Parser, new[]{ "Types_", "Descriptor_" }, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.ReservedNames.Types.SomeNestedType), global::UnitTest.Issues.TestProtos.ReservedNames.Types.SomeNestedType.Parser, null, null, null, null)}),
alien0d32ab32016-03-17 15:19:04 +030060 new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.TestJsonFieldOrdering), global::UnitTest.Issues.TestProtos.TestJsonFieldOrdering.Parser, new[]{ "PlainInt32", "O1String", "O1Int32", "PlainString", "O2Int32", "O2String" }, new[]{ "O1", "O2" }, null, null),
61 new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.TestJsonName), global::UnitTest.Issues.TestProtos.TestJsonName.Parser, new[]{ "Name", "Description", "Guid" }, null, null, null)
Jon Skeet47bf49b2015-07-22 11:39:38 +010062 }));
Jon Skeetce66c5f2015-04-28 15:06:59 +010063 }
64 #endregion
65
66 }
67 #region Enums
Jon Skeet39aaf212015-06-11 21:15:36 +010068 public enum NegativeEnum {
Jon Skeet84ea2c72016-04-08 12:33:09 +010069 [pbr::OriginalName("NEGATIVE_ENUM_ZERO")] Zero = 0,
70 [pbr::OriginalName("FiveBelow")] FiveBelow = -5,
71 [pbr::OriginalName("MinusOne")] MinusOne = -1,
Jon Skeetce66c5f2015-04-28 15:06:59 +010072 }
73
Jon Skeet39aaf212015-06-11 21:15:36 +010074 public enum DeprecatedEnum {
Jon Skeet84ea2c72016-04-08 12:33:09 +010075 [pbr::OriginalName("DEPRECATED_ZERO")] DeprecatedZero = 0,
76 [pbr::OriginalName("one")] One = 1,
Jon Skeetce66c5f2015-04-28 15:06:59 +010077 }
78
79 #endregion
80
81 #region Messages
Jon Skeet18e0a2e2015-10-01 10:38:01 +010082 /// <summary>
83 /// Issue 307: when generating doubly-nested types, any references
84 /// should be of the form A.Types.B.Types.C.
85 /// </summary>
Jon Skeetce66c5f2015-04-28 15:06:59 +010086 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
Jon Skeet8d83f8d2015-06-25 17:46:57 +010087 public sealed partial class Issue307 : pb::IMessage<Issue307> {
88 private static readonly pb::MessageParser<Issue307> _parser = new pb::MessageParser<Issue307>(() => new Issue307());
89 public static pb::MessageParser<Issue307> Parser { get { return _parser; } }
90
Jon Skeet76940942015-07-14 10:25:40 +010091 public static pbr::MessageDescriptor Descriptor {
Jon Skeet284bb452015-11-05 09:13:53 +000092 get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[0]; }
Jon Skeet8d83f8d2015-06-25 17:46:57 +010093 }
94
Jon Skeet96cffaa2015-07-20 19:25:07 +010095 pbr::MessageDescriptor pb::IMessage.Descriptor {
96 get { return Descriptor; }
Jon Skeet8d83f8d2015-06-25 17:46:57 +010097 }
98
Jon Skeet53508222015-07-01 17:16:55 +010099 public Issue307() {
100 OnConstruction();
101 }
Jon Skeet8d83f8d2015-06-25 17:46:57 +0100102
Jon Skeet53508222015-07-01 17:16:55 +0100103 partial void OnConstruction();
104
105 public Issue307(Issue307 other) : this() {
Jon Skeet8d83f8d2015-06-25 17:46:57 +0100106 }
107
108 public Issue307 Clone() {
109 return new Issue307(this);
110 }
111
Jon Skeet8d83f8d2015-06-25 17:46:57 +0100112 public override bool Equals(object other) {
113 return Equals(other as Issue307);
114 }
115
116 public bool Equals(Issue307 other) {
117 if (ReferenceEquals(other, null)) {
118 return false;
119 }
120 if (ReferenceEquals(other, this)) {
121 return true;
122 }
123 return true;
124 }
125
126 public override int GetHashCode() {
127 int hash = 1;
128 return hash;
129 }
130
Jon Skeet5b9288e2015-07-03 12:45:36 +0100131 public override string ToString() {
Jon Skeetadee6fe2015-12-15 09:24:04 +0000132 return pb::JsonFormatter.ToDiagnosticString(this);
Jon Skeet5b9288e2015-07-03 12:45:36 +0100133 }
134
Jon Skeet8d83f8d2015-06-25 17:46:57 +0100135 public void WriteTo(pb::CodedOutputStream output) {
136 }
137
138 public int CalculateSize() {
139 int size = 0;
140 return size;
141 }
142
143 public void MergeFrom(Issue307 other) {
144 if (other == null) {
145 return;
146 }
147 }
148
149 public void MergeFrom(pb::CodedInputStream input) {
150 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +0100151 while ((tag = input.ReadTag()) != 0) {
Jon Skeet8d83f8d2015-06-25 17:46:57 +0100152 switch(tag) {
Jon Skeet8d83f8d2015-06-25 17:46:57 +0100153 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +0100154 input.SkipLastField();
Jon Skeet8d83f8d2015-06-25 17:46:57 +0100155 break;
156 }
157 }
158 }
159
160 #region Nested types
Jon Skeetb0888a42015-09-29 13:37:30 +0100161 /// <summary>Container for nested types declared in the Issue307 message type.</summary>
Jon Skeete2c82302015-09-29 14:34:31 +0100162 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
Jon Skeet8d83f8d2015-06-25 17:46:57 +0100163 public static partial class Types {
164 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
165 public sealed partial class NestedOnce : pb::IMessage<NestedOnce> {
166 private static readonly pb::MessageParser<NestedOnce> _parser = new pb::MessageParser<NestedOnce>(() => new NestedOnce());
167 public static pb::MessageParser<NestedOnce> Parser { get { return _parser; } }
168
Jon Skeet76940942015-07-14 10:25:40 +0100169 public static pbr::MessageDescriptor Descriptor {
Jon Skeet462d5692015-07-01 14:47:36 +0100170 get { return global::UnitTest.Issues.TestProtos.Issue307.Descriptor.NestedTypes[0]; }
Jon Skeet8d83f8d2015-06-25 17:46:57 +0100171 }
172
Jon Skeet96cffaa2015-07-20 19:25:07 +0100173 pbr::MessageDescriptor pb::IMessage.Descriptor {
174 get { return Descriptor; }
Jon Skeet8d83f8d2015-06-25 17:46:57 +0100175 }
176
Jon Skeet53508222015-07-01 17:16:55 +0100177 public NestedOnce() {
178 OnConstruction();
179 }
Jon Skeet8d83f8d2015-06-25 17:46:57 +0100180
Jon Skeet53508222015-07-01 17:16:55 +0100181 partial void OnConstruction();
182
183 public NestedOnce(NestedOnce other) : this() {
Jon Skeet8d83f8d2015-06-25 17:46:57 +0100184 }
185
186 public NestedOnce Clone() {
187 return new NestedOnce(this);
188 }
189
Jon Skeet8d83f8d2015-06-25 17:46:57 +0100190 public override bool Equals(object other) {
191 return Equals(other as NestedOnce);
192 }
193
194 public bool Equals(NestedOnce other) {
195 if (ReferenceEquals(other, null)) {
196 return false;
197 }
198 if (ReferenceEquals(other, this)) {
199 return true;
200 }
201 return true;
202 }
203
204 public override int GetHashCode() {
205 int hash = 1;
206 return hash;
207 }
208
Jon Skeet5b9288e2015-07-03 12:45:36 +0100209 public override string ToString() {
Jon Skeetadee6fe2015-12-15 09:24:04 +0000210 return pb::JsonFormatter.ToDiagnosticString(this);
Jon Skeet5b9288e2015-07-03 12:45:36 +0100211 }
212
Jon Skeet8d83f8d2015-06-25 17:46:57 +0100213 public void WriteTo(pb::CodedOutputStream output) {
214 }
215
216 public int CalculateSize() {
217 int size = 0;
218 return size;
219 }
220
221 public void MergeFrom(NestedOnce other) {
222 if (other == null) {
223 return;
224 }
225 }
226
227 public void MergeFrom(pb::CodedInputStream input) {
228 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +0100229 while ((tag = input.ReadTag()) != 0) {
Jon Skeet8d83f8d2015-06-25 17:46:57 +0100230 switch(tag) {
Jon Skeet8d83f8d2015-06-25 17:46:57 +0100231 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +0100232 input.SkipLastField();
Jon Skeet8d83f8d2015-06-25 17:46:57 +0100233 break;
234 }
235 }
236 }
237
238 #region Nested types
Jon Skeetb0888a42015-09-29 13:37:30 +0100239 /// <summary>Container for nested types declared in the NestedOnce message type.</summary>
Jon Skeete2c82302015-09-29 14:34:31 +0100240 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
Jon Skeet8d83f8d2015-06-25 17:46:57 +0100241 public static partial class Types {
242 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
243 public sealed partial class NestedTwice : pb::IMessage<NestedTwice> {
244 private static readonly pb::MessageParser<NestedTwice> _parser = new pb::MessageParser<NestedTwice>(() => new NestedTwice());
245 public static pb::MessageParser<NestedTwice> Parser { get { return _parser; } }
246
Jon Skeet76940942015-07-14 10:25:40 +0100247 public static pbr::MessageDescriptor Descriptor {
Jon Skeet462d5692015-07-01 14:47:36 +0100248 get { return global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce.Descriptor.NestedTypes[0]; }
Jon Skeet8d83f8d2015-06-25 17:46:57 +0100249 }
250
Jon Skeet96cffaa2015-07-20 19:25:07 +0100251 pbr::MessageDescriptor pb::IMessage.Descriptor {
252 get { return Descriptor; }
Jon Skeet8d83f8d2015-06-25 17:46:57 +0100253 }
254
Jon Skeet53508222015-07-01 17:16:55 +0100255 public NestedTwice() {
256 OnConstruction();
257 }
Jon Skeet8d83f8d2015-06-25 17:46:57 +0100258
Jon Skeet53508222015-07-01 17:16:55 +0100259 partial void OnConstruction();
260
261 public NestedTwice(NestedTwice other) : this() {
Jon Skeet8d83f8d2015-06-25 17:46:57 +0100262 }
263
264 public NestedTwice Clone() {
265 return new NestedTwice(this);
266 }
267
Jon Skeet8d83f8d2015-06-25 17:46:57 +0100268 public override bool Equals(object other) {
269 return Equals(other as NestedTwice);
270 }
271
272 public bool Equals(NestedTwice other) {
273 if (ReferenceEquals(other, null)) {
274 return false;
275 }
276 if (ReferenceEquals(other, this)) {
277 return true;
278 }
279 return true;
280 }
281
282 public override int GetHashCode() {
283 int hash = 1;
284 return hash;
285 }
286
Jon Skeet5b9288e2015-07-03 12:45:36 +0100287 public override string ToString() {
Jon Skeetadee6fe2015-12-15 09:24:04 +0000288 return pb::JsonFormatter.ToDiagnosticString(this);
Jon Skeet5b9288e2015-07-03 12:45:36 +0100289 }
290
Jon Skeet8d83f8d2015-06-25 17:46:57 +0100291 public void WriteTo(pb::CodedOutputStream output) {
292 }
293
294 public int CalculateSize() {
295 int size = 0;
296 return size;
297 }
298
299 public void MergeFrom(NestedTwice other) {
300 if (other == null) {
301 return;
302 }
303 }
304
305 public void MergeFrom(pb::CodedInputStream input) {
306 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +0100307 while ((tag = input.ReadTag()) != 0) {
Jon Skeet8d83f8d2015-06-25 17:46:57 +0100308 switch(tag) {
Jon Skeet8d83f8d2015-06-25 17:46:57 +0100309 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +0100310 input.SkipLastField();
Jon Skeet8d83f8d2015-06-25 17:46:57 +0100311 break;
312 }
313 }
314 }
315
316 }
317
318 }
319 #endregion
320
321 }
322
323 }
324 #endregion
325
326 }
327
328 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
Jon Skeet785e13e2015-06-23 20:05:04 +0100329 public sealed partial class NegativeEnumMessage : pb::IMessage<NegativeEnumMessage> {
Jon Skeete38294a2015-06-09 19:30:44 +0100330 private static readonly pb::MessageParser<NegativeEnumMessage> _parser = new pb::MessageParser<NegativeEnumMessage>(() => new NegativeEnumMessage());
331 public static pb::MessageParser<NegativeEnumMessage> Parser { get { return _parser; } }
Jon Skeetce66c5f2015-04-28 15:06:59 +0100332
Jon Skeet76940942015-07-14 10:25:40 +0100333 public static pbr::MessageDescriptor Descriptor {
Jon Skeet284bb452015-11-05 09:13:53 +0000334 get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[1]; }
Jon Skeetce66c5f2015-04-28 15:06:59 +0100335 }
336
Jon Skeet96cffaa2015-07-20 19:25:07 +0100337 pbr::MessageDescriptor pb::IMessage.Descriptor {
338 get { return Descriptor; }
Jon Skeetce66c5f2015-04-28 15:06:59 +0100339 }
340
Jon Skeet53508222015-07-01 17:16:55 +0100341 public NegativeEnumMessage() {
342 OnConstruction();
343 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +0100344
Jon Skeet53508222015-07-01 17:16:55 +0100345 partial void OnConstruction();
346
347 public NegativeEnumMessage(NegativeEnumMessage other) : this() {
Jon Skeet6c1fe6e2015-06-23 11:54:19 +0100348 value_ = other.value_;
349 values_ = other.values_.Clone();
350 packedValues_ = other.packedValues_.Clone();
Jon Skeetce66c5f2015-04-28 15:06:59 +0100351 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +0100352
353 public NegativeEnumMessage Clone() {
354 return new NegativeEnumMessage(this);
355 }
356
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100357 /// <summary>Field number for the "value" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +0100358 public const int ValueFieldNumber = 1;
Jon Skeet84ea2c72016-04-08 12:33:09 +0100359 private global::UnitTest.Issues.TestProtos.NegativeEnum value_ = 0;
Jon Skeetce66c5f2015-04-28 15:06:59 +0100360 public global::UnitTest.Issues.TestProtos.NegativeEnum Value {
361 get { return value_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +0100362 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +0100363 value_ = value;
364 }
Jon Skeetce66c5f2015-04-28 15:06:59 +0100365 }
366
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100367 /// <summary>Field number for the "values" field.</summary>
Jon Skeetce66c5f2015-04-28 15:06:59 +0100368 public const int ValuesFieldNumber = 2;
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100369 private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.NegativeEnum> _repeated_values_codec
Jon Skeet96cffaa2015-07-20 19:25:07 +0100370 = pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::UnitTest.Issues.TestProtos.NegativeEnum) x);
371 private readonly pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum> values_ = new pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum>();
Jon Skeete38294a2015-06-09 19:30:44 +0100372 public pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum> Values {
373 get { return values_; }
Jon Skeetce66c5f2015-04-28 15:06:59 +0100374 }
375
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100376 /// <summary>Field number for the "packed_values" field.</summary>
Jon Skeetce66c5f2015-04-28 15:06:59 +0100377 public const int PackedValuesFieldNumber = 3;
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100378 private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.NegativeEnum> _repeated_packedValues_codec
Jon Skeet96cffaa2015-07-20 19:25:07 +0100379 = pb::FieldCodec.ForEnum(26, x => (int) x, x => (global::UnitTest.Issues.TestProtos.NegativeEnum) x);
380 private readonly pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum> packedValues_ = new pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum>();
Jon Skeete38294a2015-06-09 19:30:44 +0100381 public pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum> PackedValues {
382 get { return packedValues_; }
Jon Skeetce66c5f2015-04-28 15:06:59 +0100383 }
384
Jon Skeete38294a2015-06-09 19:30:44 +0100385 public override bool Equals(object other) {
386 return Equals(other as NegativeEnumMessage);
387 }
388
389 public bool Equals(NegativeEnumMessage other) {
390 if (ReferenceEquals(other, null)) {
391 return false;
392 }
393 if (ReferenceEquals(other, this)) {
Jon Skeetce66c5f2015-04-28 15:06:59 +0100394 return true;
395 }
Jon Skeete38294a2015-06-09 19:30:44 +0100396 if (Value != other.Value) return false;
397 if(!values_.Equals(other.values_)) return false;
398 if(!packedValues_.Equals(other.packedValues_)) return false;
399 return true;
Jon Skeetce66c5f2015-04-28 15:06:59 +0100400 }
401
Jon Skeete38294a2015-06-09 19:30:44 +0100402 public override int GetHashCode() {
Jon Skeete6fc9772015-06-26 10:32:50 +0100403 int hash = 1;
Jon Skeet84ea2c72016-04-08 12:33:09 +0100404 if (Value != 0) hash ^= Value.GetHashCode();
Jon Skeete38294a2015-06-09 19:30:44 +0100405 hash ^= values_.GetHashCode();
406 hash ^= packedValues_.GetHashCode();
407 return hash;
Jon Skeetce66c5f2015-04-28 15:06:59 +0100408 }
409
Jon Skeet5b9288e2015-07-03 12:45:36 +0100410 public override string ToString() {
Jon Skeetadee6fe2015-12-15 09:24:04 +0000411 return pb::JsonFormatter.ToDiagnosticString(this);
Jon Skeet5b9288e2015-07-03 12:45:36 +0100412 }
413
Jon Skeet96ddf012015-06-12 09:53:12 +0100414 public void WriteTo(pb::CodedOutputStream output) {
Jon Skeet84ea2c72016-04-08 12:33:09 +0100415 if (Value != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +0100416 output.WriteRawTag(8);
417 output.WriteEnum((int) Value);
Jon Skeetce66c5f2015-04-28 15:06:59 +0100418 }
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100419 values_.WriteTo(output, _repeated_values_codec);
420 packedValues_.WriteTo(output, _repeated_packedValues_codec);
Jon Skeetce66c5f2015-04-28 15:06:59 +0100421 }
422
Jon Skeete38294a2015-06-09 19:30:44 +0100423 public int CalculateSize() {
424 int size = 0;
Jon Skeet84ea2c72016-04-08 12:33:09 +0100425 if (Value != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +0100426 size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Value);
Jon Skeetce66c5f2015-04-28 15:06:59 +0100427 }
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100428 size += values_.CalculateSize(_repeated_values_codec);
429 size += packedValues_.CalculateSize(_repeated_packedValues_codec);
Jon Skeetce66c5f2015-04-28 15:06:59 +0100430 return size;
431 }
Jon Skeet3e7d70c2015-06-25 12:08:55 +0100432
Jon Skeete38294a2015-06-09 19:30:44 +0100433 public void MergeFrom(NegativeEnumMessage other) {
434 if (other == null) {
435 return;
436 }
Jon Skeet84ea2c72016-04-08 12:33:09 +0100437 if (other.Value != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +0100438 Value = other.Value;
439 }
440 values_.Add(other.values_);
441 packedValues_.Add(other.packedValues_);
Jon Skeetce66c5f2015-04-28 15:06:59 +0100442 }
443
Jon Skeet96ddf012015-06-12 09:53:12 +0100444 public void MergeFrom(pb::CodedInputStream input) {
Jon Skeete38294a2015-06-09 19:30:44 +0100445 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +0100446 while ((tag = input.ReadTag()) != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +0100447 switch(tag) {
Jon Skeete38294a2015-06-09 19:30:44 +0100448 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +0100449 input.SkipLastField();
Jon Skeete38294a2015-06-09 19:30:44 +0100450 break;
451 case 8: {
Jon Skeet96ddf012015-06-12 09:53:12 +0100452 value_ = (global::UnitTest.Issues.TestProtos.NegativeEnum) input.ReadEnum();
453 break;
Jon Skeete38294a2015-06-09 19:30:44 +0100454 }
455 case 18:
456 case 16: {
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100457 values_.AddEntriesFrom(input, _repeated_values_codec);
Jon Skeete38294a2015-06-09 19:30:44 +0100458 break;
459 }
460 case 26:
461 case 24: {
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100462 packedValues_.AddEntriesFrom(input, _repeated_packedValues_codec);
Jon Skeete38294a2015-06-09 19:30:44 +0100463 break;
464 }
Jon Skeetce66c5f2015-04-28 15:06:59 +0100465 }
Jon Skeetce66c5f2015-04-28 15:06:59 +0100466 }
467 }
Jon Skeete38294a2015-06-09 19:30:44 +0100468
Jon Skeetce66c5f2015-04-28 15:06:59 +0100469 }
470
471 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
Jon Skeet785e13e2015-06-23 20:05:04 +0100472 public sealed partial class DeprecatedChild : pb::IMessage<DeprecatedChild> {
Jon Skeete38294a2015-06-09 19:30:44 +0100473 private static readonly pb::MessageParser<DeprecatedChild> _parser = new pb::MessageParser<DeprecatedChild>(() => new DeprecatedChild());
474 public static pb::MessageParser<DeprecatedChild> Parser { get { return _parser; } }
Jon Skeetce66c5f2015-04-28 15:06:59 +0100475
Jon Skeet76940942015-07-14 10:25:40 +0100476 public static pbr::MessageDescriptor Descriptor {
Jon Skeet284bb452015-11-05 09:13:53 +0000477 get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[2]; }
Jon Skeetce66c5f2015-04-28 15:06:59 +0100478 }
479
Jon Skeet96cffaa2015-07-20 19:25:07 +0100480 pbr::MessageDescriptor pb::IMessage.Descriptor {
481 get { return Descriptor; }
Jon Skeetce66c5f2015-04-28 15:06:59 +0100482 }
483
Jon Skeet53508222015-07-01 17:16:55 +0100484 public DeprecatedChild() {
485 OnConstruction();
486 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +0100487
Jon Skeet53508222015-07-01 17:16:55 +0100488 partial void OnConstruction();
489
490 public DeprecatedChild(DeprecatedChild other) : this() {
Jon Skeete38294a2015-06-09 19:30:44 +0100491 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +0100492
493 public DeprecatedChild Clone() {
494 return new DeprecatedChild(this);
495 }
496
Jon Skeete38294a2015-06-09 19:30:44 +0100497 public override bool Equals(object other) {
498 return Equals(other as DeprecatedChild);
499 }
500
501 public bool Equals(DeprecatedChild other) {
502 if (ReferenceEquals(other, null)) {
503 return false;
504 }
505 if (ReferenceEquals(other, this)) {
Jon Skeetce66c5f2015-04-28 15:06:59 +0100506 return true;
507 }
Jon Skeete38294a2015-06-09 19:30:44 +0100508 return true;
Jon Skeetce66c5f2015-04-28 15:06:59 +0100509 }
510
Jon Skeete38294a2015-06-09 19:30:44 +0100511 public override int GetHashCode() {
Jon Skeete6fc9772015-06-26 10:32:50 +0100512 int hash = 1;
Jon Skeete38294a2015-06-09 19:30:44 +0100513 return hash;
Jon Skeetce66c5f2015-04-28 15:06:59 +0100514 }
515
Jon Skeet5b9288e2015-07-03 12:45:36 +0100516 public override string ToString() {
Jon Skeetadee6fe2015-12-15 09:24:04 +0000517 return pb::JsonFormatter.ToDiagnosticString(this);
Jon Skeet5b9288e2015-07-03 12:45:36 +0100518 }
519
Jon Skeet96ddf012015-06-12 09:53:12 +0100520 public void WriteTo(pb::CodedOutputStream output) {
Jon Skeetce66c5f2015-04-28 15:06:59 +0100521 }
522
Jon Skeete38294a2015-06-09 19:30:44 +0100523 public int CalculateSize() {
524 int size = 0;
Jon Skeetce66c5f2015-04-28 15:06:59 +0100525 return size;
526 }
Jon Skeet3e7d70c2015-06-25 12:08:55 +0100527
Jon Skeete38294a2015-06-09 19:30:44 +0100528 public void MergeFrom(DeprecatedChild other) {
529 if (other == null) {
530 return;
531 }
Jon Skeetce66c5f2015-04-28 15:06:59 +0100532 }
533
Jon Skeet96ddf012015-06-12 09:53:12 +0100534 public void MergeFrom(pb::CodedInputStream input) {
Jon Skeete38294a2015-06-09 19:30:44 +0100535 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +0100536 while ((tag = input.ReadTag()) != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +0100537 switch(tag) {
Jon Skeete38294a2015-06-09 19:30:44 +0100538 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +0100539 input.SkipLastField();
Jon Skeete38294a2015-06-09 19:30:44 +0100540 break;
Jon Skeetce66c5f2015-04-28 15:06:59 +0100541 }
Jon Skeetce66c5f2015-04-28 15:06:59 +0100542 }
Jon Skeete38294a2015-06-09 19:30:44 +0100543 }
Jon Skeetce66c5f2015-04-28 15:06:59 +0100544
Jon Skeetce66c5f2015-04-28 15:06:59 +0100545 }
546
547 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
Jon Skeet785e13e2015-06-23 20:05:04 +0100548 public sealed partial class DeprecatedFieldsMessage : pb::IMessage<DeprecatedFieldsMessage> {
Jon Skeete38294a2015-06-09 19:30:44 +0100549 private static readonly pb::MessageParser<DeprecatedFieldsMessage> _parser = new pb::MessageParser<DeprecatedFieldsMessage>(() => new DeprecatedFieldsMessage());
550 public static pb::MessageParser<DeprecatedFieldsMessage> Parser { get { return _parser; } }
Jon Skeetce66c5f2015-04-28 15:06:59 +0100551
Jon Skeet76940942015-07-14 10:25:40 +0100552 public static pbr::MessageDescriptor Descriptor {
Jon Skeet284bb452015-11-05 09:13:53 +0000553 get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[3]; }
Jon Skeetce66c5f2015-04-28 15:06:59 +0100554 }
555
Jon Skeet96cffaa2015-07-20 19:25:07 +0100556 pbr::MessageDescriptor pb::IMessage.Descriptor {
557 get { return Descriptor; }
Jon Skeetce66c5f2015-04-28 15:06:59 +0100558 }
559
Jon Skeet53508222015-07-01 17:16:55 +0100560 public DeprecatedFieldsMessage() {
561 OnConstruction();
562 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +0100563
Jon Skeet53508222015-07-01 17:16:55 +0100564 partial void OnConstruction();
565
566 public DeprecatedFieldsMessage(DeprecatedFieldsMessage other) : this() {
Jon Skeet6c1fe6e2015-06-23 11:54:19 +0100567 primitiveValue_ = other.primitiveValue_;
568 primitiveArray_ = other.primitiveArray_.Clone();
569 MessageValue = other.messageValue_ != null ? other.MessageValue.Clone() : null;
570 messageArray_ = other.messageArray_.Clone();
571 enumValue_ = other.enumValue_;
572 enumArray_ = other.enumArray_.Clone();
Jon Skeetce66c5f2015-04-28 15:06:59 +0100573 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +0100574
575 public DeprecatedFieldsMessage Clone() {
576 return new DeprecatedFieldsMessage(this);
577 }
578
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100579 /// <summary>Field number for the "PrimitiveValue" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +0100580 public const int PrimitiveValueFieldNumber = 1;
581 private int primitiveValue_;
Jon Skeetce66c5f2015-04-28 15:06:59 +0100582 [global::System.ObsoleteAttribute()]
583 public int PrimitiveValue {
584 get { return primitiveValue_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +0100585 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +0100586 primitiveValue_ = value;
587 }
Jon Skeetce66c5f2015-04-28 15:06:59 +0100588 }
589
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100590 /// <summary>Field number for the "PrimitiveArray" field.</summary>
Jon Skeetce66c5f2015-04-28 15:06:59 +0100591 public const int PrimitiveArrayFieldNumber = 2;
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100592 private static readonly pb::FieldCodec<int> _repeated_primitiveArray_codec
593 = pb::FieldCodec.ForInt32(18);
Jon Skeete38294a2015-06-09 19:30:44 +0100594 private readonly pbc::RepeatedField<int> primitiveArray_ = new pbc::RepeatedField<int>();
Jon Skeetce66c5f2015-04-28 15:06:59 +0100595 [global::System.ObsoleteAttribute()]
Jon Skeete38294a2015-06-09 19:30:44 +0100596 public pbc::RepeatedField<int> PrimitiveArray {
597 get { return primitiveArray_; }
Jon Skeetce66c5f2015-04-28 15:06:59 +0100598 }
599
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100600 /// <summary>Field number for the "MessageValue" field.</summary>
Jon Skeetce66c5f2015-04-28 15:06:59 +0100601 public const int MessageValueFieldNumber = 3;
Jon Skeetce66c5f2015-04-28 15:06:59 +0100602 private global::UnitTest.Issues.TestProtos.DeprecatedChild messageValue_;
603 [global::System.ObsoleteAttribute()]
Jon Skeetce66c5f2015-04-28 15:06:59 +0100604 public global::UnitTest.Issues.TestProtos.DeprecatedChild MessageValue {
Jon Skeete38294a2015-06-09 19:30:44 +0100605 get { return messageValue_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +0100606 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +0100607 messageValue_ = value;
608 }
Jon Skeetce66c5f2015-04-28 15:06:59 +0100609 }
610
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100611 /// <summary>Field number for the "MessageArray" field.</summary>
Jon Skeetce66c5f2015-04-28 15:06:59 +0100612 public const int MessageArrayFieldNumber = 4;
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100613 private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.DeprecatedChild> _repeated_messageArray_codec
614 = pb::FieldCodec.ForMessage(34, global::UnitTest.Issues.TestProtos.DeprecatedChild.Parser);
Jon Skeete38294a2015-06-09 19:30:44 +0100615 private readonly pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedChild> messageArray_ = new pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedChild>();
Jon Skeetce66c5f2015-04-28 15:06:59 +0100616 [global::System.ObsoleteAttribute()]
Jon Skeete38294a2015-06-09 19:30:44 +0100617 public pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedChild> MessageArray {
Jon Skeetce66c5f2015-04-28 15:06:59 +0100618 get { return messageArray_; }
619 }
Jon Skeetce66c5f2015-04-28 15:06:59 +0100620
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100621 /// <summary>Field number for the "EnumValue" field.</summary>
Jon Skeetce66c5f2015-04-28 15:06:59 +0100622 public const int EnumValueFieldNumber = 5;
Jon Skeet84ea2c72016-04-08 12:33:09 +0100623 private global::UnitTest.Issues.TestProtos.DeprecatedEnum enumValue_ = 0;
Jon Skeetce66c5f2015-04-28 15:06:59 +0100624 [global::System.ObsoleteAttribute()]
625 public global::UnitTest.Issues.TestProtos.DeprecatedEnum EnumValue {
626 get { return enumValue_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +0100627 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +0100628 enumValue_ = value;
629 }
Jon Skeetce66c5f2015-04-28 15:06:59 +0100630 }
631
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100632 /// <summary>Field number for the "EnumArray" field.</summary>
Jon Skeetce66c5f2015-04-28 15:06:59 +0100633 public const int EnumArrayFieldNumber = 6;
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100634 private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.DeprecatedEnum> _repeated_enumArray_codec
Jon Skeet96cffaa2015-07-20 19:25:07 +0100635 = pb::FieldCodec.ForEnum(50, x => (int) x, x => (global::UnitTest.Issues.TestProtos.DeprecatedEnum) x);
636 private readonly pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedEnum> enumArray_ = new pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedEnum>();
Jon Skeetce66c5f2015-04-28 15:06:59 +0100637 [global::System.ObsoleteAttribute()]
Jon Skeete38294a2015-06-09 19:30:44 +0100638 public pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedEnum> EnumArray {
639 get { return enumArray_; }
Jon Skeetce66c5f2015-04-28 15:06:59 +0100640 }
641
Jon Skeete38294a2015-06-09 19:30:44 +0100642 public override bool Equals(object other) {
643 return Equals(other as DeprecatedFieldsMessage);
644 }
645
646 public bool Equals(DeprecatedFieldsMessage other) {
647 if (ReferenceEquals(other, null)) {
648 return false;
649 }
650 if (ReferenceEquals(other, this)) {
Jon Skeetce66c5f2015-04-28 15:06:59 +0100651 return true;
652 }
Jon Skeete38294a2015-06-09 19:30:44 +0100653 if (PrimitiveValue != other.PrimitiveValue) return false;
654 if(!primitiveArray_.Equals(other.primitiveArray_)) return false;
Jon Skeetbfee2df2015-06-23 16:09:27 +0100655 if (!object.Equals(MessageValue, other.MessageValue)) return false;
656 if(!messageArray_.Equals(other.messageArray_)) return false;
Jon Skeete38294a2015-06-09 19:30:44 +0100657 if (EnumValue != other.EnumValue) return false;
658 if(!enumArray_.Equals(other.enumArray_)) return false;
659 return true;
Jon Skeetce66c5f2015-04-28 15:06:59 +0100660 }
661
Jon Skeete38294a2015-06-09 19:30:44 +0100662 public override int GetHashCode() {
Jon Skeete6fc9772015-06-26 10:32:50 +0100663 int hash = 1;
Jon Skeete38294a2015-06-09 19:30:44 +0100664 if (PrimitiveValue != 0) hash ^= PrimitiveValue.GetHashCode();
665 hash ^= primitiveArray_.GetHashCode();
666 if (messageValue_ != null) hash ^= MessageValue.GetHashCode();
667 hash ^= messageArray_.GetHashCode();
Jon Skeet84ea2c72016-04-08 12:33:09 +0100668 if (EnumValue != 0) hash ^= EnumValue.GetHashCode();
Jon Skeete38294a2015-06-09 19:30:44 +0100669 hash ^= enumArray_.GetHashCode();
670 return hash;
Jon Skeetce66c5f2015-04-28 15:06:59 +0100671 }
672
Jon Skeet5b9288e2015-07-03 12:45:36 +0100673 public override string ToString() {
Jon Skeetadee6fe2015-12-15 09:24:04 +0000674 return pb::JsonFormatter.ToDiagnosticString(this);
Jon Skeet5b9288e2015-07-03 12:45:36 +0100675 }
676
Jon Skeet96ddf012015-06-12 09:53:12 +0100677 public void WriteTo(pb::CodedOutputStream output) {
Jon Skeete38294a2015-06-09 19:30:44 +0100678 if (PrimitiveValue != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +0100679 output.WriteRawTag(8);
680 output.WriteInt32(PrimitiveValue);
Jon Skeetce66c5f2015-04-28 15:06:59 +0100681 }
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100682 primitiveArray_.WriteTo(output, _repeated_primitiveArray_codec);
Jon Skeete38294a2015-06-09 19:30:44 +0100683 if (messageValue_ != null) {
Jon Skeet828b7e62015-06-17 14:59:10 +0100684 output.WriteRawTag(26);
685 output.WriteMessage(MessageValue);
Jon Skeete38294a2015-06-09 19:30:44 +0100686 }
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100687 messageArray_.WriteTo(output, _repeated_messageArray_codec);
Jon Skeet84ea2c72016-04-08 12:33:09 +0100688 if (EnumValue != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +0100689 output.WriteRawTag(40);
690 output.WriteEnum((int) EnumValue);
Jon Skeete38294a2015-06-09 19:30:44 +0100691 }
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100692 enumArray_.WriteTo(output, _repeated_enumArray_codec);
Jon Skeetce66c5f2015-04-28 15:06:59 +0100693 }
694
Jon Skeete38294a2015-06-09 19:30:44 +0100695 public int CalculateSize() {
696 int size = 0;
697 if (PrimitiveValue != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +0100698 size += 1 + pb::CodedOutputStream.ComputeInt32Size(PrimitiveValue);
Jon Skeetce66c5f2015-04-28 15:06:59 +0100699 }
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100700 size += primitiveArray_.CalculateSize(_repeated_primitiveArray_codec);
Jon Skeete38294a2015-06-09 19:30:44 +0100701 if (messageValue_ != null) {
Jon Skeet828b7e62015-06-17 14:59:10 +0100702 size += 1 + pb::CodedOutputStream.ComputeMessageSize(MessageValue);
Jon Skeetce66c5f2015-04-28 15:06:59 +0100703 }
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100704 size += messageArray_.CalculateSize(_repeated_messageArray_codec);
Jon Skeet84ea2c72016-04-08 12:33:09 +0100705 if (EnumValue != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +0100706 size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) EnumValue);
Jon Skeetce66c5f2015-04-28 15:06:59 +0100707 }
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100708 size += enumArray_.CalculateSize(_repeated_enumArray_codec);
Jon Skeetce66c5f2015-04-28 15:06:59 +0100709 return size;
710 }
Jon Skeet3e7d70c2015-06-25 12:08:55 +0100711
Jon Skeete38294a2015-06-09 19:30:44 +0100712 public void MergeFrom(DeprecatedFieldsMessage other) {
713 if (other == null) {
714 return;
Jon Skeetce66c5f2015-04-28 15:06:59 +0100715 }
Jon Skeete38294a2015-06-09 19:30:44 +0100716 if (other.PrimitiveValue != 0) {
717 PrimitiveValue = other.PrimitiveValue;
Jon Skeetce66c5f2015-04-28 15:06:59 +0100718 }
Jon Skeete38294a2015-06-09 19:30:44 +0100719 primitiveArray_.Add(other.primitiveArray_);
720 if (other.messageValue_ != null) {
721 if (messageValue_ == null) {
722 messageValue_ = new global::UnitTest.Issues.TestProtos.DeprecatedChild();
Jon Skeetce66c5f2015-04-28 15:06:59 +0100723 }
Jon Skeete38294a2015-06-09 19:30:44 +0100724 MessageValue.MergeFrom(other.MessageValue);
Jon Skeetce66c5f2015-04-28 15:06:59 +0100725 }
Jon Skeete38294a2015-06-09 19:30:44 +0100726 messageArray_.Add(other.messageArray_);
Jon Skeet84ea2c72016-04-08 12:33:09 +0100727 if (other.EnumValue != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +0100728 EnumValue = other.EnumValue;
Jon Skeetce66c5f2015-04-28 15:06:59 +0100729 }
Jon Skeete38294a2015-06-09 19:30:44 +0100730 enumArray_.Add(other.enumArray_);
731 }
Jon Skeetce66c5f2015-04-28 15:06:59 +0100732
Jon Skeet96ddf012015-06-12 09:53:12 +0100733 public void MergeFrom(pb::CodedInputStream input) {
Jon Skeete38294a2015-06-09 19:30:44 +0100734 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +0100735 while ((tag = input.ReadTag()) != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +0100736 switch(tag) {
Jon Skeete38294a2015-06-09 19:30:44 +0100737 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +0100738 input.SkipLastField();
Jon Skeete38294a2015-06-09 19:30:44 +0100739 break;
740 case 8: {
Jon Skeetfb1547b2015-06-12 13:11:54 +0100741 PrimitiveValue = input.ReadInt32();
Jon Skeete38294a2015-06-09 19:30:44 +0100742 break;
743 }
744 case 18:
745 case 16: {
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100746 primitiveArray_.AddEntriesFrom(input, _repeated_primitiveArray_codec);
Jon Skeete38294a2015-06-09 19:30:44 +0100747 break;
748 }
749 case 26: {
750 if (messageValue_ == null) {
751 messageValue_ = new global::UnitTest.Issues.TestProtos.DeprecatedChild();
752 }
753 input.ReadMessage(messageValue_);
754 break;
755 }
756 case 34: {
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100757 messageArray_.AddEntriesFrom(input, _repeated_messageArray_codec);
Jon Skeete38294a2015-06-09 19:30:44 +0100758 break;
759 }
760 case 40: {
Jon Skeet96ddf012015-06-12 09:53:12 +0100761 enumValue_ = (global::UnitTest.Issues.TestProtos.DeprecatedEnum) input.ReadEnum();
762 break;
Jon Skeete38294a2015-06-09 19:30:44 +0100763 }
764 case 50:
765 case 48: {
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100766 enumArray_.AddEntriesFrom(input, _repeated_enumArray_codec);
Jon Skeete38294a2015-06-09 19:30:44 +0100767 break;
768 }
Jon Skeetce66c5f2015-04-28 15:06:59 +0100769 }
Jon Skeetce66c5f2015-04-28 15:06:59 +0100770 }
771 }
Jon Skeete38294a2015-06-09 19:30:44 +0100772
Jon Skeetce66c5f2015-04-28 15:06:59 +0100773 }
774
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100775 /// <summary>
776 /// Issue 45: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=45
777 /// </summary>
Jon Skeetce66c5f2015-04-28 15:06:59 +0100778 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
Jon Skeet785e13e2015-06-23 20:05:04 +0100779 public sealed partial class ItemField : pb::IMessage<ItemField> {
Jon Skeete38294a2015-06-09 19:30:44 +0100780 private static readonly pb::MessageParser<ItemField> _parser = new pb::MessageParser<ItemField>(() => new ItemField());
781 public static pb::MessageParser<ItemField> Parser { get { return _parser; } }
Jon Skeetce66c5f2015-04-28 15:06:59 +0100782
Jon Skeet76940942015-07-14 10:25:40 +0100783 public static pbr::MessageDescriptor Descriptor {
Jon Skeet284bb452015-11-05 09:13:53 +0000784 get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[4]; }
Jon Skeetce66c5f2015-04-28 15:06:59 +0100785 }
786
Jon Skeet96cffaa2015-07-20 19:25:07 +0100787 pbr::MessageDescriptor pb::IMessage.Descriptor {
788 get { return Descriptor; }
Jon Skeetce66c5f2015-04-28 15:06:59 +0100789 }
790
Jon Skeet53508222015-07-01 17:16:55 +0100791 public ItemField() {
792 OnConstruction();
793 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +0100794
Jon Skeet53508222015-07-01 17:16:55 +0100795 partial void OnConstruction();
796
797 public ItemField(ItemField other) : this() {
Jon Skeet6c1fe6e2015-06-23 11:54:19 +0100798 item_ = other.item_;
Jon Skeetce66c5f2015-04-28 15:06:59 +0100799 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +0100800
801 public ItemField Clone() {
802 return new ItemField(this);
803 }
804
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100805 /// <summary>Field number for the "item" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +0100806 public const int ItemFieldNumber = 1;
807 private int item_;
Jon Skeetce66c5f2015-04-28 15:06:59 +0100808 public int Item {
809 get { return item_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +0100810 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +0100811 item_ = value;
812 }
Jon Skeetce66c5f2015-04-28 15:06:59 +0100813 }
814
Jon Skeete38294a2015-06-09 19:30:44 +0100815 public override bool Equals(object other) {
816 return Equals(other as ItemField);
817 }
818
819 public bool Equals(ItemField other) {
820 if (ReferenceEquals(other, null)) {
821 return false;
822 }
823 if (ReferenceEquals(other, this)) {
Jon Skeetce66c5f2015-04-28 15:06:59 +0100824 return true;
825 }
Jon Skeete38294a2015-06-09 19:30:44 +0100826 if (Item != other.Item) return false;
827 return true;
Jon Skeetce66c5f2015-04-28 15:06:59 +0100828 }
829
Jon Skeete38294a2015-06-09 19:30:44 +0100830 public override int GetHashCode() {
Jon Skeete6fc9772015-06-26 10:32:50 +0100831 int hash = 1;
Jon Skeete38294a2015-06-09 19:30:44 +0100832 if (Item != 0) hash ^= Item.GetHashCode();
833 return hash;
Jon Skeetce66c5f2015-04-28 15:06:59 +0100834 }
835
Jon Skeet5b9288e2015-07-03 12:45:36 +0100836 public override string ToString() {
Jon Skeetadee6fe2015-12-15 09:24:04 +0000837 return pb::JsonFormatter.ToDiagnosticString(this);
Jon Skeet5b9288e2015-07-03 12:45:36 +0100838 }
839
Jon Skeet96ddf012015-06-12 09:53:12 +0100840 public void WriteTo(pb::CodedOutputStream output) {
Jon Skeete38294a2015-06-09 19:30:44 +0100841 if (Item != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +0100842 output.WriteRawTag(8);
843 output.WriteInt32(Item);
Jon Skeetce66c5f2015-04-28 15:06:59 +0100844 }
845 }
846
Jon Skeete38294a2015-06-09 19:30:44 +0100847 public int CalculateSize() {
848 int size = 0;
849 if (Item != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +0100850 size += 1 + pb::CodedOutputStream.ComputeInt32Size(Item);
Jon Skeetce66c5f2015-04-28 15:06:59 +0100851 }
Jon Skeetce66c5f2015-04-28 15:06:59 +0100852 return size;
853 }
Jon Skeet3e7d70c2015-06-25 12:08:55 +0100854
Jon Skeete38294a2015-06-09 19:30:44 +0100855 public void MergeFrom(ItemField other) {
856 if (other == null) {
857 return;
858 }
859 if (other.Item != 0) {
860 Item = other.Item;
861 }
Jon Skeetce66c5f2015-04-28 15:06:59 +0100862 }
863
Jon Skeet96ddf012015-06-12 09:53:12 +0100864 public void MergeFrom(pb::CodedInputStream input) {
Jon Skeete38294a2015-06-09 19:30:44 +0100865 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +0100866 while ((tag = input.ReadTag()) != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +0100867 switch(tag) {
Jon Skeete38294a2015-06-09 19:30:44 +0100868 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +0100869 input.SkipLastField();
Jon Skeete38294a2015-06-09 19:30:44 +0100870 break;
871 case 8: {
Jon Skeetfb1547b2015-06-12 13:11:54 +0100872 Item = input.ReadInt32();
Jon Skeete38294a2015-06-09 19:30:44 +0100873 break;
874 }
Jon Skeetce66c5f2015-04-28 15:06:59 +0100875 }
Jon Skeetce66c5f2015-04-28 15:06:59 +0100876 }
877 }
Jon Skeete38294a2015-06-09 19:30:44 +0100878
Jon Skeetce66c5f2015-04-28 15:06:59 +0100879 }
880
Jon Skeetf994cfe2015-07-30 14:06:01 +0100881 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
882 public sealed partial class ReservedNames : pb::IMessage<ReservedNames> {
883 private static readonly pb::MessageParser<ReservedNames> _parser = new pb::MessageParser<ReservedNames>(() => new ReservedNames());
884 public static pb::MessageParser<ReservedNames> Parser { get { return _parser; } }
885
886 public static pbr::MessageDescriptor Descriptor {
Jon Skeet284bb452015-11-05 09:13:53 +0000887 get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[5]; }
Jon Skeetf994cfe2015-07-30 14:06:01 +0100888 }
889
890 pbr::MessageDescriptor pb::IMessage.Descriptor {
891 get { return Descriptor; }
892 }
893
894 public ReservedNames() {
895 OnConstruction();
896 }
897
898 partial void OnConstruction();
899
900 public ReservedNames(ReservedNames other) : this() {
901 types_ = other.types_;
902 descriptor_ = other.descriptor_;
903 }
904
905 public ReservedNames Clone() {
906 return new ReservedNames(this);
907 }
908
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100909 /// <summary>Field number for the "types" field.</summary>
Jon Skeetf994cfe2015-07-30 14:06:01 +0100910 public const int Types_FieldNumber = 1;
911 private int types_;
912 public int Types_ {
913 get { return types_; }
914 set {
915 types_ = value;
916 }
917 }
918
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100919 /// <summary>Field number for the "descriptor" field.</summary>
Jon Skeetf994cfe2015-07-30 14:06:01 +0100920 public const int Descriptor_FieldNumber = 2;
921 private int descriptor_;
922 public int Descriptor_ {
923 get { return descriptor_; }
924 set {
925 descriptor_ = value;
926 }
927 }
928
929 public override bool Equals(object other) {
930 return Equals(other as ReservedNames);
931 }
932
933 public bool Equals(ReservedNames other) {
934 if (ReferenceEquals(other, null)) {
935 return false;
936 }
937 if (ReferenceEquals(other, this)) {
938 return true;
939 }
940 if (Types_ != other.Types_) return false;
941 if (Descriptor_ != other.Descriptor_) return false;
942 return true;
943 }
944
945 public override int GetHashCode() {
946 int hash = 1;
947 if (Types_ != 0) hash ^= Types_.GetHashCode();
948 if (Descriptor_ != 0) hash ^= Descriptor_.GetHashCode();
949 return hash;
950 }
951
952 public override string ToString() {
Jon Skeetadee6fe2015-12-15 09:24:04 +0000953 return pb::JsonFormatter.ToDiagnosticString(this);
Jon Skeetf994cfe2015-07-30 14:06:01 +0100954 }
955
956 public void WriteTo(pb::CodedOutputStream output) {
957 if (Types_ != 0) {
958 output.WriteRawTag(8);
959 output.WriteInt32(Types_);
960 }
961 if (Descriptor_ != 0) {
962 output.WriteRawTag(16);
963 output.WriteInt32(Descriptor_);
964 }
965 }
966
967 public int CalculateSize() {
968 int size = 0;
969 if (Types_ != 0) {
970 size += 1 + pb::CodedOutputStream.ComputeInt32Size(Types_);
971 }
972 if (Descriptor_ != 0) {
973 size += 1 + pb::CodedOutputStream.ComputeInt32Size(Descriptor_);
974 }
975 return size;
976 }
977
978 public void MergeFrom(ReservedNames other) {
979 if (other == null) {
980 return;
981 }
982 if (other.Types_ != 0) {
983 Types_ = other.Types_;
984 }
985 if (other.Descriptor_ != 0) {
986 Descriptor_ = other.Descriptor_;
987 }
988 }
989
990 public void MergeFrom(pb::CodedInputStream input) {
991 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +0100992 while ((tag = input.ReadTag()) != 0) {
Jon Skeetf994cfe2015-07-30 14:06:01 +0100993 switch(tag) {
Jon Skeetf994cfe2015-07-30 14:06:01 +0100994 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +0100995 input.SkipLastField();
Jon Skeetf994cfe2015-07-30 14:06:01 +0100996 break;
997 case 8: {
998 Types_ = input.ReadInt32();
999 break;
1000 }
1001 case 16: {
1002 Descriptor_ = input.ReadInt32();
1003 break;
1004 }
1005 }
1006 }
1007 }
1008
1009 #region Nested types
Jon Skeetb0888a42015-09-29 13:37:30 +01001010 /// <summary>Container for nested types declared in the ReservedNames message type.</summary>
Jon Skeete2c82302015-09-29 14:34:31 +01001011 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
Jon Skeetf994cfe2015-07-30 14:06:01 +01001012 public static partial class Types {
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001013 /// <summary>
1014 /// Force a nested type called Types
1015 /// </summary>
Jon Skeetf994cfe2015-07-30 14:06:01 +01001016 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1017 public sealed partial class SomeNestedType : pb::IMessage<SomeNestedType> {
1018 private static readonly pb::MessageParser<SomeNestedType> _parser = new pb::MessageParser<SomeNestedType>(() => new SomeNestedType());
1019 public static pb::MessageParser<SomeNestedType> Parser { get { return _parser; } }
1020
1021 public static pbr::MessageDescriptor Descriptor {
1022 get { return global::UnitTest.Issues.TestProtos.ReservedNames.Descriptor.NestedTypes[0]; }
1023 }
1024
1025 pbr::MessageDescriptor pb::IMessage.Descriptor {
1026 get { return Descriptor; }
1027 }
1028
1029 public SomeNestedType() {
1030 OnConstruction();
1031 }
1032
1033 partial void OnConstruction();
1034
1035 public SomeNestedType(SomeNestedType other) : this() {
1036 }
1037
1038 public SomeNestedType Clone() {
1039 return new SomeNestedType(this);
1040 }
1041
1042 public override bool Equals(object other) {
1043 return Equals(other as SomeNestedType);
1044 }
1045
1046 public bool Equals(SomeNestedType other) {
1047 if (ReferenceEquals(other, null)) {
1048 return false;
1049 }
1050 if (ReferenceEquals(other, this)) {
1051 return true;
1052 }
1053 return true;
1054 }
1055
1056 public override int GetHashCode() {
1057 int hash = 1;
1058 return hash;
1059 }
1060
1061 public override string ToString() {
Jon Skeetadee6fe2015-12-15 09:24:04 +00001062 return pb::JsonFormatter.ToDiagnosticString(this);
Jon Skeetf994cfe2015-07-30 14:06:01 +01001063 }
1064
1065 public void WriteTo(pb::CodedOutputStream output) {
1066 }
1067
1068 public int CalculateSize() {
1069 int size = 0;
1070 return size;
1071 }
1072
1073 public void MergeFrom(SomeNestedType other) {
1074 if (other == null) {
1075 return;
1076 }
1077 }
1078
1079 public void MergeFrom(pb::CodedInputStream input) {
1080 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +01001081 while ((tag = input.ReadTag()) != 0) {
Jon Skeetf994cfe2015-07-30 14:06:01 +01001082 switch(tag) {
Jon Skeetf994cfe2015-07-30 14:06:01 +01001083 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +01001084 input.SkipLastField();
Jon Skeetf994cfe2015-07-30 14:06:01 +01001085 break;
1086 }
1087 }
1088 }
1089
1090 }
1091
1092 }
1093 #endregion
1094
1095 }
1096
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001097 /// <summary>
1098 /// These fields are deliberately not declared in numeric
1099 /// order, and the oneof fields aren't contiguous either.
1100 /// This allows for reasonably robust tests of JSON output
1101 /// ordering.
1102 /// TestFieldOrderings in unittest_proto3.proto is similar,
1103 /// but doesn't include oneofs.
1104 /// TODO: Consider adding oneofs to TestFieldOrderings, although
1105 /// that will require fixing other tests in multiple platforms.
1106 /// Alternatively, consider just adding this to
1107 /// unittest_proto3.proto if multiple platforms want it.
1108 /// </summary>
Jon Skeet4fed0b52015-07-31 10:33:31 +01001109 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1110 public sealed partial class TestJsonFieldOrdering : pb::IMessage<TestJsonFieldOrdering> {
1111 private static readonly pb::MessageParser<TestJsonFieldOrdering> _parser = new pb::MessageParser<TestJsonFieldOrdering>(() => new TestJsonFieldOrdering());
1112 public static pb::MessageParser<TestJsonFieldOrdering> Parser { get { return _parser; } }
1113
1114 public static pbr::MessageDescriptor Descriptor {
Jon Skeet284bb452015-11-05 09:13:53 +00001115 get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[6]; }
Jon Skeet4fed0b52015-07-31 10:33:31 +01001116 }
1117
1118 pbr::MessageDescriptor pb::IMessage.Descriptor {
1119 get { return Descriptor; }
1120 }
1121
1122 public TestJsonFieldOrdering() {
1123 OnConstruction();
1124 }
1125
1126 partial void OnConstruction();
1127
1128 public TestJsonFieldOrdering(TestJsonFieldOrdering other) : this() {
1129 plainInt32_ = other.plainInt32_;
1130 plainString_ = other.plainString_;
1131 switch (other.O1Case) {
1132 case O1OneofCase.O1String:
1133 O1String = other.O1String;
1134 break;
1135 case O1OneofCase.O1Int32:
1136 O1Int32 = other.O1Int32;
1137 break;
1138 }
1139
1140 switch (other.O2Case) {
1141 case O2OneofCase.O2Int32:
1142 O2Int32 = other.O2Int32;
1143 break;
1144 case O2OneofCase.O2String:
1145 O2String = other.O2String;
1146 break;
1147 }
1148
1149 }
1150
1151 public TestJsonFieldOrdering Clone() {
1152 return new TestJsonFieldOrdering(this);
1153 }
1154
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001155 /// <summary>Field number for the "plain_int32" field.</summary>
Jon Skeet4fed0b52015-07-31 10:33:31 +01001156 public const int PlainInt32FieldNumber = 4;
1157 private int plainInt32_;
1158 public int PlainInt32 {
1159 get { return plainInt32_; }
1160 set {
1161 plainInt32_ = value;
1162 }
1163 }
1164
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001165 /// <summary>Field number for the "o1_string" field.</summary>
Jon Skeet4fed0b52015-07-31 10:33:31 +01001166 public const int O1StringFieldNumber = 2;
1167 public string O1String {
1168 get { return o1Case_ == O1OneofCase.O1String ? (string) o1_ : ""; }
1169 set {
Jon Skeet045b5282016-02-04 15:02:59 +00001170 o1_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
Jon Skeet4fed0b52015-07-31 10:33:31 +01001171 o1Case_ = O1OneofCase.O1String;
1172 }
1173 }
1174
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001175 /// <summary>Field number for the "o1_int32" field.</summary>
Jon Skeet4fed0b52015-07-31 10:33:31 +01001176 public const int O1Int32FieldNumber = 5;
1177 public int O1Int32 {
1178 get { return o1Case_ == O1OneofCase.O1Int32 ? (int) o1_ : 0; }
1179 set {
1180 o1_ = value;
1181 o1Case_ = O1OneofCase.O1Int32;
1182 }
1183 }
1184
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001185 /// <summary>Field number for the "plain_string" field.</summary>
Jon Skeet4fed0b52015-07-31 10:33:31 +01001186 public const int PlainStringFieldNumber = 1;
1187 private string plainString_ = "";
1188 public string PlainString {
1189 get { return plainString_; }
1190 set {
Jon Skeet045b5282016-02-04 15:02:59 +00001191 plainString_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
Jon Skeet4fed0b52015-07-31 10:33:31 +01001192 }
1193 }
1194
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001195 /// <summary>Field number for the "o2_int32" field.</summary>
Jon Skeet4fed0b52015-07-31 10:33:31 +01001196 public const int O2Int32FieldNumber = 6;
1197 public int O2Int32 {
1198 get { return o2Case_ == O2OneofCase.O2Int32 ? (int) o2_ : 0; }
1199 set {
1200 o2_ = value;
1201 o2Case_ = O2OneofCase.O2Int32;
1202 }
1203 }
1204
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001205 /// <summary>Field number for the "o2_string" field.</summary>
Jon Skeet4fed0b52015-07-31 10:33:31 +01001206 public const int O2StringFieldNumber = 3;
1207 public string O2String {
1208 get { return o2Case_ == O2OneofCase.O2String ? (string) o2_ : ""; }
1209 set {
Jon Skeet045b5282016-02-04 15:02:59 +00001210 o2_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
Jon Skeet4fed0b52015-07-31 10:33:31 +01001211 o2Case_ = O2OneofCase.O2String;
1212 }
1213 }
1214
1215 private object o1_;
Jon Skeet6bbbdfa2015-09-30 06:59:38 +01001216 /// <summary>Enum of possible cases for the "o1" oneof.</summary>
Jon Skeet4fed0b52015-07-31 10:33:31 +01001217 public enum O1OneofCase {
1218 None = 0,
1219 O1String = 2,
1220 O1Int32 = 5,
1221 }
1222 private O1OneofCase o1Case_ = O1OneofCase.None;
1223 public O1OneofCase O1Case {
1224 get { return o1Case_; }
1225 }
1226
1227 public void ClearO1() {
1228 o1Case_ = O1OneofCase.None;
1229 o1_ = null;
1230 }
1231
1232 private object o2_;
Jon Skeet6bbbdfa2015-09-30 06:59:38 +01001233 /// <summary>Enum of possible cases for the "o2" oneof.</summary>
Jon Skeet4fed0b52015-07-31 10:33:31 +01001234 public enum O2OneofCase {
1235 None = 0,
1236 O2Int32 = 6,
1237 O2String = 3,
1238 }
1239 private O2OneofCase o2Case_ = O2OneofCase.None;
1240 public O2OneofCase O2Case {
1241 get { return o2Case_; }
1242 }
1243
1244 public void ClearO2() {
1245 o2Case_ = O2OneofCase.None;
1246 o2_ = null;
1247 }
1248
1249 public override bool Equals(object other) {
1250 return Equals(other as TestJsonFieldOrdering);
1251 }
1252
1253 public bool Equals(TestJsonFieldOrdering other) {
1254 if (ReferenceEquals(other, null)) {
1255 return false;
1256 }
1257 if (ReferenceEquals(other, this)) {
1258 return true;
1259 }
1260 if (PlainInt32 != other.PlainInt32) return false;
1261 if (O1String != other.O1String) return false;
1262 if (O1Int32 != other.O1Int32) return false;
1263 if (PlainString != other.PlainString) return false;
1264 if (O2Int32 != other.O2Int32) return false;
1265 if (O2String != other.O2String) return false;
Jon Skeet55313c92015-10-24 06:46:02 +01001266 if (O1Case != other.O1Case) return false;
1267 if (O2Case != other.O2Case) return false;
Jon Skeet4fed0b52015-07-31 10:33:31 +01001268 return true;
1269 }
1270
1271 public override int GetHashCode() {
1272 int hash = 1;
1273 if (PlainInt32 != 0) hash ^= PlainInt32.GetHashCode();
1274 if (o1Case_ == O1OneofCase.O1String) hash ^= O1String.GetHashCode();
1275 if (o1Case_ == O1OneofCase.O1Int32) hash ^= O1Int32.GetHashCode();
1276 if (PlainString.Length != 0) hash ^= PlainString.GetHashCode();
1277 if (o2Case_ == O2OneofCase.O2Int32) hash ^= O2Int32.GetHashCode();
1278 if (o2Case_ == O2OneofCase.O2String) hash ^= O2String.GetHashCode();
Jon Skeet55313c92015-10-24 06:46:02 +01001279 hash ^= (int) o1Case_;
1280 hash ^= (int) o2Case_;
Jon Skeet4fed0b52015-07-31 10:33:31 +01001281 return hash;
1282 }
1283
1284 public override string ToString() {
Jon Skeetadee6fe2015-12-15 09:24:04 +00001285 return pb::JsonFormatter.ToDiagnosticString(this);
Jon Skeet4fed0b52015-07-31 10:33:31 +01001286 }
1287
1288 public void WriteTo(pb::CodedOutputStream output) {
1289 if (PlainString.Length != 0) {
1290 output.WriteRawTag(10);
1291 output.WriteString(PlainString);
1292 }
1293 if (o1Case_ == O1OneofCase.O1String) {
1294 output.WriteRawTag(18);
1295 output.WriteString(O1String);
1296 }
1297 if (o2Case_ == O2OneofCase.O2String) {
1298 output.WriteRawTag(26);
1299 output.WriteString(O2String);
1300 }
1301 if (PlainInt32 != 0) {
1302 output.WriteRawTag(32);
1303 output.WriteInt32(PlainInt32);
1304 }
1305 if (o1Case_ == O1OneofCase.O1Int32) {
1306 output.WriteRawTag(40);
1307 output.WriteInt32(O1Int32);
1308 }
1309 if (o2Case_ == O2OneofCase.O2Int32) {
1310 output.WriteRawTag(48);
1311 output.WriteInt32(O2Int32);
1312 }
1313 }
1314
1315 public int CalculateSize() {
1316 int size = 0;
1317 if (PlainInt32 != 0) {
1318 size += 1 + pb::CodedOutputStream.ComputeInt32Size(PlainInt32);
1319 }
1320 if (o1Case_ == O1OneofCase.O1String) {
1321 size += 1 + pb::CodedOutputStream.ComputeStringSize(O1String);
1322 }
1323 if (o1Case_ == O1OneofCase.O1Int32) {
1324 size += 1 + pb::CodedOutputStream.ComputeInt32Size(O1Int32);
1325 }
1326 if (PlainString.Length != 0) {
1327 size += 1 + pb::CodedOutputStream.ComputeStringSize(PlainString);
1328 }
1329 if (o2Case_ == O2OneofCase.O2Int32) {
1330 size += 1 + pb::CodedOutputStream.ComputeInt32Size(O2Int32);
1331 }
1332 if (o2Case_ == O2OneofCase.O2String) {
1333 size += 1 + pb::CodedOutputStream.ComputeStringSize(O2String);
1334 }
1335 return size;
1336 }
1337
1338 public void MergeFrom(TestJsonFieldOrdering other) {
1339 if (other == null) {
1340 return;
1341 }
1342 if (other.PlainInt32 != 0) {
1343 PlainInt32 = other.PlainInt32;
1344 }
1345 if (other.PlainString.Length != 0) {
1346 PlainString = other.PlainString;
1347 }
1348 switch (other.O1Case) {
1349 case O1OneofCase.O1String:
1350 O1String = other.O1String;
1351 break;
1352 case O1OneofCase.O1Int32:
1353 O1Int32 = other.O1Int32;
1354 break;
1355 }
1356
1357 switch (other.O2Case) {
1358 case O2OneofCase.O2Int32:
1359 O2Int32 = other.O2Int32;
1360 break;
1361 case O2OneofCase.O2String:
1362 O2String = other.O2String;
1363 break;
1364 }
1365
1366 }
1367
1368 public void MergeFrom(pb::CodedInputStream input) {
1369 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +01001370 while ((tag = input.ReadTag()) != 0) {
Jon Skeet4fed0b52015-07-31 10:33:31 +01001371 switch(tag) {
Jon Skeet4fed0b52015-07-31 10:33:31 +01001372 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +01001373 input.SkipLastField();
Jon Skeet4fed0b52015-07-31 10:33:31 +01001374 break;
1375 case 10: {
1376 PlainString = input.ReadString();
1377 break;
1378 }
1379 case 18: {
1380 O1String = input.ReadString();
1381 break;
1382 }
1383 case 26: {
1384 O2String = input.ReadString();
1385 break;
1386 }
1387 case 32: {
1388 PlainInt32 = input.ReadInt32();
1389 break;
1390 }
1391 case 40: {
1392 O1Int32 = input.ReadInt32();
1393 break;
1394 }
1395 case 48: {
1396 O2Int32 = input.ReadInt32();
1397 break;
1398 }
1399 }
1400 }
1401 }
1402
1403 }
1404
alien0d32ab32016-03-17 15:19:04 +03001405 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1406 public sealed partial class TestJsonName : pb::IMessage<TestJsonName> {
1407 private static readonly pb::MessageParser<TestJsonName> _parser = new pb::MessageParser<TestJsonName>(() => new TestJsonName());
1408 public static pb::MessageParser<TestJsonName> Parser { get { return _parser; } }
1409
1410 public static pbr::MessageDescriptor Descriptor {
1411 get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[7]; }
1412 }
1413
1414 pbr::MessageDescriptor pb::IMessage.Descriptor {
1415 get { return Descriptor; }
1416 }
1417
1418 public TestJsonName() {
1419 OnConstruction();
1420 }
1421
1422 partial void OnConstruction();
1423
1424 public TestJsonName(TestJsonName other) : this() {
1425 name_ = other.name_;
1426 description_ = other.description_;
1427 guid_ = other.guid_;
1428 }
1429
1430 public TestJsonName Clone() {
1431 return new TestJsonName(this);
1432 }
1433
1434 /// <summary>Field number for the "name" field.</summary>
1435 public const int NameFieldNumber = 1;
1436 private string name_ = "";
1437 /// <summary>
Jon Skeet84ea2c72016-04-08 12:33:09 +01001438 /// Message for testing the effects for of the json_name option
alien0d32ab32016-03-17 15:19:04 +03001439 /// </summary>
1440 public string Name {
1441 get { return name_; }
1442 set {
1443 name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
1444 }
1445 }
1446
1447 /// <summary>Field number for the "description" field.</summary>
1448 public const int DescriptionFieldNumber = 2;
1449 private string description_ = "";
1450 public string Description {
1451 get { return description_; }
1452 set {
1453 description_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
1454 }
1455 }
1456
1457 /// <summary>Field number for the "guid" field.</summary>
1458 public const int GuidFieldNumber = 3;
1459 private string guid_ = "";
1460 public string Guid {
1461 get { return guid_; }
1462 set {
1463 guid_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
1464 }
1465 }
1466
1467 public override bool Equals(object other) {
1468 return Equals(other as TestJsonName);
1469 }
1470
1471 public bool Equals(TestJsonName other) {
1472 if (ReferenceEquals(other, null)) {
1473 return false;
1474 }
1475 if (ReferenceEquals(other, this)) {
1476 return true;
1477 }
1478 if (Name != other.Name) return false;
1479 if (Description != other.Description) return false;
1480 if (Guid != other.Guid) return false;
1481 return true;
1482 }
1483
1484 public override int GetHashCode() {
1485 int hash = 1;
1486 if (Name.Length != 0) hash ^= Name.GetHashCode();
1487 if (Description.Length != 0) hash ^= Description.GetHashCode();
1488 if (Guid.Length != 0) hash ^= Guid.GetHashCode();
1489 return hash;
1490 }
1491
1492 public override string ToString() {
1493 return pb::JsonFormatter.ToDiagnosticString(this);
1494 }
1495
1496 public void WriteTo(pb::CodedOutputStream output) {
1497 if (Name.Length != 0) {
1498 output.WriteRawTag(10);
1499 output.WriteString(Name);
1500 }
1501 if (Description.Length != 0) {
1502 output.WriteRawTag(18);
1503 output.WriteString(Description);
1504 }
1505 if (Guid.Length != 0) {
1506 output.WriteRawTag(26);
1507 output.WriteString(Guid);
1508 }
1509 }
1510
1511 public int CalculateSize() {
1512 int size = 0;
1513 if (Name.Length != 0) {
1514 size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
1515 }
1516 if (Description.Length != 0) {
1517 size += 1 + pb::CodedOutputStream.ComputeStringSize(Description);
1518 }
1519 if (Guid.Length != 0) {
1520 size += 1 + pb::CodedOutputStream.ComputeStringSize(Guid);
1521 }
1522 return size;
1523 }
1524
1525 public void MergeFrom(TestJsonName other) {
1526 if (other == null) {
1527 return;
1528 }
1529 if (other.Name.Length != 0) {
1530 Name = other.Name;
1531 }
1532 if (other.Description.Length != 0) {
1533 Description = other.Description;
1534 }
1535 if (other.Guid.Length != 0) {
1536 Guid = other.Guid;
1537 }
1538 }
1539
1540 public void MergeFrom(pb::CodedInputStream input) {
1541 uint tag;
1542 while ((tag = input.ReadTag()) != 0) {
1543 switch(tag) {
1544 default:
1545 input.SkipLastField();
1546 break;
1547 case 10: {
1548 Name = input.ReadString();
1549 break;
1550 }
1551 case 18: {
1552 Description = input.ReadString();
1553 break;
1554 }
1555 case 26: {
1556 Guid = input.ReadString();
1557 break;
1558 }
1559 }
1560 }
1561 }
1562
1563 }
1564
Jon Skeetce66c5f2015-04-28 15:06:59 +01001565 #endregion
1566
1567}
1568
1569#endregion Designer generated code