Addressbook.cs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
  1. // <auto-generated>
  2. // Generated by the protocol buffer compiler. DO NOT EDIT!
  3. // source: addressbook.proto
  4. // </auto-generated>
  5. #pragma warning disable 1591, 0612, 3021
  6. #region Designer generated code
  7. using pb = global::Google.Protobuf;
  8. using pbc = global::Google.Protobuf.Collections;
  9. using pbr = global::Google.Protobuf.Reflection;
  10. using scg = global::System.Collections.Generic;
  11. namespace Google.Protobuf.Examples.AddressBook {
  12. /// <summary>Holder for reflection information generated from addressbook.proto</summary>
  13. public static partial class AddressbookReflection {
  14. #region Descriptor
  15. /// <summary>File descriptor for addressbook.proto</summary>
  16. public static pbr::FileDescriptor Descriptor {
  17. get { return descriptor; }
  18. }
  19. private static pbr::FileDescriptor descriptor;
  20. static AddressbookReflection() {
  21. byte[] descriptorData = global::System.Convert.FromBase64String(
  22. string.Concat(
  23. "ChFhZGRyZXNzYm9vay5wcm90bxIIdHV0b3JpYWwaH2dvb2dsZS9wcm90b2J1",
  24. "Zi90aW1lc3RhbXAucHJvdG8ihwIKBlBlcnNvbhIMCgRuYW1lGAEgASgJEgoK",
  25. "AmlkGAIgASgFEg0KBWVtYWlsGAMgASgJEiwKBnBob25lcxgEIAMoCzIcLnR1",
  26. "dG9yaWFsLlBlcnNvbi5QaG9uZU51bWJlchIwCgxsYXN0X3VwZGF0ZWQYBSAB",
  27. "KAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wGkcKC1Bob25lTnVtYmVy",
  28. "Eg4KBm51bWJlchgBIAEoCRIoCgR0eXBlGAIgASgOMhoudHV0b3JpYWwuUGVy",
  29. "c29uLlBob25lVHlwZSIrCglQaG9uZVR5cGUSCgoGTU9CSUxFEAASCAoESE9N",
  30. "RRABEggKBFdPUksQAiIvCgtBZGRyZXNzQm9vaxIgCgZwZW9wbGUYASADKAsy",
  31. "EC50dXRvcmlhbC5QZXJzb25CUAoUY29tLmV4YW1wbGUudHV0b3JpYWxCEUFk",
  32. "ZHJlc3NCb29rUHJvdG9zqgIkR29vZ2xlLlByb3RvYnVmLkV4YW1wbGVzLkFk",
  33. "ZHJlc3NCb29rYgZwcm90bzM="));
  34. descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
  35. new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.TimestampReflection.Descriptor, },
  36. new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
  37. new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Examples.AddressBook.Person), global::Google.Protobuf.Examples.AddressBook.Person.Parser, new[]{ "Name", "Id", "Email", "Phones", "LastUpdated" }, null, new[]{ typeof(global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType) }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber), global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber.Parser, new[]{ "Number", "Type" }, null, null, null, null)}),
  38. new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Examples.AddressBook.AddressBook), global::Google.Protobuf.Examples.AddressBook.AddressBook.Parser, new[]{ "People" }, null, null, null, null)
  39. }));
  40. }
  41. #endregion
  42. }
  43. #region Messages
  44. /// <summary>
  45. /// [START messages]
  46. /// </summary>
  47. public sealed partial class Person : pb::IMessage<Person>, pb::IBufferMessage {
  48. private static readonly pb::MessageParser<Person> _parser = new pb::MessageParser<Person>(() => new Person());
  49. private pb::UnknownFieldSet _unknownFields;
  50. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  51. public static pb::MessageParser<Person> Parser { get { return _parser; } }
  52. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  53. public static pbr::MessageDescriptor Descriptor {
  54. get { return global::Google.Protobuf.Examples.AddressBook.AddressbookReflection.Descriptor.MessageTypes[0]; }
  55. }
  56. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  57. pbr::MessageDescriptor pb::IMessage.Descriptor {
  58. get { return Descriptor; }
  59. }
  60. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  61. public Person() {
  62. OnConstruction();
  63. }
  64. partial void OnConstruction();
  65. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  66. public Person(Person other) : this() {
  67. name_ = other.name_;
  68. id_ = other.id_;
  69. email_ = other.email_;
  70. phones_ = other.phones_.Clone();
  71. lastUpdated_ = other.lastUpdated_ != null ? other.lastUpdated_.Clone() : null;
  72. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  73. }
  74. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  75. public Person Clone() {
  76. return new Person(this);
  77. }
  78. /// <summary>Field number for the "name" field.</summary>
  79. public const int NameFieldNumber = 1;
  80. private string name_ = "";
  81. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  82. public string Name {
  83. get { return name_; }
  84. set {
  85. name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  86. }
  87. }
  88. /// <summary>Field number for the "id" field.</summary>
  89. public const int IdFieldNumber = 2;
  90. private int id_;
  91. /// <summary>
  92. /// Unique ID number for this person.
  93. /// </summary>
  94. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  95. public int Id {
  96. get { return id_; }
  97. set {
  98. id_ = value;
  99. }
  100. }
  101. /// <summary>Field number for the "email" field.</summary>
  102. public const int EmailFieldNumber = 3;
  103. private string email_ = "";
  104. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  105. public string Email {
  106. get { return email_; }
  107. set {
  108. email_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  109. }
  110. }
  111. /// <summary>Field number for the "phones" field.</summary>
  112. public const int PhonesFieldNumber = 4;
  113. private static readonly pb::FieldCodec<global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber> _repeated_phones_codec
  114. = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber.Parser);
  115. private readonly pbc::RepeatedField<global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber> phones_ = new pbc::RepeatedField<global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber>();
  116. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  117. public pbc::RepeatedField<global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber> Phones {
  118. get { return phones_; }
  119. }
  120. /// <summary>Field number for the "last_updated" field.</summary>
  121. public const int LastUpdatedFieldNumber = 5;
  122. private global::Google.Protobuf.WellKnownTypes.Timestamp lastUpdated_;
  123. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  124. public global::Google.Protobuf.WellKnownTypes.Timestamp LastUpdated {
  125. get { return lastUpdated_; }
  126. set {
  127. lastUpdated_ = value;
  128. }
  129. }
  130. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  131. public override bool Equals(object other) {
  132. return Equals(other as Person);
  133. }
  134. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  135. public bool Equals(Person other) {
  136. if (ReferenceEquals(other, null)) {
  137. return false;
  138. }
  139. if (ReferenceEquals(other, this)) {
  140. return true;
  141. }
  142. if (Name != other.Name) return false;
  143. if (Id != other.Id) return false;
  144. if (Email != other.Email) return false;
  145. if(!phones_.Equals(other.phones_)) return false;
  146. if (!object.Equals(LastUpdated, other.LastUpdated)) return false;
  147. return Equals(_unknownFields, other._unknownFields);
  148. }
  149. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  150. public override int GetHashCode() {
  151. int hash = 1;
  152. if (Name.Length != 0) hash ^= Name.GetHashCode();
  153. if (Id != 0) hash ^= Id.GetHashCode();
  154. if (Email.Length != 0) hash ^= Email.GetHashCode();
  155. hash ^= phones_.GetHashCode();
  156. if (lastUpdated_ != null) hash ^= LastUpdated.GetHashCode();
  157. if (_unknownFields != null) {
  158. hash ^= _unknownFields.GetHashCode();
  159. }
  160. return hash;
  161. }
  162. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  163. public override string ToString() {
  164. return pb::JsonFormatter.ToDiagnosticString(this);
  165. }
  166. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  167. public void WriteTo(pb::CodedOutputStream output) {
  168. if (Name.Length != 0) {
  169. output.WriteRawTag(10);
  170. output.WriteString(Name);
  171. }
  172. if (Id != 0) {
  173. output.WriteRawTag(16);
  174. output.WriteInt32(Id);
  175. }
  176. if (Email.Length != 0) {
  177. output.WriteRawTag(26);
  178. output.WriteString(Email);
  179. }
  180. phones_.WriteTo(output, _repeated_phones_codec);
  181. if (lastUpdated_ != null) {
  182. output.WriteRawTag(42);
  183. output.WriteMessage(LastUpdated);
  184. }
  185. if (_unknownFields != null) {
  186. _unknownFields.WriteTo(output);
  187. }
  188. }
  189. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  190. public int CalculateSize() {
  191. int size = 0;
  192. if (Name.Length != 0) {
  193. size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
  194. }
  195. if (Id != 0) {
  196. size += 1 + pb::CodedOutputStream.ComputeInt32Size(Id);
  197. }
  198. if (Email.Length != 0) {
  199. size += 1 + pb::CodedOutputStream.ComputeStringSize(Email);
  200. }
  201. size += phones_.CalculateSize(_repeated_phones_codec);
  202. if (lastUpdated_ != null) {
  203. size += 1 + pb::CodedOutputStream.ComputeMessageSize(LastUpdated);
  204. }
  205. if (_unknownFields != null) {
  206. size += _unknownFields.CalculateSize();
  207. }
  208. return size;
  209. }
  210. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  211. public void MergeFrom(Person other) {
  212. if (other == null) {
  213. return;
  214. }
  215. if (other.Name.Length != 0) {
  216. Name = other.Name;
  217. }
  218. if (other.Id != 0) {
  219. Id = other.Id;
  220. }
  221. if (other.Email.Length != 0) {
  222. Email = other.Email;
  223. }
  224. phones_.Add(other.phones_);
  225. if (other.lastUpdated_ != null) {
  226. if (lastUpdated_ == null) {
  227. LastUpdated = new global::Google.Protobuf.WellKnownTypes.Timestamp();
  228. }
  229. LastUpdated.MergeFrom(other.LastUpdated);
  230. }
  231. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  232. }
  233. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  234. public void MergeFrom(pb::CodedInputStream input) {
  235. input.ReadRawMessage(this);
  236. }
  237. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  238. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  239. uint tag;
  240. while ((tag = input.ReadTag()) != 0) {
  241. switch(tag) {
  242. default:
  243. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  244. break;
  245. case 10: {
  246. Name = input.ReadString();
  247. break;
  248. }
  249. case 16: {
  250. Id = input.ReadInt32();
  251. break;
  252. }
  253. case 26: {
  254. Email = input.ReadString();
  255. break;
  256. }
  257. case 34: {
  258. phones_.AddEntriesFrom(ref input, _repeated_phones_codec);
  259. break;
  260. }
  261. case 42: {
  262. if (lastUpdated_ == null) {
  263. LastUpdated = new global::Google.Protobuf.WellKnownTypes.Timestamp();
  264. }
  265. input.ReadMessage(LastUpdated);
  266. break;
  267. }
  268. }
  269. }
  270. }
  271. #region Nested types
  272. /// <summary>Container for nested types declared in the Person message type.</summary>
  273. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  274. public static partial class Types {
  275. public enum PhoneType {
  276. [pbr::OriginalName("MOBILE")] Mobile = 0,
  277. [pbr::OriginalName("HOME")] Home = 1,
  278. [pbr::OriginalName("WORK")] Work = 2,
  279. }
  280. public sealed partial class PhoneNumber : pb::IMessage<PhoneNumber>, pb::IBufferMessage {
  281. private static readonly pb::MessageParser<PhoneNumber> _parser = new pb::MessageParser<PhoneNumber>(() => new PhoneNumber());
  282. private pb::UnknownFieldSet _unknownFields;
  283. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  284. public static pb::MessageParser<PhoneNumber> Parser { get { return _parser; } }
  285. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  286. public static pbr::MessageDescriptor Descriptor {
  287. get { return global::Google.Protobuf.Examples.AddressBook.Person.Descriptor.NestedTypes[0]; }
  288. }
  289. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  290. pbr::MessageDescriptor pb::IMessage.Descriptor {
  291. get { return Descriptor; }
  292. }
  293. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  294. public PhoneNumber() {
  295. OnConstruction();
  296. }
  297. partial void OnConstruction();
  298. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  299. public PhoneNumber(PhoneNumber other) : this() {
  300. number_ = other.number_;
  301. type_ = other.type_;
  302. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  303. }
  304. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  305. public PhoneNumber Clone() {
  306. return new PhoneNumber(this);
  307. }
  308. /// <summary>Field number for the "number" field.</summary>
  309. public const int NumberFieldNumber = 1;
  310. private string number_ = "";
  311. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  312. public string Number {
  313. get { return number_; }
  314. set {
  315. number_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  316. }
  317. }
  318. /// <summary>Field number for the "type" field.</summary>
  319. public const int TypeFieldNumber = 2;
  320. private global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType type_ = global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.Mobile;
  321. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  322. public global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType Type {
  323. get { return type_; }
  324. set {
  325. type_ = value;
  326. }
  327. }
  328. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  329. public override bool Equals(object other) {
  330. return Equals(other as PhoneNumber);
  331. }
  332. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  333. public bool Equals(PhoneNumber other) {
  334. if (ReferenceEquals(other, null)) {
  335. return false;
  336. }
  337. if (ReferenceEquals(other, this)) {
  338. return true;
  339. }
  340. if (Number != other.Number) return false;
  341. if (Type != other.Type) return false;
  342. return Equals(_unknownFields, other._unknownFields);
  343. }
  344. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  345. public override int GetHashCode() {
  346. int hash = 1;
  347. if (Number.Length != 0) hash ^= Number.GetHashCode();
  348. if (Type != global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.Mobile) hash ^= Type.GetHashCode();
  349. if (_unknownFields != null) {
  350. hash ^= _unknownFields.GetHashCode();
  351. }
  352. return hash;
  353. }
  354. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  355. public override string ToString() {
  356. return pb::JsonFormatter.ToDiagnosticString(this);
  357. }
  358. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  359. public void WriteTo(pb::CodedOutputStream output) {
  360. if (Number.Length != 0) {
  361. output.WriteRawTag(10);
  362. output.WriteString(Number);
  363. }
  364. if (Type != global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.Mobile) {
  365. output.WriteRawTag(16);
  366. output.WriteEnum((int) Type);
  367. }
  368. if (_unknownFields != null) {
  369. _unknownFields.WriteTo(output);
  370. }
  371. }
  372. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  373. public int CalculateSize() {
  374. int size = 0;
  375. if (Number.Length != 0) {
  376. size += 1 + pb::CodedOutputStream.ComputeStringSize(Number);
  377. }
  378. if (Type != global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.Mobile) {
  379. size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Type);
  380. }
  381. if (_unknownFields != null) {
  382. size += _unknownFields.CalculateSize();
  383. }
  384. return size;
  385. }
  386. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  387. public void MergeFrom(PhoneNumber other) {
  388. if (other == null) {
  389. return;
  390. }
  391. if (other.Number.Length != 0) {
  392. Number = other.Number;
  393. }
  394. if (other.Type != global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.Mobile) {
  395. Type = other.Type;
  396. }
  397. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  398. }
  399. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  400. public void MergeFrom(pb::CodedInputStream input) {
  401. input.ReadRawMessage(this);
  402. }
  403. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  404. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  405. uint tag;
  406. while ((tag = input.ReadTag()) != 0) {
  407. switch(tag) {
  408. default:
  409. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  410. break;
  411. case 10: {
  412. Number = input.ReadString();
  413. break;
  414. }
  415. case 16: {
  416. Type = (global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType) input.ReadEnum();
  417. break;
  418. }
  419. }
  420. }
  421. }
  422. }
  423. }
  424. #endregion
  425. }
  426. /// <summary>
  427. /// Our address book file is just one of these.
  428. /// </summary>
  429. public sealed partial class AddressBook : pb::IMessage<AddressBook>, pb::IBufferMessage {
  430. private static readonly pb::MessageParser<AddressBook> _parser = new pb::MessageParser<AddressBook>(() => new AddressBook());
  431. private pb::UnknownFieldSet _unknownFields;
  432. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  433. public static pb::MessageParser<AddressBook> Parser { get { return _parser; } }
  434. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  435. public static pbr::MessageDescriptor Descriptor {
  436. get { return global::Google.Protobuf.Examples.AddressBook.AddressbookReflection.Descriptor.MessageTypes[1]; }
  437. }
  438. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  439. pbr::MessageDescriptor pb::IMessage.Descriptor {
  440. get { return Descriptor; }
  441. }
  442. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  443. public AddressBook() {
  444. OnConstruction();
  445. }
  446. partial void OnConstruction();
  447. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  448. public AddressBook(AddressBook other) : this() {
  449. people_ = other.people_.Clone();
  450. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  451. }
  452. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  453. public AddressBook Clone() {
  454. return new AddressBook(this);
  455. }
  456. /// <summary>Field number for the "people" field.</summary>
  457. public const int PeopleFieldNumber = 1;
  458. private static readonly pb::FieldCodec<global::Google.Protobuf.Examples.AddressBook.Person> _repeated_people_codec
  459. = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.Examples.AddressBook.Person.Parser);
  460. private readonly pbc::RepeatedField<global::Google.Protobuf.Examples.AddressBook.Person> people_ = new pbc::RepeatedField<global::Google.Protobuf.Examples.AddressBook.Person>();
  461. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  462. public pbc::RepeatedField<global::Google.Protobuf.Examples.AddressBook.Person> People {
  463. get { return people_; }
  464. }
  465. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  466. public override bool Equals(object other) {
  467. return Equals(other as AddressBook);
  468. }
  469. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  470. public bool Equals(AddressBook other) {
  471. if (ReferenceEquals(other, null)) {
  472. return false;
  473. }
  474. if (ReferenceEquals(other, this)) {
  475. return true;
  476. }
  477. if(!people_.Equals(other.people_)) return false;
  478. return Equals(_unknownFields, other._unknownFields);
  479. }
  480. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  481. public override int GetHashCode() {
  482. int hash = 1;
  483. hash ^= people_.GetHashCode();
  484. if (_unknownFields != null) {
  485. hash ^= _unknownFields.GetHashCode();
  486. }
  487. return hash;
  488. }
  489. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  490. public override string ToString() {
  491. return pb::JsonFormatter.ToDiagnosticString(this);
  492. }
  493. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  494. public void WriteTo(pb::CodedOutputStream output) {
  495. people_.WriteTo(output, _repeated_people_codec);
  496. if (_unknownFields != null) {
  497. _unknownFields.WriteTo(output);
  498. }
  499. }
  500. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  501. public int CalculateSize() {
  502. int size = 0;
  503. size += people_.CalculateSize(_repeated_people_codec);
  504. if (_unknownFields != null) {
  505. size += _unknownFields.CalculateSize();
  506. }
  507. return size;
  508. }
  509. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  510. public void MergeFrom(AddressBook other) {
  511. if (other == null) {
  512. return;
  513. }
  514. people_.Add(other.people_);
  515. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  516. }
  517. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  518. public void MergeFrom(pb::CodedInputStream input) {
  519. input.ReadRawMessage(this);
  520. }
  521. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  522. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  523. uint tag;
  524. while ((tag = input.ReadTag()) != 0) {
  525. switch(tag) {
  526. default:
  527. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  528. break;
  529. case 10: {
  530. people_.AddEntriesFrom(ref input, _repeated_people_codec);
  531. break;
  532. }
  533. }
  534. }
  535. }
  536. }
  537. #endregion
  538. }
  539. #endregion Designer generated code