Addressbook.cs 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592
  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> {
  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. uint tag;
  236. while ((tag = input.ReadTag()) != 0) {
  237. switch(tag) {
  238. default:
  239. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  240. break;
  241. case 10: {
  242. Name = input.ReadString();
  243. break;
  244. }
  245. case 16: {
  246. Id = input.ReadInt32();
  247. break;
  248. }
  249. case 26: {
  250. Email = input.ReadString();
  251. break;
  252. }
  253. case 34: {
  254. phones_.AddEntriesFrom(input, _repeated_phones_codec);
  255. break;
  256. }
  257. case 42: {
  258. if (lastUpdated_ == null) {
  259. LastUpdated = new global::Google.Protobuf.WellKnownTypes.Timestamp();
  260. }
  261. input.ReadMessage(LastUpdated);
  262. break;
  263. }
  264. }
  265. }
  266. }
  267. #region Nested types
  268. /// <summary>Container for nested types declared in the Person message type.</summary>
  269. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  270. public static partial class Types {
  271. public enum PhoneType {
  272. [pbr::OriginalName("MOBILE")] Mobile = 0,
  273. [pbr::OriginalName("HOME")] Home = 1,
  274. [pbr::OriginalName("WORK")] Work = 2,
  275. }
  276. public sealed partial class PhoneNumber : pb::IMessage<PhoneNumber> {
  277. private static readonly pb::MessageParser<PhoneNumber> _parser = new pb::MessageParser<PhoneNumber>(() => new PhoneNumber());
  278. private pb::UnknownFieldSet _unknownFields;
  279. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  280. public static pb::MessageParser<PhoneNumber> Parser { get { return _parser; } }
  281. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  282. public static pbr::MessageDescriptor Descriptor {
  283. get { return global::Google.Protobuf.Examples.AddressBook.Person.Descriptor.NestedTypes[0]; }
  284. }
  285. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  286. pbr::MessageDescriptor pb::IMessage.Descriptor {
  287. get { return Descriptor; }
  288. }
  289. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  290. public PhoneNumber() {
  291. OnConstruction();
  292. }
  293. partial void OnConstruction();
  294. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  295. public PhoneNumber(PhoneNumber other) : this() {
  296. number_ = other.number_;
  297. type_ = other.type_;
  298. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  299. }
  300. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  301. public PhoneNumber Clone() {
  302. return new PhoneNumber(this);
  303. }
  304. /// <summary>Field number for the "number" field.</summary>
  305. public const int NumberFieldNumber = 1;
  306. private string number_ = "";
  307. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  308. public string Number {
  309. get { return number_; }
  310. set {
  311. number_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  312. }
  313. }
  314. /// <summary>Field number for the "type" field.</summary>
  315. public const int TypeFieldNumber = 2;
  316. private global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType type_ = global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.Mobile;
  317. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  318. public global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType Type {
  319. get { return type_; }
  320. set {
  321. type_ = value;
  322. }
  323. }
  324. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  325. public override bool Equals(object other) {
  326. return Equals(other as PhoneNumber);
  327. }
  328. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  329. public bool Equals(PhoneNumber other) {
  330. if (ReferenceEquals(other, null)) {
  331. return false;
  332. }
  333. if (ReferenceEquals(other, this)) {
  334. return true;
  335. }
  336. if (Number != other.Number) return false;
  337. if (Type != other.Type) return false;
  338. return Equals(_unknownFields, other._unknownFields);
  339. }
  340. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  341. public override int GetHashCode() {
  342. int hash = 1;
  343. if (Number.Length != 0) hash ^= Number.GetHashCode();
  344. if (Type != global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.Mobile) hash ^= Type.GetHashCode();
  345. if (_unknownFields != null) {
  346. hash ^= _unknownFields.GetHashCode();
  347. }
  348. return hash;
  349. }
  350. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  351. public override string ToString() {
  352. return pb::JsonFormatter.ToDiagnosticString(this);
  353. }
  354. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  355. public void WriteTo(pb::CodedOutputStream output) {
  356. if (Number.Length != 0) {
  357. output.WriteRawTag(10);
  358. output.WriteString(Number);
  359. }
  360. if (Type != global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.Mobile) {
  361. output.WriteRawTag(16);
  362. output.WriteEnum((int) Type);
  363. }
  364. if (_unknownFields != null) {
  365. _unknownFields.WriteTo(output);
  366. }
  367. }
  368. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  369. public int CalculateSize() {
  370. int size = 0;
  371. if (Number.Length != 0) {
  372. size += 1 + pb::CodedOutputStream.ComputeStringSize(Number);
  373. }
  374. if (Type != global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.Mobile) {
  375. size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Type);
  376. }
  377. if (_unknownFields != null) {
  378. size += _unknownFields.CalculateSize();
  379. }
  380. return size;
  381. }
  382. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  383. public void MergeFrom(PhoneNumber other) {
  384. if (other == null) {
  385. return;
  386. }
  387. if (other.Number.Length != 0) {
  388. Number = other.Number;
  389. }
  390. if (other.Type != global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.Mobile) {
  391. Type = other.Type;
  392. }
  393. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  394. }
  395. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  396. public void MergeFrom(pb::CodedInputStream input) {
  397. uint tag;
  398. while ((tag = input.ReadTag()) != 0) {
  399. switch(tag) {
  400. default:
  401. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  402. break;
  403. case 10: {
  404. Number = input.ReadString();
  405. break;
  406. }
  407. case 16: {
  408. Type = (global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType) input.ReadEnum();
  409. break;
  410. }
  411. }
  412. }
  413. }
  414. }
  415. }
  416. #endregion
  417. }
  418. /// <summary>
  419. /// Our address book file is just one of these.
  420. /// </summary>
  421. public sealed partial class AddressBook : pb::IMessage<AddressBook> {
  422. private static readonly pb::MessageParser<AddressBook> _parser = new pb::MessageParser<AddressBook>(() => new AddressBook());
  423. private pb::UnknownFieldSet _unknownFields;
  424. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  425. public static pb::MessageParser<AddressBook> Parser { get { return _parser; } }
  426. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  427. public static pbr::MessageDescriptor Descriptor {
  428. get { return global::Google.Protobuf.Examples.AddressBook.AddressbookReflection.Descriptor.MessageTypes[1]; }
  429. }
  430. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  431. pbr::MessageDescriptor pb::IMessage.Descriptor {
  432. get { return Descriptor; }
  433. }
  434. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  435. public AddressBook() {
  436. OnConstruction();
  437. }
  438. partial void OnConstruction();
  439. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  440. public AddressBook(AddressBook other) : this() {
  441. people_ = other.people_.Clone();
  442. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  443. }
  444. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  445. public AddressBook Clone() {
  446. return new AddressBook(this);
  447. }
  448. /// <summary>Field number for the "people" field.</summary>
  449. public const int PeopleFieldNumber = 1;
  450. private static readonly pb::FieldCodec<global::Google.Protobuf.Examples.AddressBook.Person> _repeated_people_codec
  451. = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.Examples.AddressBook.Person.Parser);
  452. private readonly pbc::RepeatedField<global::Google.Protobuf.Examples.AddressBook.Person> people_ = new pbc::RepeatedField<global::Google.Protobuf.Examples.AddressBook.Person>();
  453. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  454. public pbc::RepeatedField<global::Google.Protobuf.Examples.AddressBook.Person> People {
  455. get { return people_; }
  456. }
  457. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  458. public override bool Equals(object other) {
  459. return Equals(other as AddressBook);
  460. }
  461. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  462. public bool Equals(AddressBook other) {
  463. if (ReferenceEquals(other, null)) {
  464. return false;
  465. }
  466. if (ReferenceEquals(other, this)) {
  467. return true;
  468. }
  469. if(!people_.Equals(other.people_)) return false;
  470. return Equals(_unknownFields, other._unknownFields);
  471. }
  472. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  473. public override int GetHashCode() {
  474. int hash = 1;
  475. hash ^= people_.GetHashCode();
  476. if (_unknownFields != null) {
  477. hash ^= _unknownFields.GetHashCode();
  478. }
  479. return hash;
  480. }
  481. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  482. public override string ToString() {
  483. return pb::JsonFormatter.ToDiagnosticString(this);
  484. }
  485. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  486. public void WriteTo(pb::CodedOutputStream output) {
  487. people_.WriteTo(output, _repeated_people_codec);
  488. if (_unknownFields != null) {
  489. _unknownFields.WriteTo(output);
  490. }
  491. }
  492. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  493. public int CalculateSize() {
  494. int size = 0;
  495. size += people_.CalculateSize(_repeated_people_codec);
  496. if (_unknownFields != null) {
  497. size += _unknownFields.CalculateSize();
  498. }
  499. return size;
  500. }
  501. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  502. public void MergeFrom(AddressBook other) {
  503. if (other == null) {
  504. return;
  505. }
  506. people_.Add(other.people_);
  507. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  508. }
  509. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  510. public void MergeFrom(pb::CodedInputStream input) {
  511. uint tag;
  512. while ((tag = input.ReadTag()) != 0) {
  513. switch(tag) {
  514. default:
  515. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  516. break;
  517. case 10: {
  518. people_.AddEntriesFrom(input, _repeated_people_codec);
  519. break;
  520. }
  521. }
  522. }
  523. }
  524. }
  525. #endregion
  526. }
  527. #endregion Designer generated code