xref: /aosp_15_r20/external/protobuf/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImport.cs (revision 1b3f573f81763fcece89efc2b6a5209149e44ab8)
1 // <auto-generated>
2 //     Generated by the protocol buffer compiler.  DO NOT EDIT!
3 //     source: unittest_import.proto
4 // </auto-generated>
5 #pragma warning disable 1591, 0612, 3021, 8981
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 Google.Protobuf.TestProtos.Proto2 {
13 
14   /// <summary>Holder for reflection information generated from unittest_import.proto</summary>
15   public static partial class UnittestImportReflection {
16 
17     #region Descriptor
18     /// <summary>File descriptor for unittest_import.proto</summary>
19     public static pbr::FileDescriptor Descriptor {
20       get { return descriptor; }
21     }
22     private static pbr::FileDescriptor descriptor;
23 
UnittestImportReflection()24     static UnittestImportReflection() {
25       byte[] descriptorData = global::System.Convert.FromBase64String(
26           string.Concat(
27             "ChV1bml0dGVzdF9pbXBvcnQucHJvdG8SH3Byb3RvYnVmX3VuaXR0ZXN0X2lt",
28             "cG9ydF9wcm90bzIaHHVuaXR0ZXN0X2ltcG9ydF9wdWJsaWMucHJvdG8iGgoN",
29             "SW1wb3J0TWVzc2FnZRIJCgFkGAEgASgFKjwKCkltcG9ydEVudW0SDgoKSU1Q",
30             "T1JUX0ZPTxAHEg4KCklNUE9SVF9CQVIQCBIOCgpJTVBPUlRfQkFaEAkqMQoQ",
31             "SW1wb3J0RW51bUZvck1hcBILCgdVTktOT1dOEAASBwoDRk9PEAESBwoDQkFS",
32             "EAJCKUgB+AEBqgIhR29vZ2xlLlByb3RvYnVmLlRlc3RQcm90b3MuUHJvdG8y",
33             "UAA="));
34       descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
35           new pbr::FileDescriptor[] { global::Google.Protobuf.TestProtos.Proto2.UnittestImportPublicReflection.Descriptor, },
36           new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Google.Protobuf.TestProtos.Proto2.ImportEnum), typeof(global::Google.Protobuf.TestProtos.Proto2.ImportEnumForMap), }, null, new pbr::GeneratedClrTypeInfo[] {
37             new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.TestProtos.Proto2.ImportMessage), global::Google.Protobuf.TestProtos.Proto2.ImportMessage.Parser, new[]{ "D" }, null, null, null, null)
38           }));
39     }
40     #endregion
41 
42   }
43   #region Enums
44   public enum ImportEnum {
45     [pbr::OriginalName("IMPORT_FOO")] ImportFoo = 7,
46     [pbr::OriginalName("IMPORT_BAR")] ImportBar = 8,
47     [pbr::OriginalName("IMPORT_BAZ")] ImportBaz = 9,
48   }
49 
50   /// <summary>
51   /// To use an enum in a map, it must has the first value as 0.
52   /// </summary>
53   public enum ImportEnumForMap {
54     [pbr::OriginalName("UNKNOWN")] Unknown = 0,
55     [pbr::OriginalName("FOO")] Foo = 1,
56     [pbr::OriginalName("BAR")] Bar = 2,
57   }
58 
59   #endregion
60 
61   #region Messages
62   public sealed partial class ImportMessage : pb::IMessage<ImportMessage>
63   #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
64       , pb::IBufferMessage
65   #endif
66   {
67     private static readonly pb::MessageParser<ImportMessage> _parser = new pb::MessageParser<ImportMessage>(() => new ImportMessage());
68     private pb::UnknownFieldSet _unknownFields;
69     private int _hasBits0;
70     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
71     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
72     public static pb::MessageParser<ImportMessage> Parser { get { return _parser; } }
73 
74     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
75     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
76     public static pbr::MessageDescriptor Descriptor {
77       get { return global::Google.Protobuf.TestProtos.Proto2.UnittestImportReflection.Descriptor.MessageTypes[0]; }
78     }
79 
80     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
81     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
82     pbr::MessageDescriptor pb::IMessage.Descriptor {
83       get { return Descriptor; }
84     }
85 
86     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
87     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
ImportMessage()88     public ImportMessage() {
89       OnConstruction();
90     }
91 
OnConstruction()92     partial void OnConstruction();
93 
94     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
95     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
ImportMessage(ImportMessage other)96     public ImportMessage(ImportMessage other) : this() {
97       _hasBits0 = other._hasBits0;
98       d_ = other.d_;
99       _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
100     }
101 
102     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
103     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
Clone()104     public ImportMessage Clone() {
105       return new ImportMessage(this);
106     }
107 
108     /// <summary>Field number for the "d" field.</summary>
109     public const int DFieldNumber = 1;
110     private readonly static int DDefaultValue = 0;
111 
112     private int d_;
113     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
114     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
115     public int D {
116       get { if ((_hasBits0 & 1) != 0) { return d_; } else { return DDefaultValue; } }
117       set {
118         _hasBits0 |= 1;
119         d_ = value;
120       }
121     }
122     /// <summary>Gets whether the "d" field is set</summary>
123     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
124     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
125     public bool HasD {
126       get { return (_hasBits0 & 1) != 0; }
127     }
128     /// <summary>Clears the value of the "d" field</summary>
129     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
130     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
ClearD()131     public void ClearD() {
132       _hasBits0 &= ~1;
133     }
134 
135     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
136     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
Equals(object other)137     public override bool Equals(object other) {
138       return Equals(other as ImportMessage);
139     }
140 
141     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
142     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
Equals(ImportMessage other)143     public bool Equals(ImportMessage other) {
144       if (ReferenceEquals(other, null)) {
145         return false;
146       }
147       if (ReferenceEquals(other, this)) {
148         return true;
149       }
150       if (D != other.D) return false;
151       return Equals(_unknownFields, other._unknownFields);
152     }
153 
154     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
155     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
GetHashCode()156     public override int GetHashCode() {
157       int hash = 1;
158       if (HasD) hash ^= D.GetHashCode();
159       if (_unknownFields != null) {
160         hash ^= _unknownFields.GetHashCode();
161       }
162       return hash;
163     }
164 
165     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
166     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
ToString()167     public override string ToString() {
168       return pb::JsonFormatter.ToDiagnosticString(this);
169     }
170 
171     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
172     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
WriteTo(pb::CodedOutputStream output)173     public void WriteTo(pb::CodedOutputStream output) {
174     #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
175       output.WriteRawMessage(this);
176     #else
177       if (HasD) {
178         output.WriteRawTag(8);
179         output.WriteInt32(D);
180       }
181       if (_unknownFields != null) {
182         _unknownFields.WriteTo(output);
183       }
184     #endif
185     }
186 
187     #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
188     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
189     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
IBufferMessage.InternalWriteTo(ref pb::WriteContext output)190     void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
191       if (HasD) {
192         output.WriteRawTag(8);
193         output.WriteInt32(D);
194       }
195       if (_unknownFields != null) {
196         _unknownFields.WriteTo(ref output);
197       }
198     }
199     #endif
200 
201     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
202     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
CalculateSize()203     public int CalculateSize() {
204       int size = 0;
205       if (HasD) {
206         size += 1 + pb::CodedOutputStream.ComputeInt32Size(D);
207       }
208       if (_unknownFields != null) {
209         size += _unknownFields.CalculateSize();
210       }
211       return size;
212     }
213 
214     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
215     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
MergeFrom(ImportMessage other)216     public void MergeFrom(ImportMessage other) {
217       if (other == null) {
218         return;
219       }
220       if (other.HasD) {
221         D = other.D;
222       }
223       _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
224     }
225 
226     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
227     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
MergeFrom(pb::CodedInputStream input)228     public void MergeFrom(pb::CodedInputStream input) {
229     #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
230       input.ReadRawMessage(this);
231     #else
232       uint tag;
233       while ((tag = input.ReadTag()) != 0) {
234         switch(tag) {
235           default:
236             _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
237             break;
238           case 8: {
239             D = input.ReadInt32();
240             break;
241           }
242         }
243       }
244     #endif
245     }
246 
247     #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
248     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
249     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
IBufferMessage.InternalMergeFrom(ref pb::ParseContext input)250     void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
251       uint tag;
252       while ((tag = input.ReadTag()) != 0) {
253         switch(tag) {
254           default:
255             _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
256             break;
257           case 8: {
258             D = input.ReadInt32();
259             break;
260           }
261         }
262       }
263     }
264     #endif
265 
266   }
267 
268   #endregion
269 
270 }
271 
272 #endregion Designer generated code
273