1 /* 2 * Copyright 2020 Google LLC 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * https://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 // Generated by the protocol buffer compiler. DO NOT EDIT! 17 // source: google/type/postal_address.proto 18 19 package com.google.type; 20 21 /** 22 * 23 * 24 * <pre> 25 * Represents a postal address, e.g. for postal delivery or payments addresses. 26 * Given a postal address, a postal service can deliver items to a premise, P.O. 27 * Box or similar. 28 * It is not intended to model geographical locations (roads, towns, 29 * mountains). 30 * In typical usage an address would be created via user input or from importing 31 * existing data, depending on the type of process. 32 * Advice on address input / editing: 33 * - Use an i18n-ready address widget such as 34 * https://github.com/google/libaddressinput) 35 * - Users should not be presented with UI elements for input or editing of 36 * fields outside countries where that field is used. 37 * For more guidance on how to use this schema, please see: 38 * https://support.google.com/business/answer/6397478 39 * </pre> 40 * 41 * Protobuf type {@code google.type.PostalAddress} 42 */ 43 public final class PostalAddress extends com.google.protobuf.GeneratedMessageV3 44 implements 45 // @@protoc_insertion_point(message_implements:google.type.PostalAddress) 46 PostalAddressOrBuilder { 47 private static final long serialVersionUID = 0L; 48 // Use PostalAddress.newBuilder() to construct. PostalAddress(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)49 private PostalAddress(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 50 super(builder); 51 } 52 PostalAddress()53 private PostalAddress() { 54 regionCode_ = ""; 55 languageCode_ = ""; 56 postalCode_ = ""; 57 sortingCode_ = ""; 58 administrativeArea_ = ""; 59 locality_ = ""; 60 sublocality_ = ""; 61 addressLines_ = com.google.protobuf.LazyStringArrayList.EMPTY; 62 recipients_ = com.google.protobuf.LazyStringArrayList.EMPTY; 63 organization_ = ""; 64 } 65 66 @java.lang.Override 67 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)68 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 69 return new PostalAddress(); 70 } 71 72 @java.lang.Override getUnknownFields()73 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 74 return this.unknownFields; 75 } 76 getDescriptor()77 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 78 return com.google.type.PostalAddressProto.internal_static_google_type_PostalAddress_descriptor; 79 } 80 81 @java.lang.Override 82 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()83 internalGetFieldAccessorTable() { 84 return com.google.type.PostalAddressProto 85 .internal_static_google_type_PostalAddress_fieldAccessorTable 86 .ensureFieldAccessorsInitialized( 87 com.google.type.PostalAddress.class, com.google.type.PostalAddress.Builder.class); 88 } 89 90 public static final int REVISION_FIELD_NUMBER = 1; 91 private int revision_ = 0; 92 /** 93 * 94 * 95 * <pre> 96 * The schema revision of the `PostalAddress`. This must be set to 0, which is 97 * the latest revision. 98 * All new revisions **must** be backward compatible with old revisions. 99 * </pre> 100 * 101 * <code>int32 revision = 1;</code> 102 * 103 * @return The revision. 104 */ 105 @java.lang.Override getRevision()106 public int getRevision() { 107 return revision_; 108 } 109 110 public static final int REGION_CODE_FIELD_NUMBER = 2; 111 112 @SuppressWarnings("serial") 113 private volatile java.lang.Object regionCode_ = ""; 114 /** 115 * 116 * 117 * <pre> 118 * Required. CLDR region code of the country/region of the address. This 119 * is never inferred and it is up to the user to ensure the value is 120 * correct. See http://cldr.unicode.org/ and 121 * http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html 122 * for details. Example: "CH" for Switzerland. 123 * </pre> 124 * 125 * <code>string region_code = 2;</code> 126 * 127 * @return The regionCode. 128 */ 129 @java.lang.Override getRegionCode()130 public java.lang.String getRegionCode() { 131 java.lang.Object ref = regionCode_; 132 if (ref instanceof java.lang.String) { 133 return (java.lang.String) ref; 134 } else { 135 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 136 java.lang.String s = bs.toStringUtf8(); 137 regionCode_ = s; 138 return s; 139 } 140 } 141 /** 142 * 143 * 144 * <pre> 145 * Required. CLDR region code of the country/region of the address. This 146 * is never inferred and it is up to the user to ensure the value is 147 * correct. See http://cldr.unicode.org/ and 148 * http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html 149 * for details. Example: "CH" for Switzerland. 150 * </pre> 151 * 152 * <code>string region_code = 2;</code> 153 * 154 * @return The bytes for regionCode. 155 */ 156 @java.lang.Override getRegionCodeBytes()157 public com.google.protobuf.ByteString getRegionCodeBytes() { 158 java.lang.Object ref = regionCode_; 159 if (ref instanceof java.lang.String) { 160 com.google.protobuf.ByteString b = 161 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 162 regionCode_ = b; 163 return b; 164 } else { 165 return (com.google.protobuf.ByteString) ref; 166 } 167 } 168 169 public static final int LANGUAGE_CODE_FIELD_NUMBER = 3; 170 171 @SuppressWarnings("serial") 172 private volatile java.lang.Object languageCode_ = ""; 173 /** 174 * 175 * 176 * <pre> 177 * Optional. BCP-47 language code of the contents of this address (if 178 * known). This is often the UI language of the input form or is expected 179 * to match one of the languages used in the address' country/region, or their 180 * transliterated equivalents. 181 * This can affect formatting in certain countries, but is not critical 182 * to the correctness of the data and will never affect any validation or 183 * other non-formatting related operations. 184 * If this value is not known, it should be omitted (rather than specifying a 185 * possibly incorrect default). 186 * Examples: "zh-Hant", "ja", "ja-Latn", "en". 187 * </pre> 188 * 189 * <code>string language_code = 3;</code> 190 * 191 * @return The languageCode. 192 */ 193 @java.lang.Override getLanguageCode()194 public java.lang.String getLanguageCode() { 195 java.lang.Object ref = languageCode_; 196 if (ref instanceof java.lang.String) { 197 return (java.lang.String) ref; 198 } else { 199 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 200 java.lang.String s = bs.toStringUtf8(); 201 languageCode_ = s; 202 return s; 203 } 204 } 205 /** 206 * 207 * 208 * <pre> 209 * Optional. BCP-47 language code of the contents of this address (if 210 * known). This is often the UI language of the input form or is expected 211 * to match one of the languages used in the address' country/region, or their 212 * transliterated equivalents. 213 * This can affect formatting in certain countries, but is not critical 214 * to the correctness of the data and will never affect any validation or 215 * other non-formatting related operations. 216 * If this value is not known, it should be omitted (rather than specifying a 217 * possibly incorrect default). 218 * Examples: "zh-Hant", "ja", "ja-Latn", "en". 219 * </pre> 220 * 221 * <code>string language_code = 3;</code> 222 * 223 * @return The bytes for languageCode. 224 */ 225 @java.lang.Override getLanguageCodeBytes()226 public com.google.protobuf.ByteString getLanguageCodeBytes() { 227 java.lang.Object ref = languageCode_; 228 if (ref instanceof java.lang.String) { 229 com.google.protobuf.ByteString b = 230 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 231 languageCode_ = b; 232 return b; 233 } else { 234 return (com.google.protobuf.ByteString) ref; 235 } 236 } 237 238 public static final int POSTAL_CODE_FIELD_NUMBER = 4; 239 240 @SuppressWarnings("serial") 241 private volatile java.lang.Object postalCode_ = ""; 242 /** 243 * 244 * 245 * <pre> 246 * Optional. Postal code of the address. Not all countries use or require 247 * postal codes to be present, but where they are used, they may trigger 248 * additional validation with other parts of the address (e.g. state/zip 249 * validation in the U.S.A.). 250 * </pre> 251 * 252 * <code>string postal_code = 4;</code> 253 * 254 * @return The postalCode. 255 */ 256 @java.lang.Override getPostalCode()257 public java.lang.String getPostalCode() { 258 java.lang.Object ref = postalCode_; 259 if (ref instanceof java.lang.String) { 260 return (java.lang.String) ref; 261 } else { 262 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 263 java.lang.String s = bs.toStringUtf8(); 264 postalCode_ = s; 265 return s; 266 } 267 } 268 /** 269 * 270 * 271 * <pre> 272 * Optional. Postal code of the address. Not all countries use or require 273 * postal codes to be present, but where they are used, they may trigger 274 * additional validation with other parts of the address (e.g. state/zip 275 * validation in the U.S.A.). 276 * </pre> 277 * 278 * <code>string postal_code = 4;</code> 279 * 280 * @return The bytes for postalCode. 281 */ 282 @java.lang.Override getPostalCodeBytes()283 public com.google.protobuf.ByteString getPostalCodeBytes() { 284 java.lang.Object ref = postalCode_; 285 if (ref instanceof java.lang.String) { 286 com.google.protobuf.ByteString b = 287 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 288 postalCode_ = b; 289 return b; 290 } else { 291 return (com.google.protobuf.ByteString) ref; 292 } 293 } 294 295 public static final int SORTING_CODE_FIELD_NUMBER = 5; 296 297 @SuppressWarnings("serial") 298 private volatile java.lang.Object sortingCode_ = ""; 299 /** 300 * 301 * 302 * <pre> 303 * Optional. Additional, country-specific, sorting code. This is not used 304 * in most regions. Where it is used, the value is either a string like 305 * "CEDEX", optionally followed by a number (e.g. "CEDEX 7"), or just a number 306 * alone, representing the "sector code" (Jamaica), "delivery area indicator" 307 * (Malawi) or "post office indicator" (e.g. Côte d'Ivoire). 308 * </pre> 309 * 310 * <code>string sorting_code = 5;</code> 311 * 312 * @return The sortingCode. 313 */ 314 @java.lang.Override getSortingCode()315 public java.lang.String getSortingCode() { 316 java.lang.Object ref = sortingCode_; 317 if (ref instanceof java.lang.String) { 318 return (java.lang.String) ref; 319 } else { 320 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 321 java.lang.String s = bs.toStringUtf8(); 322 sortingCode_ = s; 323 return s; 324 } 325 } 326 /** 327 * 328 * 329 * <pre> 330 * Optional. Additional, country-specific, sorting code. This is not used 331 * in most regions. Where it is used, the value is either a string like 332 * "CEDEX", optionally followed by a number (e.g. "CEDEX 7"), or just a number 333 * alone, representing the "sector code" (Jamaica), "delivery area indicator" 334 * (Malawi) or "post office indicator" (e.g. Côte d'Ivoire). 335 * </pre> 336 * 337 * <code>string sorting_code = 5;</code> 338 * 339 * @return The bytes for sortingCode. 340 */ 341 @java.lang.Override getSortingCodeBytes()342 public com.google.protobuf.ByteString getSortingCodeBytes() { 343 java.lang.Object ref = sortingCode_; 344 if (ref instanceof java.lang.String) { 345 com.google.protobuf.ByteString b = 346 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 347 sortingCode_ = b; 348 return b; 349 } else { 350 return (com.google.protobuf.ByteString) ref; 351 } 352 } 353 354 public static final int ADMINISTRATIVE_AREA_FIELD_NUMBER = 6; 355 356 @SuppressWarnings("serial") 357 private volatile java.lang.Object administrativeArea_ = ""; 358 /** 359 * 360 * 361 * <pre> 362 * Optional. Highest administrative subdivision which is used for postal 363 * addresses of a country or region. 364 * For example, this can be a state, a province, an oblast, or a prefecture. 365 * Specifically, for Spain this is the province and not the autonomous 366 * community (e.g. "Barcelona" and not "Catalonia"). 367 * Many countries don't use an administrative area in postal addresses. E.g. 368 * in Switzerland this should be left unpopulated. 369 * </pre> 370 * 371 * <code>string administrative_area = 6;</code> 372 * 373 * @return The administrativeArea. 374 */ 375 @java.lang.Override getAdministrativeArea()376 public java.lang.String getAdministrativeArea() { 377 java.lang.Object ref = administrativeArea_; 378 if (ref instanceof java.lang.String) { 379 return (java.lang.String) ref; 380 } else { 381 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 382 java.lang.String s = bs.toStringUtf8(); 383 administrativeArea_ = s; 384 return s; 385 } 386 } 387 /** 388 * 389 * 390 * <pre> 391 * Optional. Highest administrative subdivision which is used for postal 392 * addresses of a country or region. 393 * For example, this can be a state, a province, an oblast, or a prefecture. 394 * Specifically, for Spain this is the province and not the autonomous 395 * community (e.g. "Barcelona" and not "Catalonia"). 396 * Many countries don't use an administrative area in postal addresses. E.g. 397 * in Switzerland this should be left unpopulated. 398 * </pre> 399 * 400 * <code>string administrative_area = 6;</code> 401 * 402 * @return The bytes for administrativeArea. 403 */ 404 @java.lang.Override getAdministrativeAreaBytes()405 public com.google.protobuf.ByteString getAdministrativeAreaBytes() { 406 java.lang.Object ref = administrativeArea_; 407 if (ref instanceof java.lang.String) { 408 com.google.protobuf.ByteString b = 409 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 410 administrativeArea_ = b; 411 return b; 412 } else { 413 return (com.google.protobuf.ByteString) ref; 414 } 415 } 416 417 public static final int LOCALITY_FIELD_NUMBER = 7; 418 419 @SuppressWarnings("serial") 420 private volatile java.lang.Object locality_ = ""; 421 /** 422 * 423 * 424 * <pre> 425 * Optional. Generally refers to the city/town portion of the address. 426 * Examples: US city, IT comune, UK post town. 427 * In regions of the world where localities are not well defined or do not fit 428 * into this structure well, leave locality empty and use address_lines. 429 * </pre> 430 * 431 * <code>string locality = 7;</code> 432 * 433 * @return The locality. 434 */ 435 @java.lang.Override getLocality()436 public java.lang.String getLocality() { 437 java.lang.Object ref = locality_; 438 if (ref instanceof java.lang.String) { 439 return (java.lang.String) ref; 440 } else { 441 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 442 java.lang.String s = bs.toStringUtf8(); 443 locality_ = s; 444 return s; 445 } 446 } 447 /** 448 * 449 * 450 * <pre> 451 * Optional. Generally refers to the city/town portion of the address. 452 * Examples: US city, IT comune, UK post town. 453 * In regions of the world where localities are not well defined or do not fit 454 * into this structure well, leave locality empty and use address_lines. 455 * </pre> 456 * 457 * <code>string locality = 7;</code> 458 * 459 * @return The bytes for locality. 460 */ 461 @java.lang.Override getLocalityBytes()462 public com.google.protobuf.ByteString getLocalityBytes() { 463 java.lang.Object ref = locality_; 464 if (ref instanceof java.lang.String) { 465 com.google.protobuf.ByteString b = 466 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 467 locality_ = b; 468 return b; 469 } else { 470 return (com.google.protobuf.ByteString) ref; 471 } 472 } 473 474 public static final int SUBLOCALITY_FIELD_NUMBER = 8; 475 476 @SuppressWarnings("serial") 477 private volatile java.lang.Object sublocality_ = ""; 478 /** 479 * 480 * 481 * <pre> 482 * Optional. Sublocality of the address. 483 * For example, this can be neighborhoods, boroughs, districts. 484 * </pre> 485 * 486 * <code>string sublocality = 8;</code> 487 * 488 * @return The sublocality. 489 */ 490 @java.lang.Override getSublocality()491 public java.lang.String getSublocality() { 492 java.lang.Object ref = sublocality_; 493 if (ref instanceof java.lang.String) { 494 return (java.lang.String) ref; 495 } else { 496 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 497 java.lang.String s = bs.toStringUtf8(); 498 sublocality_ = s; 499 return s; 500 } 501 } 502 /** 503 * 504 * 505 * <pre> 506 * Optional. Sublocality of the address. 507 * For example, this can be neighborhoods, boroughs, districts. 508 * </pre> 509 * 510 * <code>string sublocality = 8;</code> 511 * 512 * @return The bytes for sublocality. 513 */ 514 @java.lang.Override getSublocalityBytes()515 public com.google.protobuf.ByteString getSublocalityBytes() { 516 java.lang.Object ref = sublocality_; 517 if (ref instanceof java.lang.String) { 518 com.google.protobuf.ByteString b = 519 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 520 sublocality_ = b; 521 return b; 522 } else { 523 return (com.google.protobuf.ByteString) ref; 524 } 525 } 526 527 public static final int ADDRESS_LINES_FIELD_NUMBER = 9; 528 529 @SuppressWarnings("serial") 530 private com.google.protobuf.LazyStringList addressLines_; 531 /** 532 * 533 * 534 * <pre> 535 * Unstructured address lines describing the lower levels of an address. 536 * Because values in address_lines do not have type information and may 537 * sometimes contain multiple values in a single field (e.g. 538 * "Austin, TX"), it is important that the line order is clear. The order of 539 * address lines should be "envelope order" for the country/region of the 540 * address. In places where this can vary (e.g. Japan), address_language is 541 * used to make it explicit (e.g. "ja" for large-to-small ordering and 542 * "ja-Latn" or "en" for small-to-large). This way, the most specific line of 543 * an address can be selected based on the language. 544 * The minimum permitted structural representation of an address consists 545 * of a region_code with all remaining information placed in the 546 * address_lines. It would be possible to format such an address very 547 * approximately without geocoding, but no semantic reasoning could be 548 * made about any of the address components until it was at least 549 * partially resolved. 550 * Creating an address only containing a region_code and address_lines, and 551 * then geocoding is the recommended way to handle completely unstructured 552 * addresses (as opposed to guessing which parts of the address should be 553 * localities or administrative areas). 554 * </pre> 555 * 556 * <code>repeated string address_lines = 9;</code> 557 * 558 * @return A list containing the addressLines. 559 */ getAddressLinesList()560 public com.google.protobuf.ProtocolStringList getAddressLinesList() { 561 return addressLines_; 562 } 563 /** 564 * 565 * 566 * <pre> 567 * Unstructured address lines describing the lower levels of an address. 568 * Because values in address_lines do not have type information and may 569 * sometimes contain multiple values in a single field (e.g. 570 * "Austin, TX"), it is important that the line order is clear. The order of 571 * address lines should be "envelope order" for the country/region of the 572 * address. In places where this can vary (e.g. Japan), address_language is 573 * used to make it explicit (e.g. "ja" for large-to-small ordering and 574 * "ja-Latn" or "en" for small-to-large). This way, the most specific line of 575 * an address can be selected based on the language. 576 * The minimum permitted structural representation of an address consists 577 * of a region_code with all remaining information placed in the 578 * address_lines. It would be possible to format such an address very 579 * approximately without geocoding, but no semantic reasoning could be 580 * made about any of the address components until it was at least 581 * partially resolved. 582 * Creating an address only containing a region_code and address_lines, and 583 * then geocoding is the recommended way to handle completely unstructured 584 * addresses (as opposed to guessing which parts of the address should be 585 * localities or administrative areas). 586 * </pre> 587 * 588 * <code>repeated string address_lines = 9;</code> 589 * 590 * @return The count of addressLines. 591 */ getAddressLinesCount()592 public int getAddressLinesCount() { 593 return addressLines_.size(); 594 } 595 /** 596 * 597 * 598 * <pre> 599 * Unstructured address lines describing the lower levels of an address. 600 * Because values in address_lines do not have type information and may 601 * sometimes contain multiple values in a single field (e.g. 602 * "Austin, TX"), it is important that the line order is clear. The order of 603 * address lines should be "envelope order" for the country/region of the 604 * address. In places where this can vary (e.g. Japan), address_language is 605 * used to make it explicit (e.g. "ja" for large-to-small ordering and 606 * "ja-Latn" or "en" for small-to-large). This way, the most specific line of 607 * an address can be selected based on the language. 608 * The minimum permitted structural representation of an address consists 609 * of a region_code with all remaining information placed in the 610 * address_lines. It would be possible to format such an address very 611 * approximately without geocoding, but no semantic reasoning could be 612 * made about any of the address components until it was at least 613 * partially resolved. 614 * Creating an address only containing a region_code and address_lines, and 615 * then geocoding is the recommended way to handle completely unstructured 616 * addresses (as opposed to guessing which parts of the address should be 617 * localities or administrative areas). 618 * </pre> 619 * 620 * <code>repeated string address_lines = 9;</code> 621 * 622 * @param index The index of the element to return. 623 * @return The addressLines at the given index. 624 */ getAddressLines(int index)625 public java.lang.String getAddressLines(int index) { 626 return addressLines_.get(index); 627 } 628 /** 629 * 630 * 631 * <pre> 632 * Unstructured address lines describing the lower levels of an address. 633 * Because values in address_lines do not have type information and may 634 * sometimes contain multiple values in a single field (e.g. 635 * "Austin, TX"), it is important that the line order is clear. The order of 636 * address lines should be "envelope order" for the country/region of the 637 * address. In places where this can vary (e.g. Japan), address_language is 638 * used to make it explicit (e.g. "ja" for large-to-small ordering and 639 * "ja-Latn" or "en" for small-to-large). This way, the most specific line of 640 * an address can be selected based on the language. 641 * The minimum permitted structural representation of an address consists 642 * of a region_code with all remaining information placed in the 643 * address_lines. It would be possible to format such an address very 644 * approximately without geocoding, but no semantic reasoning could be 645 * made about any of the address components until it was at least 646 * partially resolved. 647 * Creating an address only containing a region_code and address_lines, and 648 * then geocoding is the recommended way to handle completely unstructured 649 * addresses (as opposed to guessing which parts of the address should be 650 * localities or administrative areas). 651 * </pre> 652 * 653 * <code>repeated string address_lines = 9;</code> 654 * 655 * @param index The index of the value to return. 656 * @return The bytes of the addressLines at the given index. 657 */ getAddressLinesBytes(int index)658 public com.google.protobuf.ByteString getAddressLinesBytes(int index) { 659 return addressLines_.getByteString(index); 660 } 661 662 public static final int RECIPIENTS_FIELD_NUMBER = 10; 663 664 @SuppressWarnings("serial") 665 private com.google.protobuf.LazyStringList recipients_; 666 /** 667 * 668 * 669 * <pre> 670 * Optional. The recipient at the address. 671 * This field may, under certain circumstances, contain multiline information. 672 * For example, it might contain "care of" information. 673 * </pre> 674 * 675 * <code>repeated string recipients = 10;</code> 676 * 677 * @return A list containing the recipients. 678 */ getRecipientsList()679 public com.google.protobuf.ProtocolStringList getRecipientsList() { 680 return recipients_; 681 } 682 /** 683 * 684 * 685 * <pre> 686 * Optional. The recipient at the address. 687 * This field may, under certain circumstances, contain multiline information. 688 * For example, it might contain "care of" information. 689 * </pre> 690 * 691 * <code>repeated string recipients = 10;</code> 692 * 693 * @return The count of recipients. 694 */ getRecipientsCount()695 public int getRecipientsCount() { 696 return recipients_.size(); 697 } 698 /** 699 * 700 * 701 * <pre> 702 * Optional. The recipient at the address. 703 * This field may, under certain circumstances, contain multiline information. 704 * For example, it might contain "care of" information. 705 * </pre> 706 * 707 * <code>repeated string recipients = 10;</code> 708 * 709 * @param index The index of the element to return. 710 * @return The recipients at the given index. 711 */ getRecipients(int index)712 public java.lang.String getRecipients(int index) { 713 return recipients_.get(index); 714 } 715 /** 716 * 717 * 718 * <pre> 719 * Optional. The recipient at the address. 720 * This field may, under certain circumstances, contain multiline information. 721 * For example, it might contain "care of" information. 722 * </pre> 723 * 724 * <code>repeated string recipients = 10;</code> 725 * 726 * @param index The index of the value to return. 727 * @return The bytes of the recipients at the given index. 728 */ getRecipientsBytes(int index)729 public com.google.protobuf.ByteString getRecipientsBytes(int index) { 730 return recipients_.getByteString(index); 731 } 732 733 public static final int ORGANIZATION_FIELD_NUMBER = 11; 734 735 @SuppressWarnings("serial") 736 private volatile java.lang.Object organization_ = ""; 737 /** 738 * 739 * 740 * <pre> 741 * Optional. The name of the organization at the address. 742 * </pre> 743 * 744 * <code>string organization = 11;</code> 745 * 746 * @return The organization. 747 */ 748 @java.lang.Override getOrganization()749 public java.lang.String getOrganization() { 750 java.lang.Object ref = organization_; 751 if (ref instanceof java.lang.String) { 752 return (java.lang.String) ref; 753 } else { 754 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 755 java.lang.String s = bs.toStringUtf8(); 756 organization_ = s; 757 return s; 758 } 759 } 760 /** 761 * 762 * 763 * <pre> 764 * Optional. The name of the organization at the address. 765 * </pre> 766 * 767 * <code>string organization = 11;</code> 768 * 769 * @return The bytes for organization. 770 */ 771 @java.lang.Override getOrganizationBytes()772 public com.google.protobuf.ByteString getOrganizationBytes() { 773 java.lang.Object ref = organization_; 774 if (ref instanceof java.lang.String) { 775 com.google.protobuf.ByteString b = 776 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 777 organization_ = b; 778 return b; 779 } else { 780 return (com.google.protobuf.ByteString) ref; 781 } 782 } 783 784 private byte memoizedIsInitialized = -1; 785 786 @java.lang.Override isInitialized()787 public final boolean isInitialized() { 788 byte isInitialized = memoizedIsInitialized; 789 if (isInitialized == 1) return true; 790 if (isInitialized == 0) return false; 791 792 memoizedIsInitialized = 1; 793 return true; 794 } 795 796 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)797 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 798 if (revision_ != 0) { 799 output.writeInt32(1, revision_); 800 } 801 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(regionCode_)) { 802 com.google.protobuf.GeneratedMessageV3.writeString(output, 2, regionCode_); 803 } 804 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { 805 com.google.protobuf.GeneratedMessageV3.writeString(output, 3, languageCode_); 806 } 807 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(postalCode_)) { 808 com.google.protobuf.GeneratedMessageV3.writeString(output, 4, postalCode_); 809 } 810 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sortingCode_)) { 811 com.google.protobuf.GeneratedMessageV3.writeString(output, 5, sortingCode_); 812 } 813 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(administrativeArea_)) { 814 com.google.protobuf.GeneratedMessageV3.writeString(output, 6, administrativeArea_); 815 } 816 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(locality_)) { 817 com.google.protobuf.GeneratedMessageV3.writeString(output, 7, locality_); 818 } 819 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sublocality_)) { 820 com.google.protobuf.GeneratedMessageV3.writeString(output, 8, sublocality_); 821 } 822 for (int i = 0; i < addressLines_.size(); i++) { 823 com.google.protobuf.GeneratedMessageV3.writeString(output, 9, addressLines_.getRaw(i)); 824 } 825 for (int i = 0; i < recipients_.size(); i++) { 826 com.google.protobuf.GeneratedMessageV3.writeString(output, 10, recipients_.getRaw(i)); 827 } 828 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(organization_)) { 829 com.google.protobuf.GeneratedMessageV3.writeString(output, 11, organization_); 830 } 831 getUnknownFields().writeTo(output); 832 } 833 834 @java.lang.Override getSerializedSize()835 public int getSerializedSize() { 836 int size = memoizedSize; 837 if (size != -1) return size; 838 839 size = 0; 840 if (revision_ != 0) { 841 size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, revision_); 842 } 843 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(regionCode_)) { 844 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, regionCode_); 845 } 846 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { 847 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, languageCode_); 848 } 849 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(postalCode_)) { 850 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, postalCode_); 851 } 852 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sortingCode_)) { 853 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, sortingCode_); 854 } 855 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(administrativeArea_)) { 856 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, administrativeArea_); 857 } 858 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(locality_)) { 859 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, locality_); 860 } 861 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sublocality_)) { 862 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, sublocality_); 863 } 864 { 865 int dataSize = 0; 866 for (int i = 0; i < addressLines_.size(); i++) { 867 dataSize += computeStringSizeNoTag(addressLines_.getRaw(i)); 868 } 869 size += dataSize; 870 size += 1 * getAddressLinesList().size(); 871 } 872 { 873 int dataSize = 0; 874 for (int i = 0; i < recipients_.size(); i++) { 875 dataSize += computeStringSizeNoTag(recipients_.getRaw(i)); 876 } 877 size += dataSize; 878 size += 1 * getRecipientsList().size(); 879 } 880 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(organization_)) { 881 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, organization_); 882 } 883 size += getUnknownFields().getSerializedSize(); 884 memoizedSize = size; 885 return size; 886 } 887 888 @java.lang.Override equals(final java.lang.Object obj)889 public boolean equals(final java.lang.Object obj) { 890 if (obj == this) { 891 return true; 892 } 893 if (!(obj instanceof com.google.type.PostalAddress)) { 894 return super.equals(obj); 895 } 896 com.google.type.PostalAddress other = (com.google.type.PostalAddress) obj; 897 898 if (getRevision() != other.getRevision()) return false; 899 if (!getRegionCode().equals(other.getRegionCode())) return false; 900 if (!getLanguageCode().equals(other.getLanguageCode())) return false; 901 if (!getPostalCode().equals(other.getPostalCode())) return false; 902 if (!getSortingCode().equals(other.getSortingCode())) return false; 903 if (!getAdministrativeArea().equals(other.getAdministrativeArea())) return false; 904 if (!getLocality().equals(other.getLocality())) return false; 905 if (!getSublocality().equals(other.getSublocality())) return false; 906 if (!getAddressLinesList().equals(other.getAddressLinesList())) return false; 907 if (!getRecipientsList().equals(other.getRecipientsList())) return false; 908 if (!getOrganization().equals(other.getOrganization())) return false; 909 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 910 return true; 911 } 912 913 @java.lang.Override hashCode()914 public int hashCode() { 915 if (memoizedHashCode != 0) { 916 return memoizedHashCode; 917 } 918 int hash = 41; 919 hash = (19 * hash) + getDescriptor().hashCode(); 920 hash = (37 * hash) + REVISION_FIELD_NUMBER; 921 hash = (53 * hash) + getRevision(); 922 hash = (37 * hash) + REGION_CODE_FIELD_NUMBER; 923 hash = (53 * hash) + getRegionCode().hashCode(); 924 hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; 925 hash = (53 * hash) + getLanguageCode().hashCode(); 926 hash = (37 * hash) + POSTAL_CODE_FIELD_NUMBER; 927 hash = (53 * hash) + getPostalCode().hashCode(); 928 hash = (37 * hash) + SORTING_CODE_FIELD_NUMBER; 929 hash = (53 * hash) + getSortingCode().hashCode(); 930 hash = (37 * hash) + ADMINISTRATIVE_AREA_FIELD_NUMBER; 931 hash = (53 * hash) + getAdministrativeArea().hashCode(); 932 hash = (37 * hash) + LOCALITY_FIELD_NUMBER; 933 hash = (53 * hash) + getLocality().hashCode(); 934 hash = (37 * hash) + SUBLOCALITY_FIELD_NUMBER; 935 hash = (53 * hash) + getSublocality().hashCode(); 936 if (getAddressLinesCount() > 0) { 937 hash = (37 * hash) + ADDRESS_LINES_FIELD_NUMBER; 938 hash = (53 * hash) + getAddressLinesList().hashCode(); 939 } 940 if (getRecipientsCount() > 0) { 941 hash = (37 * hash) + RECIPIENTS_FIELD_NUMBER; 942 hash = (53 * hash) + getRecipientsList().hashCode(); 943 } 944 hash = (37 * hash) + ORGANIZATION_FIELD_NUMBER; 945 hash = (53 * hash) + getOrganization().hashCode(); 946 hash = (29 * hash) + getUnknownFields().hashCode(); 947 memoizedHashCode = hash; 948 return hash; 949 } 950 parseFrom(java.nio.ByteBuffer data)951 public static com.google.type.PostalAddress parseFrom(java.nio.ByteBuffer data) 952 throws com.google.protobuf.InvalidProtocolBufferException { 953 return PARSER.parseFrom(data); 954 } 955 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)956 public static com.google.type.PostalAddress parseFrom( 957 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 958 throws com.google.protobuf.InvalidProtocolBufferException { 959 return PARSER.parseFrom(data, extensionRegistry); 960 } 961 parseFrom(com.google.protobuf.ByteString data)962 public static com.google.type.PostalAddress parseFrom(com.google.protobuf.ByteString data) 963 throws com.google.protobuf.InvalidProtocolBufferException { 964 return PARSER.parseFrom(data); 965 } 966 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)967 public static com.google.type.PostalAddress parseFrom( 968 com.google.protobuf.ByteString data, 969 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 970 throws com.google.protobuf.InvalidProtocolBufferException { 971 return PARSER.parseFrom(data, extensionRegistry); 972 } 973 parseFrom(byte[] data)974 public static com.google.type.PostalAddress parseFrom(byte[] data) 975 throws com.google.protobuf.InvalidProtocolBufferException { 976 return PARSER.parseFrom(data); 977 } 978 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)979 public static com.google.type.PostalAddress parseFrom( 980 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 981 throws com.google.protobuf.InvalidProtocolBufferException { 982 return PARSER.parseFrom(data, extensionRegistry); 983 } 984 parseFrom(java.io.InputStream input)985 public static com.google.type.PostalAddress parseFrom(java.io.InputStream input) 986 throws java.io.IOException { 987 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 988 } 989 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)990 public static com.google.type.PostalAddress parseFrom( 991 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 992 throws java.io.IOException { 993 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 994 PARSER, input, extensionRegistry); 995 } 996 parseDelimitedFrom(java.io.InputStream input)997 public static com.google.type.PostalAddress parseDelimitedFrom(java.io.InputStream input) 998 throws java.io.IOException { 999 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 1000 } 1001 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1002 public static com.google.type.PostalAddress parseDelimitedFrom( 1003 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1004 throws java.io.IOException { 1005 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 1006 PARSER, input, extensionRegistry); 1007 } 1008 parseFrom(com.google.protobuf.CodedInputStream input)1009 public static com.google.type.PostalAddress parseFrom(com.google.protobuf.CodedInputStream input) 1010 throws java.io.IOException { 1011 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 1012 } 1013 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1014 public static com.google.type.PostalAddress parseFrom( 1015 com.google.protobuf.CodedInputStream input, 1016 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1017 throws java.io.IOException { 1018 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 1019 PARSER, input, extensionRegistry); 1020 } 1021 1022 @java.lang.Override newBuilderForType()1023 public Builder newBuilderForType() { 1024 return newBuilder(); 1025 } 1026 newBuilder()1027 public static Builder newBuilder() { 1028 return DEFAULT_INSTANCE.toBuilder(); 1029 } 1030 newBuilder(com.google.type.PostalAddress prototype)1031 public static Builder newBuilder(com.google.type.PostalAddress prototype) { 1032 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 1033 } 1034 1035 @java.lang.Override toBuilder()1036 public Builder toBuilder() { 1037 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 1038 } 1039 1040 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)1041 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 1042 Builder builder = new Builder(parent); 1043 return builder; 1044 } 1045 /** 1046 * 1047 * 1048 * <pre> 1049 * Represents a postal address, e.g. for postal delivery or payments addresses. 1050 * Given a postal address, a postal service can deliver items to a premise, P.O. 1051 * Box or similar. 1052 * It is not intended to model geographical locations (roads, towns, 1053 * mountains). 1054 * In typical usage an address would be created via user input or from importing 1055 * existing data, depending on the type of process. 1056 * Advice on address input / editing: 1057 * - Use an i18n-ready address widget such as 1058 * https://github.com/google/libaddressinput) 1059 * - Users should not be presented with UI elements for input or editing of 1060 * fields outside countries where that field is used. 1061 * For more guidance on how to use this schema, please see: 1062 * https://support.google.com/business/answer/6397478 1063 * </pre> 1064 * 1065 * Protobuf type {@code google.type.PostalAddress} 1066 */ 1067 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 1068 implements 1069 // @@protoc_insertion_point(builder_implements:google.type.PostalAddress) 1070 com.google.type.PostalAddressOrBuilder { getDescriptor()1071 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 1072 return com.google.type.PostalAddressProto 1073 .internal_static_google_type_PostalAddress_descriptor; 1074 } 1075 1076 @java.lang.Override 1077 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()1078 internalGetFieldAccessorTable() { 1079 return com.google.type.PostalAddressProto 1080 .internal_static_google_type_PostalAddress_fieldAccessorTable 1081 .ensureFieldAccessorsInitialized( 1082 com.google.type.PostalAddress.class, com.google.type.PostalAddress.Builder.class); 1083 } 1084 1085 // Construct using com.google.type.PostalAddress.newBuilder() Builder()1086 private Builder() {} 1087 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)1088 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 1089 super(parent); 1090 } 1091 1092 @java.lang.Override clear()1093 public Builder clear() { 1094 super.clear(); 1095 bitField0_ = 0; 1096 revision_ = 0; 1097 regionCode_ = ""; 1098 languageCode_ = ""; 1099 postalCode_ = ""; 1100 sortingCode_ = ""; 1101 administrativeArea_ = ""; 1102 locality_ = ""; 1103 sublocality_ = ""; 1104 addressLines_ = com.google.protobuf.LazyStringArrayList.EMPTY; 1105 bitField0_ = (bitField0_ & ~0x00000100); 1106 recipients_ = com.google.protobuf.LazyStringArrayList.EMPTY; 1107 bitField0_ = (bitField0_ & ~0x00000200); 1108 organization_ = ""; 1109 return this; 1110 } 1111 1112 @java.lang.Override getDescriptorForType()1113 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 1114 return com.google.type.PostalAddressProto 1115 .internal_static_google_type_PostalAddress_descriptor; 1116 } 1117 1118 @java.lang.Override getDefaultInstanceForType()1119 public com.google.type.PostalAddress getDefaultInstanceForType() { 1120 return com.google.type.PostalAddress.getDefaultInstance(); 1121 } 1122 1123 @java.lang.Override build()1124 public com.google.type.PostalAddress build() { 1125 com.google.type.PostalAddress result = buildPartial(); 1126 if (!result.isInitialized()) { 1127 throw newUninitializedMessageException(result); 1128 } 1129 return result; 1130 } 1131 1132 @java.lang.Override buildPartial()1133 public com.google.type.PostalAddress buildPartial() { 1134 com.google.type.PostalAddress result = new com.google.type.PostalAddress(this); 1135 buildPartialRepeatedFields(result); 1136 if (bitField0_ != 0) { 1137 buildPartial0(result); 1138 } 1139 onBuilt(); 1140 return result; 1141 } 1142 buildPartialRepeatedFields(com.google.type.PostalAddress result)1143 private void buildPartialRepeatedFields(com.google.type.PostalAddress result) { 1144 if (((bitField0_ & 0x00000100) != 0)) { 1145 addressLines_ = addressLines_.getUnmodifiableView(); 1146 bitField0_ = (bitField0_ & ~0x00000100); 1147 } 1148 result.addressLines_ = addressLines_; 1149 if (((bitField0_ & 0x00000200) != 0)) { 1150 recipients_ = recipients_.getUnmodifiableView(); 1151 bitField0_ = (bitField0_ & ~0x00000200); 1152 } 1153 result.recipients_ = recipients_; 1154 } 1155 buildPartial0(com.google.type.PostalAddress result)1156 private void buildPartial0(com.google.type.PostalAddress result) { 1157 int from_bitField0_ = bitField0_; 1158 if (((from_bitField0_ & 0x00000001) != 0)) { 1159 result.revision_ = revision_; 1160 } 1161 if (((from_bitField0_ & 0x00000002) != 0)) { 1162 result.regionCode_ = regionCode_; 1163 } 1164 if (((from_bitField0_ & 0x00000004) != 0)) { 1165 result.languageCode_ = languageCode_; 1166 } 1167 if (((from_bitField0_ & 0x00000008) != 0)) { 1168 result.postalCode_ = postalCode_; 1169 } 1170 if (((from_bitField0_ & 0x00000010) != 0)) { 1171 result.sortingCode_ = sortingCode_; 1172 } 1173 if (((from_bitField0_ & 0x00000020) != 0)) { 1174 result.administrativeArea_ = administrativeArea_; 1175 } 1176 if (((from_bitField0_ & 0x00000040) != 0)) { 1177 result.locality_ = locality_; 1178 } 1179 if (((from_bitField0_ & 0x00000080) != 0)) { 1180 result.sublocality_ = sublocality_; 1181 } 1182 if (((from_bitField0_ & 0x00000400) != 0)) { 1183 result.organization_ = organization_; 1184 } 1185 } 1186 1187 @java.lang.Override clone()1188 public Builder clone() { 1189 return super.clone(); 1190 } 1191 1192 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)1193 public Builder setField( 1194 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 1195 return super.setField(field, value); 1196 } 1197 1198 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)1199 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 1200 return super.clearField(field); 1201 } 1202 1203 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)1204 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 1205 return super.clearOneof(oneof); 1206 } 1207 1208 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)1209 public Builder setRepeatedField( 1210 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 1211 return super.setRepeatedField(field, index, value); 1212 } 1213 1214 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)1215 public Builder addRepeatedField( 1216 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 1217 return super.addRepeatedField(field, value); 1218 } 1219 1220 @java.lang.Override mergeFrom(com.google.protobuf.Message other)1221 public Builder mergeFrom(com.google.protobuf.Message other) { 1222 if (other instanceof com.google.type.PostalAddress) { 1223 return mergeFrom((com.google.type.PostalAddress) other); 1224 } else { 1225 super.mergeFrom(other); 1226 return this; 1227 } 1228 } 1229 mergeFrom(com.google.type.PostalAddress other)1230 public Builder mergeFrom(com.google.type.PostalAddress other) { 1231 if (other == com.google.type.PostalAddress.getDefaultInstance()) return this; 1232 if (other.getRevision() != 0) { 1233 setRevision(other.getRevision()); 1234 } 1235 if (!other.getRegionCode().isEmpty()) { 1236 regionCode_ = other.regionCode_; 1237 bitField0_ |= 0x00000002; 1238 onChanged(); 1239 } 1240 if (!other.getLanguageCode().isEmpty()) { 1241 languageCode_ = other.languageCode_; 1242 bitField0_ |= 0x00000004; 1243 onChanged(); 1244 } 1245 if (!other.getPostalCode().isEmpty()) { 1246 postalCode_ = other.postalCode_; 1247 bitField0_ |= 0x00000008; 1248 onChanged(); 1249 } 1250 if (!other.getSortingCode().isEmpty()) { 1251 sortingCode_ = other.sortingCode_; 1252 bitField0_ |= 0x00000010; 1253 onChanged(); 1254 } 1255 if (!other.getAdministrativeArea().isEmpty()) { 1256 administrativeArea_ = other.administrativeArea_; 1257 bitField0_ |= 0x00000020; 1258 onChanged(); 1259 } 1260 if (!other.getLocality().isEmpty()) { 1261 locality_ = other.locality_; 1262 bitField0_ |= 0x00000040; 1263 onChanged(); 1264 } 1265 if (!other.getSublocality().isEmpty()) { 1266 sublocality_ = other.sublocality_; 1267 bitField0_ |= 0x00000080; 1268 onChanged(); 1269 } 1270 if (!other.addressLines_.isEmpty()) { 1271 if (addressLines_.isEmpty()) { 1272 addressLines_ = other.addressLines_; 1273 bitField0_ = (bitField0_ & ~0x00000100); 1274 } else { 1275 ensureAddressLinesIsMutable(); 1276 addressLines_.addAll(other.addressLines_); 1277 } 1278 onChanged(); 1279 } 1280 if (!other.recipients_.isEmpty()) { 1281 if (recipients_.isEmpty()) { 1282 recipients_ = other.recipients_; 1283 bitField0_ = (bitField0_ & ~0x00000200); 1284 } else { 1285 ensureRecipientsIsMutable(); 1286 recipients_.addAll(other.recipients_); 1287 } 1288 onChanged(); 1289 } 1290 if (!other.getOrganization().isEmpty()) { 1291 organization_ = other.organization_; 1292 bitField0_ |= 0x00000400; 1293 onChanged(); 1294 } 1295 this.mergeUnknownFields(other.getUnknownFields()); 1296 onChanged(); 1297 return this; 1298 } 1299 1300 @java.lang.Override isInitialized()1301 public final boolean isInitialized() { 1302 return true; 1303 } 1304 1305 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1306 public Builder mergeFrom( 1307 com.google.protobuf.CodedInputStream input, 1308 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1309 throws java.io.IOException { 1310 if (extensionRegistry == null) { 1311 throw new java.lang.NullPointerException(); 1312 } 1313 try { 1314 boolean done = false; 1315 while (!done) { 1316 int tag = input.readTag(); 1317 switch (tag) { 1318 case 0: 1319 done = true; 1320 break; 1321 case 8: 1322 { 1323 revision_ = input.readInt32(); 1324 bitField0_ |= 0x00000001; 1325 break; 1326 } // case 8 1327 case 18: 1328 { 1329 regionCode_ = input.readStringRequireUtf8(); 1330 bitField0_ |= 0x00000002; 1331 break; 1332 } // case 18 1333 case 26: 1334 { 1335 languageCode_ = input.readStringRequireUtf8(); 1336 bitField0_ |= 0x00000004; 1337 break; 1338 } // case 26 1339 case 34: 1340 { 1341 postalCode_ = input.readStringRequireUtf8(); 1342 bitField0_ |= 0x00000008; 1343 break; 1344 } // case 34 1345 case 42: 1346 { 1347 sortingCode_ = input.readStringRequireUtf8(); 1348 bitField0_ |= 0x00000010; 1349 break; 1350 } // case 42 1351 case 50: 1352 { 1353 administrativeArea_ = input.readStringRequireUtf8(); 1354 bitField0_ |= 0x00000020; 1355 break; 1356 } // case 50 1357 case 58: 1358 { 1359 locality_ = input.readStringRequireUtf8(); 1360 bitField0_ |= 0x00000040; 1361 break; 1362 } // case 58 1363 case 66: 1364 { 1365 sublocality_ = input.readStringRequireUtf8(); 1366 bitField0_ |= 0x00000080; 1367 break; 1368 } // case 66 1369 case 74: 1370 { 1371 java.lang.String s = input.readStringRequireUtf8(); 1372 ensureAddressLinesIsMutable(); 1373 addressLines_.add(s); 1374 break; 1375 } // case 74 1376 case 82: 1377 { 1378 java.lang.String s = input.readStringRequireUtf8(); 1379 ensureRecipientsIsMutable(); 1380 recipients_.add(s); 1381 break; 1382 } // case 82 1383 case 90: 1384 { 1385 organization_ = input.readStringRequireUtf8(); 1386 bitField0_ |= 0x00000400; 1387 break; 1388 } // case 90 1389 default: 1390 { 1391 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 1392 done = true; // was an endgroup tag 1393 } 1394 break; 1395 } // default: 1396 } // switch (tag) 1397 } // while (!done) 1398 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 1399 throw e.unwrapIOException(); 1400 } finally { 1401 onChanged(); 1402 } // finally 1403 return this; 1404 } 1405 1406 private int bitField0_; 1407 1408 private int revision_; 1409 /** 1410 * 1411 * 1412 * <pre> 1413 * The schema revision of the `PostalAddress`. This must be set to 0, which is 1414 * the latest revision. 1415 * All new revisions **must** be backward compatible with old revisions. 1416 * </pre> 1417 * 1418 * <code>int32 revision = 1;</code> 1419 * 1420 * @return The revision. 1421 */ 1422 @java.lang.Override getRevision()1423 public int getRevision() { 1424 return revision_; 1425 } 1426 /** 1427 * 1428 * 1429 * <pre> 1430 * The schema revision of the `PostalAddress`. This must be set to 0, which is 1431 * the latest revision. 1432 * All new revisions **must** be backward compatible with old revisions. 1433 * </pre> 1434 * 1435 * <code>int32 revision = 1;</code> 1436 * 1437 * @param value The revision to set. 1438 * @return This builder for chaining. 1439 */ setRevision(int value)1440 public Builder setRevision(int value) { 1441 1442 revision_ = value; 1443 bitField0_ |= 0x00000001; 1444 onChanged(); 1445 return this; 1446 } 1447 /** 1448 * 1449 * 1450 * <pre> 1451 * The schema revision of the `PostalAddress`. This must be set to 0, which is 1452 * the latest revision. 1453 * All new revisions **must** be backward compatible with old revisions. 1454 * </pre> 1455 * 1456 * <code>int32 revision = 1;</code> 1457 * 1458 * @return This builder for chaining. 1459 */ clearRevision()1460 public Builder clearRevision() { 1461 bitField0_ = (bitField0_ & ~0x00000001); 1462 revision_ = 0; 1463 onChanged(); 1464 return this; 1465 } 1466 1467 private java.lang.Object regionCode_ = ""; 1468 /** 1469 * 1470 * 1471 * <pre> 1472 * Required. CLDR region code of the country/region of the address. This 1473 * is never inferred and it is up to the user to ensure the value is 1474 * correct. See http://cldr.unicode.org/ and 1475 * http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html 1476 * for details. Example: "CH" for Switzerland. 1477 * </pre> 1478 * 1479 * <code>string region_code = 2;</code> 1480 * 1481 * @return The regionCode. 1482 */ getRegionCode()1483 public java.lang.String getRegionCode() { 1484 java.lang.Object ref = regionCode_; 1485 if (!(ref instanceof java.lang.String)) { 1486 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1487 java.lang.String s = bs.toStringUtf8(); 1488 regionCode_ = s; 1489 return s; 1490 } else { 1491 return (java.lang.String) ref; 1492 } 1493 } 1494 /** 1495 * 1496 * 1497 * <pre> 1498 * Required. CLDR region code of the country/region of the address. This 1499 * is never inferred and it is up to the user to ensure the value is 1500 * correct. See http://cldr.unicode.org/ and 1501 * http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html 1502 * for details. Example: "CH" for Switzerland. 1503 * </pre> 1504 * 1505 * <code>string region_code = 2;</code> 1506 * 1507 * @return The bytes for regionCode. 1508 */ getRegionCodeBytes()1509 public com.google.protobuf.ByteString getRegionCodeBytes() { 1510 java.lang.Object ref = regionCode_; 1511 if (ref instanceof String) { 1512 com.google.protobuf.ByteString b = 1513 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1514 regionCode_ = b; 1515 return b; 1516 } else { 1517 return (com.google.protobuf.ByteString) ref; 1518 } 1519 } 1520 /** 1521 * 1522 * 1523 * <pre> 1524 * Required. CLDR region code of the country/region of the address. This 1525 * is never inferred and it is up to the user to ensure the value is 1526 * correct. See http://cldr.unicode.org/ and 1527 * http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html 1528 * for details. Example: "CH" for Switzerland. 1529 * </pre> 1530 * 1531 * <code>string region_code = 2;</code> 1532 * 1533 * @param value The regionCode to set. 1534 * @return This builder for chaining. 1535 */ setRegionCode(java.lang.String value)1536 public Builder setRegionCode(java.lang.String value) { 1537 if (value == null) { 1538 throw new NullPointerException(); 1539 } 1540 regionCode_ = value; 1541 bitField0_ |= 0x00000002; 1542 onChanged(); 1543 return this; 1544 } 1545 /** 1546 * 1547 * 1548 * <pre> 1549 * Required. CLDR region code of the country/region of the address. This 1550 * is never inferred and it is up to the user to ensure the value is 1551 * correct. See http://cldr.unicode.org/ and 1552 * http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html 1553 * for details. Example: "CH" for Switzerland. 1554 * </pre> 1555 * 1556 * <code>string region_code = 2;</code> 1557 * 1558 * @return This builder for chaining. 1559 */ clearRegionCode()1560 public Builder clearRegionCode() { 1561 regionCode_ = getDefaultInstance().getRegionCode(); 1562 bitField0_ = (bitField0_ & ~0x00000002); 1563 onChanged(); 1564 return this; 1565 } 1566 /** 1567 * 1568 * 1569 * <pre> 1570 * Required. CLDR region code of the country/region of the address. This 1571 * is never inferred and it is up to the user to ensure the value is 1572 * correct. See http://cldr.unicode.org/ and 1573 * http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html 1574 * for details. Example: "CH" for Switzerland. 1575 * </pre> 1576 * 1577 * <code>string region_code = 2;</code> 1578 * 1579 * @param value The bytes for regionCode to set. 1580 * @return This builder for chaining. 1581 */ setRegionCodeBytes(com.google.protobuf.ByteString value)1582 public Builder setRegionCodeBytes(com.google.protobuf.ByteString value) { 1583 if (value == null) { 1584 throw new NullPointerException(); 1585 } 1586 checkByteStringIsUtf8(value); 1587 regionCode_ = value; 1588 bitField0_ |= 0x00000002; 1589 onChanged(); 1590 return this; 1591 } 1592 1593 private java.lang.Object languageCode_ = ""; 1594 /** 1595 * 1596 * 1597 * <pre> 1598 * Optional. BCP-47 language code of the contents of this address (if 1599 * known). This is often the UI language of the input form or is expected 1600 * to match one of the languages used in the address' country/region, or their 1601 * transliterated equivalents. 1602 * This can affect formatting in certain countries, but is not critical 1603 * to the correctness of the data and will never affect any validation or 1604 * other non-formatting related operations. 1605 * If this value is not known, it should be omitted (rather than specifying a 1606 * possibly incorrect default). 1607 * Examples: "zh-Hant", "ja", "ja-Latn", "en". 1608 * </pre> 1609 * 1610 * <code>string language_code = 3;</code> 1611 * 1612 * @return The languageCode. 1613 */ getLanguageCode()1614 public java.lang.String getLanguageCode() { 1615 java.lang.Object ref = languageCode_; 1616 if (!(ref instanceof java.lang.String)) { 1617 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1618 java.lang.String s = bs.toStringUtf8(); 1619 languageCode_ = s; 1620 return s; 1621 } else { 1622 return (java.lang.String) ref; 1623 } 1624 } 1625 /** 1626 * 1627 * 1628 * <pre> 1629 * Optional. BCP-47 language code of the contents of this address (if 1630 * known). This is often the UI language of the input form or is expected 1631 * to match one of the languages used in the address' country/region, or their 1632 * transliterated equivalents. 1633 * This can affect formatting in certain countries, but is not critical 1634 * to the correctness of the data and will never affect any validation or 1635 * other non-formatting related operations. 1636 * If this value is not known, it should be omitted (rather than specifying a 1637 * possibly incorrect default). 1638 * Examples: "zh-Hant", "ja", "ja-Latn", "en". 1639 * </pre> 1640 * 1641 * <code>string language_code = 3;</code> 1642 * 1643 * @return The bytes for languageCode. 1644 */ getLanguageCodeBytes()1645 public com.google.protobuf.ByteString getLanguageCodeBytes() { 1646 java.lang.Object ref = languageCode_; 1647 if (ref instanceof String) { 1648 com.google.protobuf.ByteString b = 1649 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1650 languageCode_ = b; 1651 return b; 1652 } else { 1653 return (com.google.protobuf.ByteString) ref; 1654 } 1655 } 1656 /** 1657 * 1658 * 1659 * <pre> 1660 * Optional. BCP-47 language code of the contents of this address (if 1661 * known). This is often the UI language of the input form or is expected 1662 * to match one of the languages used in the address' country/region, or their 1663 * transliterated equivalents. 1664 * This can affect formatting in certain countries, but is not critical 1665 * to the correctness of the data and will never affect any validation or 1666 * other non-formatting related operations. 1667 * If this value is not known, it should be omitted (rather than specifying a 1668 * possibly incorrect default). 1669 * Examples: "zh-Hant", "ja", "ja-Latn", "en". 1670 * </pre> 1671 * 1672 * <code>string language_code = 3;</code> 1673 * 1674 * @param value The languageCode to set. 1675 * @return This builder for chaining. 1676 */ setLanguageCode(java.lang.String value)1677 public Builder setLanguageCode(java.lang.String value) { 1678 if (value == null) { 1679 throw new NullPointerException(); 1680 } 1681 languageCode_ = value; 1682 bitField0_ |= 0x00000004; 1683 onChanged(); 1684 return this; 1685 } 1686 /** 1687 * 1688 * 1689 * <pre> 1690 * Optional. BCP-47 language code of the contents of this address (if 1691 * known). This is often the UI language of the input form or is expected 1692 * to match one of the languages used in the address' country/region, or their 1693 * transliterated equivalents. 1694 * This can affect formatting in certain countries, but is not critical 1695 * to the correctness of the data and will never affect any validation or 1696 * other non-formatting related operations. 1697 * If this value is not known, it should be omitted (rather than specifying a 1698 * possibly incorrect default). 1699 * Examples: "zh-Hant", "ja", "ja-Latn", "en". 1700 * </pre> 1701 * 1702 * <code>string language_code = 3;</code> 1703 * 1704 * @return This builder for chaining. 1705 */ clearLanguageCode()1706 public Builder clearLanguageCode() { 1707 languageCode_ = getDefaultInstance().getLanguageCode(); 1708 bitField0_ = (bitField0_ & ~0x00000004); 1709 onChanged(); 1710 return this; 1711 } 1712 /** 1713 * 1714 * 1715 * <pre> 1716 * Optional. BCP-47 language code of the contents of this address (if 1717 * known). This is often the UI language of the input form or is expected 1718 * to match one of the languages used in the address' country/region, or their 1719 * transliterated equivalents. 1720 * This can affect formatting in certain countries, but is not critical 1721 * to the correctness of the data and will never affect any validation or 1722 * other non-formatting related operations. 1723 * If this value is not known, it should be omitted (rather than specifying a 1724 * possibly incorrect default). 1725 * Examples: "zh-Hant", "ja", "ja-Latn", "en". 1726 * </pre> 1727 * 1728 * <code>string language_code = 3;</code> 1729 * 1730 * @param value The bytes for languageCode to set. 1731 * @return This builder for chaining. 1732 */ setLanguageCodeBytes(com.google.protobuf.ByteString value)1733 public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) { 1734 if (value == null) { 1735 throw new NullPointerException(); 1736 } 1737 checkByteStringIsUtf8(value); 1738 languageCode_ = value; 1739 bitField0_ |= 0x00000004; 1740 onChanged(); 1741 return this; 1742 } 1743 1744 private java.lang.Object postalCode_ = ""; 1745 /** 1746 * 1747 * 1748 * <pre> 1749 * Optional. Postal code of the address. Not all countries use or require 1750 * postal codes to be present, but where they are used, they may trigger 1751 * additional validation with other parts of the address (e.g. state/zip 1752 * validation in the U.S.A.). 1753 * </pre> 1754 * 1755 * <code>string postal_code = 4;</code> 1756 * 1757 * @return The postalCode. 1758 */ getPostalCode()1759 public java.lang.String getPostalCode() { 1760 java.lang.Object ref = postalCode_; 1761 if (!(ref instanceof java.lang.String)) { 1762 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1763 java.lang.String s = bs.toStringUtf8(); 1764 postalCode_ = s; 1765 return s; 1766 } else { 1767 return (java.lang.String) ref; 1768 } 1769 } 1770 /** 1771 * 1772 * 1773 * <pre> 1774 * Optional. Postal code of the address. Not all countries use or require 1775 * postal codes to be present, but where they are used, they may trigger 1776 * additional validation with other parts of the address (e.g. state/zip 1777 * validation in the U.S.A.). 1778 * </pre> 1779 * 1780 * <code>string postal_code = 4;</code> 1781 * 1782 * @return The bytes for postalCode. 1783 */ getPostalCodeBytes()1784 public com.google.protobuf.ByteString getPostalCodeBytes() { 1785 java.lang.Object ref = postalCode_; 1786 if (ref instanceof String) { 1787 com.google.protobuf.ByteString b = 1788 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1789 postalCode_ = b; 1790 return b; 1791 } else { 1792 return (com.google.protobuf.ByteString) ref; 1793 } 1794 } 1795 /** 1796 * 1797 * 1798 * <pre> 1799 * Optional. Postal code of the address. Not all countries use or require 1800 * postal codes to be present, but where they are used, they may trigger 1801 * additional validation with other parts of the address (e.g. state/zip 1802 * validation in the U.S.A.). 1803 * </pre> 1804 * 1805 * <code>string postal_code = 4;</code> 1806 * 1807 * @param value The postalCode to set. 1808 * @return This builder for chaining. 1809 */ setPostalCode(java.lang.String value)1810 public Builder setPostalCode(java.lang.String value) { 1811 if (value == null) { 1812 throw new NullPointerException(); 1813 } 1814 postalCode_ = value; 1815 bitField0_ |= 0x00000008; 1816 onChanged(); 1817 return this; 1818 } 1819 /** 1820 * 1821 * 1822 * <pre> 1823 * Optional. Postal code of the address. Not all countries use or require 1824 * postal codes to be present, but where they are used, they may trigger 1825 * additional validation with other parts of the address (e.g. state/zip 1826 * validation in the U.S.A.). 1827 * </pre> 1828 * 1829 * <code>string postal_code = 4;</code> 1830 * 1831 * @return This builder for chaining. 1832 */ clearPostalCode()1833 public Builder clearPostalCode() { 1834 postalCode_ = getDefaultInstance().getPostalCode(); 1835 bitField0_ = (bitField0_ & ~0x00000008); 1836 onChanged(); 1837 return this; 1838 } 1839 /** 1840 * 1841 * 1842 * <pre> 1843 * Optional. Postal code of the address. Not all countries use or require 1844 * postal codes to be present, but where they are used, they may trigger 1845 * additional validation with other parts of the address (e.g. state/zip 1846 * validation in the U.S.A.). 1847 * </pre> 1848 * 1849 * <code>string postal_code = 4;</code> 1850 * 1851 * @param value The bytes for postalCode to set. 1852 * @return This builder for chaining. 1853 */ setPostalCodeBytes(com.google.protobuf.ByteString value)1854 public Builder setPostalCodeBytes(com.google.protobuf.ByteString value) { 1855 if (value == null) { 1856 throw new NullPointerException(); 1857 } 1858 checkByteStringIsUtf8(value); 1859 postalCode_ = value; 1860 bitField0_ |= 0x00000008; 1861 onChanged(); 1862 return this; 1863 } 1864 1865 private java.lang.Object sortingCode_ = ""; 1866 /** 1867 * 1868 * 1869 * <pre> 1870 * Optional. Additional, country-specific, sorting code. This is not used 1871 * in most regions. Where it is used, the value is either a string like 1872 * "CEDEX", optionally followed by a number (e.g. "CEDEX 7"), or just a number 1873 * alone, representing the "sector code" (Jamaica), "delivery area indicator" 1874 * (Malawi) or "post office indicator" (e.g. Côte d'Ivoire). 1875 * </pre> 1876 * 1877 * <code>string sorting_code = 5;</code> 1878 * 1879 * @return The sortingCode. 1880 */ getSortingCode()1881 public java.lang.String getSortingCode() { 1882 java.lang.Object ref = sortingCode_; 1883 if (!(ref instanceof java.lang.String)) { 1884 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1885 java.lang.String s = bs.toStringUtf8(); 1886 sortingCode_ = s; 1887 return s; 1888 } else { 1889 return (java.lang.String) ref; 1890 } 1891 } 1892 /** 1893 * 1894 * 1895 * <pre> 1896 * Optional. Additional, country-specific, sorting code. This is not used 1897 * in most regions. Where it is used, the value is either a string like 1898 * "CEDEX", optionally followed by a number (e.g. "CEDEX 7"), or just a number 1899 * alone, representing the "sector code" (Jamaica), "delivery area indicator" 1900 * (Malawi) or "post office indicator" (e.g. Côte d'Ivoire). 1901 * </pre> 1902 * 1903 * <code>string sorting_code = 5;</code> 1904 * 1905 * @return The bytes for sortingCode. 1906 */ getSortingCodeBytes()1907 public com.google.protobuf.ByteString getSortingCodeBytes() { 1908 java.lang.Object ref = sortingCode_; 1909 if (ref instanceof String) { 1910 com.google.protobuf.ByteString b = 1911 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1912 sortingCode_ = b; 1913 return b; 1914 } else { 1915 return (com.google.protobuf.ByteString) ref; 1916 } 1917 } 1918 /** 1919 * 1920 * 1921 * <pre> 1922 * Optional. Additional, country-specific, sorting code. This is not used 1923 * in most regions. Where it is used, the value is either a string like 1924 * "CEDEX", optionally followed by a number (e.g. "CEDEX 7"), or just a number 1925 * alone, representing the "sector code" (Jamaica), "delivery area indicator" 1926 * (Malawi) or "post office indicator" (e.g. Côte d'Ivoire). 1927 * </pre> 1928 * 1929 * <code>string sorting_code = 5;</code> 1930 * 1931 * @param value The sortingCode to set. 1932 * @return This builder for chaining. 1933 */ setSortingCode(java.lang.String value)1934 public Builder setSortingCode(java.lang.String value) { 1935 if (value == null) { 1936 throw new NullPointerException(); 1937 } 1938 sortingCode_ = value; 1939 bitField0_ |= 0x00000010; 1940 onChanged(); 1941 return this; 1942 } 1943 /** 1944 * 1945 * 1946 * <pre> 1947 * Optional. Additional, country-specific, sorting code. This is not used 1948 * in most regions. Where it is used, the value is either a string like 1949 * "CEDEX", optionally followed by a number (e.g. "CEDEX 7"), or just a number 1950 * alone, representing the "sector code" (Jamaica), "delivery area indicator" 1951 * (Malawi) or "post office indicator" (e.g. Côte d'Ivoire). 1952 * </pre> 1953 * 1954 * <code>string sorting_code = 5;</code> 1955 * 1956 * @return This builder for chaining. 1957 */ clearSortingCode()1958 public Builder clearSortingCode() { 1959 sortingCode_ = getDefaultInstance().getSortingCode(); 1960 bitField0_ = (bitField0_ & ~0x00000010); 1961 onChanged(); 1962 return this; 1963 } 1964 /** 1965 * 1966 * 1967 * <pre> 1968 * Optional. Additional, country-specific, sorting code. This is not used 1969 * in most regions. Where it is used, the value is either a string like 1970 * "CEDEX", optionally followed by a number (e.g. "CEDEX 7"), or just a number 1971 * alone, representing the "sector code" (Jamaica), "delivery area indicator" 1972 * (Malawi) or "post office indicator" (e.g. Côte d'Ivoire). 1973 * </pre> 1974 * 1975 * <code>string sorting_code = 5;</code> 1976 * 1977 * @param value The bytes for sortingCode to set. 1978 * @return This builder for chaining. 1979 */ setSortingCodeBytes(com.google.protobuf.ByteString value)1980 public Builder setSortingCodeBytes(com.google.protobuf.ByteString value) { 1981 if (value == null) { 1982 throw new NullPointerException(); 1983 } 1984 checkByteStringIsUtf8(value); 1985 sortingCode_ = value; 1986 bitField0_ |= 0x00000010; 1987 onChanged(); 1988 return this; 1989 } 1990 1991 private java.lang.Object administrativeArea_ = ""; 1992 /** 1993 * 1994 * 1995 * <pre> 1996 * Optional. Highest administrative subdivision which is used for postal 1997 * addresses of a country or region. 1998 * For example, this can be a state, a province, an oblast, or a prefecture. 1999 * Specifically, for Spain this is the province and not the autonomous 2000 * community (e.g. "Barcelona" and not "Catalonia"). 2001 * Many countries don't use an administrative area in postal addresses. E.g. 2002 * in Switzerland this should be left unpopulated. 2003 * </pre> 2004 * 2005 * <code>string administrative_area = 6;</code> 2006 * 2007 * @return The administrativeArea. 2008 */ getAdministrativeArea()2009 public java.lang.String getAdministrativeArea() { 2010 java.lang.Object ref = administrativeArea_; 2011 if (!(ref instanceof java.lang.String)) { 2012 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 2013 java.lang.String s = bs.toStringUtf8(); 2014 administrativeArea_ = s; 2015 return s; 2016 } else { 2017 return (java.lang.String) ref; 2018 } 2019 } 2020 /** 2021 * 2022 * 2023 * <pre> 2024 * Optional. Highest administrative subdivision which is used for postal 2025 * addresses of a country or region. 2026 * For example, this can be a state, a province, an oblast, or a prefecture. 2027 * Specifically, for Spain this is the province and not the autonomous 2028 * community (e.g. "Barcelona" and not "Catalonia"). 2029 * Many countries don't use an administrative area in postal addresses. E.g. 2030 * in Switzerland this should be left unpopulated. 2031 * </pre> 2032 * 2033 * <code>string administrative_area = 6;</code> 2034 * 2035 * @return The bytes for administrativeArea. 2036 */ getAdministrativeAreaBytes()2037 public com.google.protobuf.ByteString getAdministrativeAreaBytes() { 2038 java.lang.Object ref = administrativeArea_; 2039 if (ref instanceof String) { 2040 com.google.protobuf.ByteString b = 2041 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 2042 administrativeArea_ = b; 2043 return b; 2044 } else { 2045 return (com.google.protobuf.ByteString) ref; 2046 } 2047 } 2048 /** 2049 * 2050 * 2051 * <pre> 2052 * Optional. Highest administrative subdivision which is used for postal 2053 * addresses of a country or region. 2054 * For example, this can be a state, a province, an oblast, or a prefecture. 2055 * Specifically, for Spain this is the province and not the autonomous 2056 * community (e.g. "Barcelona" and not "Catalonia"). 2057 * Many countries don't use an administrative area in postal addresses. E.g. 2058 * in Switzerland this should be left unpopulated. 2059 * </pre> 2060 * 2061 * <code>string administrative_area = 6;</code> 2062 * 2063 * @param value The administrativeArea to set. 2064 * @return This builder for chaining. 2065 */ setAdministrativeArea(java.lang.String value)2066 public Builder setAdministrativeArea(java.lang.String value) { 2067 if (value == null) { 2068 throw new NullPointerException(); 2069 } 2070 administrativeArea_ = value; 2071 bitField0_ |= 0x00000020; 2072 onChanged(); 2073 return this; 2074 } 2075 /** 2076 * 2077 * 2078 * <pre> 2079 * Optional. Highest administrative subdivision which is used for postal 2080 * addresses of a country or region. 2081 * For example, this can be a state, a province, an oblast, or a prefecture. 2082 * Specifically, for Spain this is the province and not the autonomous 2083 * community (e.g. "Barcelona" and not "Catalonia"). 2084 * Many countries don't use an administrative area in postal addresses. E.g. 2085 * in Switzerland this should be left unpopulated. 2086 * </pre> 2087 * 2088 * <code>string administrative_area = 6;</code> 2089 * 2090 * @return This builder for chaining. 2091 */ clearAdministrativeArea()2092 public Builder clearAdministrativeArea() { 2093 administrativeArea_ = getDefaultInstance().getAdministrativeArea(); 2094 bitField0_ = (bitField0_ & ~0x00000020); 2095 onChanged(); 2096 return this; 2097 } 2098 /** 2099 * 2100 * 2101 * <pre> 2102 * Optional. Highest administrative subdivision which is used for postal 2103 * addresses of a country or region. 2104 * For example, this can be a state, a province, an oblast, or a prefecture. 2105 * Specifically, for Spain this is the province and not the autonomous 2106 * community (e.g. "Barcelona" and not "Catalonia"). 2107 * Many countries don't use an administrative area in postal addresses. E.g. 2108 * in Switzerland this should be left unpopulated. 2109 * </pre> 2110 * 2111 * <code>string administrative_area = 6;</code> 2112 * 2113 * @param value The bytes for administrativeArea to set. 2114 * @return This builder for chaining. 2115 */ setAdministrativeAreaBytes(com.google.protobuf.ByteString value)2116 public Builder setAdministrativeAreaBytes(com.google.protobuf.ByteString value) { 2117 if (value == null) { 2118 throw new NullPointerException(); 2119 } 2120 checkByteStringIsUtf8(value); 2121 administrativeArea_ = value; 2122 bitField0_ |= 0x00000020; 2123 onChanged(); 2124 return this; 2125 } 2126 2127 private java.lang.Object locality_ = ""; 2128 /** 2129 * 2130 * 2131 * <pre> 2132 * Optional. Generally refers to the city/town portion of the address. 2133 * Examples: US city, IT comune, UK post town. 2134 * In regions of the world where localities are not well defined or do not fit 2135 * into this structure well, leave locality empty and use address_lines. 2136 * </pre> 2137 * 2138 * <code>string locality = 7;</code> 2139 * 2140 * @return The locality. 2141 */ getLocality()2142 public java.lang.String getLocality() { 2143 java.lang.Object ref = locality_; 2144 if (!(ref instanceof java.lang.String)) { 2145 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 2146 java.lang.String s = bs.toStringUtf8(); 2147 locality_ = s; 2148 return s; 2149 } else { 2150 return (java.lang.String) ref; 2151 } 2152 } 2153 /** 2154 * 2155 * 2156 * <pre> 2157 * Optional. Generally refers to the city/town portion of the address. 2158 * Examples: US city, IT comune, UK post town. 2159 * In regions of the world where localities are not well defined or do not fit 2160 * into this structure well, leave locality empty and use address_lines. 2161 * </pre> 2162 * 2163 * <code>string locality = 7;</code> 2164 * 2165 * @return The bytes for locality. 2166 */ getLocalityBytes()2167 public com.google.protobuf.ByteString getLocalityBytes() { 2168 java.lang.Object ref = locality_; 2169 if (ref instanceof String) { 2170 com.google.protobuf.ByteString b = 2171 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 2172 locality_ = b; 2173 return b; 2174 } else { 2175 return (com.google.protobuf.ByteString) ref; 2176 } 2177 } 2178 /** 2179 * 2180 * 2181 * <pre> 2182 * Optional. Generally refers to the city/town portion of the address. 2183 * Examples: US city, IT comune, UK post town. 2184 * In regions of the world where localities are not well defined or do not fit 2185 * into this structure well, leave locality empty and use address_lines. 2186 * </pre> 2187 * 2188 * <code>string locality = 7;</code> 2189 * 2190 * @param value The locality to set. 2191 * @return This builder for chaining. 2192 */ setLocality(java.lang.String value)2193 public Builder setLocality(java.lang.String value) { 2194 if (value == null) { 2195 throw new NullPointerException(); 2196 } 2197 locality_ = value; 2198 bitField0_ |= 0x00000040; 2199 onChanged(); 2200 return this; 2201 } 2202 /** 2203 * 2204 * 2205 * <pre> 2206 * Optional. Generally refers to the city/town portion of the address. 2207 * Examples: US city, IT comune, UK post town. 2208 * In regions of the world where localities are not well defined or do not fit 2209 * into this structure well, leave locality empty and use address_lines. 2210 * </pre> 2211 * 2212 * <code>string locality = 7;</code> 2213 * 2214 * @return This builder for chaining. 2215 */ clearLocality()2216 public Builder clearLocality() { 2217 locality_ = getDefaultInstance().getLocality(); 2218 bitField0_ = (bitField0_ & ~0x00000040); 2219 onChanged(); 2220 return this; 2221 } 2222 /** 2223 * 2224 * 2225 * <pre> 2226 * Optional. Generally refers to the city/town portion of the address. 2227 * Examples: US city, IT comune, UK post town. 2228 * In regions of the world where localities are not well defined or do not fit 2229 * into this structure well, leave locality empty and use address_lines. 2230 * </pre> 2231 * 2232 * <code>string locality = 7;</code> 2233 * 2234 * @param value The bytes for locality to set. 2235 * @return This builder for chaining. 2236 */ setLocalityBytes(com.google.protobuf.ByteString value)2237 public Builder setLocalityBytes(com.google.protobuf.ByteString value) { 2238 if (value == null) { 2239 throw new NullPointerException(); 2240 } 2241 checkByteStringIsUtf8(value); 2242 locality_ = value; 2243 bitField0_ |= 0x00000040; 2244 onChanged(); 2245 return this; 2246 } 2247 2248 private java.lang.Object sublocality_ = ""; 2249 /** 2250 * 2251 * 2252 * <pre> 2253 * Optional. Sublocality of the address. 2254 * For example, this can be neighborhoods, boroughs, districts. 2255 * </pre> 2256 * 2257 * <code>string sublocality = 8;</code> 2258 * 2259 * @return The sublocality. 2260 */ getSublocality()2261 public java.lang.String getSublocality() { 2262 java.lang.Object ref = sublocality_; 2263 if (!(ref instanceof java.lang.String)) { 2264 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 2265 java.lang.String s = bs.toStringUtf8(); 2266 sublocality_ = s; 2267 return s; 2268 } else { 2269 return (java.lang.String) ref; 2270 } 2271 } 2272 /** 2273 * 2274 * 2275 * <pre> 2276 * Optional. Sublocality of the address. 2277 * For example, this can be neighborhoods, boroughs, districts. 2278 * </pre> 2279 * 2280 * <code>string sublocality = 8;</code> 2281 * 2282 * @return The bytes for sublocality. 2283 */ getSublocalityBytes()2284 public com.google.protobuf.ByteString getSublocalityBytes() { 2285 java.lang.Object ref = sublocality_; 2286 if (ref instanceof String) { 2287 com.google.protobuf.ByteString b = 2288 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 2289 sublocality_ = b; 2290 return b; 2291 } else { 2292 return (com.google.protobuf.ByteString) ref; 2293 } 2294 } 2295 /** 2296 * 2297 * 2298 * <pre> 2299 * Optional. Sublocality of the address. 2300 * For example, this can be neighborhoods, boroughs, districts. 2301 * </pre> 2302 * 2303 * <code>string sublocality = 8;</code> 2304 * 2305 * @param value The sublocality to set. 2306 * @return This builder for chaining. 2307 */ setSublocality(java.lang.String value)2308 public Builder setSublocality(java.lang.String value) { 2309 if (value == null) { 2310 throw new NullPointerException(); 2311 } 2312 sublocality_ = value; 2313 bitField0_ |= 0x00000080; 2314 onChanged(); 2315 return this; 2316 } 2317 /** 2318 * 2319 * 2320 * <pre> 2321 * Optional. Sublocality of the address. 2322 * For example, this can be neighborhoods, boroughs, districts. 2323 * </pre> 2324 * 2325 * <code>string sublocality = 8;</code> 2326 * 2327 * @return This builder for chaining. 2328 */ clearSublocality()2329 public Builder clearSublocality() { 2330 sublocality_ = getDefaultInstance().getSublocality(); 2331 bitField0_ = (bitField0_ & ~0x00000080); 2332 onChanged(); 2333 return this; 2334 } 2335 /** 2336 * 2337 * 2338 * <pre> 2339 * Optional. Sublocality of the address. 2340 * For example, this can be neighborhoods, boroughs, districts. 2341 * </pre> 2342 * 2343 * <code>string sublocality = 8;</code> 2344 * 2345 * @param value The bytes for sublocality to set. 2346 * @return This builder for chaining. 2347 */ setSublocalityBytes(com.google.protobuf.ByteString value)2348 public Builder setSublocalityBytes(com.google.protobuf.ByteString value) { 2349 if (value == null) { 2350 throw new NullPointerException(); 2351 } 2352 checkByteStringIsUtf8(value); 2353 sublocality_ = value; 2354 bitField0_ |= 0x00000080; 2355 onChanged(); 2356 return this; 2357 } 2358 2359 private com.google.protobuf.LazyStringList addressLines_ = 2360 com.google.protobuf.LazyStringArrayList.EMPTY; 2361 ensureAddressLinesIsMutable()2362 private void ensureAddressLinesIsMutable() { 2363 if (!((bitField0_ & 0x00000100) != 0)) { 2364 addressLines_ = new com.google.protobuf.LazyStringArrayList(addressLines_); 2365 bitField0_ |= 0x00000100; 2366 } 2367 } 2368 /** 2369 * 2370 * 2371 * <pre> 2372 * Unstructured address lines describing the lower levels of an address. 2373 * Because values in address_lines do not have type information and may 2374 * sometimes contain multiple values in a single field (e.g. 2375 * "Austin, TX"), it is important that the line order is clear. The order of 2376 * address lines should be "envelope order" for the country/region of the 2377 * address. In places where this can vary (e.g. Japan), address_language is 2378 * used to make it explicit (e.g. "ja" for large-to-small ordering and 2379 * "ja-Latn" or "en" for small-to-large). This way, the most specific line of 2380 * an address can be selected based on the language. 2381 * The minimum permitted structural representation of an address consists 2382 * of a region_code with all remaining information placed in the 2383 * address_lines. It would be possible to format such an address very 2384 * approximately without geocoding, but no semantic reasoning could be 2385 * made about any of the address components until it was at least 2386 * partially resolved. 2387 * Creating an address only containing a region_code and address_lines, and 2388 * then geocoding is the recommended way to handle completely unstructured 2389 * addresses (as opposed to guessing which parts of the address should be 2390 * localities or administrative areas). 2391 * </pre> 2392 * 2393 * <code>repeated string address_lines = 9;</code> 2394 * 2395 * @return A list containing the addressLines. 2396 */ getAddressLinesList()2397 public com.google.protobuf.ProtocolStringList getAddressLinesList() { 2398 return addressLines_.getUnmodifiableView(); 2399 } 2400 /** 2401 * 2402 * 2403 * <pre> 2404 * Unstructured address lines describing the lower levels of an address. 2405 * Because values in address_lines do not have type information and may 2406 * sometimes contain multiple values in a single field (e.g. 2407 * "Austin, TX"), it is important that the line order is clear. The order of 2408 * address lines should be "envelope order" for the country/region of the 2409 * address. In places where this can vary (e.g. Japan), address_language is 2410 * used to make it explicit (e.g. "ja" for large-to-small ordering and 2411 * "ja-Latn" or "en" for small-to-large). This way, the most specific line of 2412 * an address can be selected based on the language. 2413 * The minimum permitted structural representation of an address consists 2414 * of a region_code with all remaining information placed in the 2415 * address_lines. It would be possible to format such an address very 2416 * approximately without geocoding, but no semantic reasoning could be 2417 * made about any of the address components until it was at least 2418 * partially resolved. 2419 * Creating an address only containing a region_code and address_lines, and 2420 * then geocoding is the recommended way to handle completely unstructured 2421 * addresses (as opposed to guessing which parts of the address should be 2422 * localities or administrative areas). 2423 * </pre> 2424 * 2425 * <code>repeated string address_lines = 9;</code> 2426 * 2427 * @return The count of addressLines. 2428 */ getAddressLinesCount()2429 public int getAddressLinesCount() { 2430 return addressLines_.size(); 2431 } 2432 /** 2433 * 2434 * 2435 * <pre> 2436 * Unstructured address lines describing the lower levels of an address. 2437 * Because values in address_lines do not have type information and may 2438 * sometimes contain multiple values in a single field (e.g. 2439 * "Austin, TX"), it is important that the line order is clear. The order of 2440 * address lines should be "envelope order" for the country/region of the 2441 * address. In places where this can vary (e.g. Japan), address_language is 2442 * used to make it explicit (e.g. "ja" for large-to-small ordering and 2443 * "ja-Latn" or "en" for small-to-large). This way, the most specific line of 2444 * an address can be selected based on the language. 2445 * The minimum permitted structural representation of an address consists 2446 * of a region_code with all remaining information placed in the 2447 * address_lines. It would be possible to format such an address very 2448 * approximately without geocoding, but no semantic reasoning could be 2449 * made about any of the address components until it was at least 2450 * partially resolved. 2451 * Creating an address only containing a region_code and address_lines, and 2452 * then geocoding is the recommended way to handle completely unstructured 2453 * addresses (as opposed to guessing which parts of the address should be 2454 * localities or administrative areas). 2455 * </pre> 2456 * 2457 * <code>repeated string address_lines = 9;</code> 2458 * 2459 * @param index The index of the element to return. 2460 * @return The addressLines at the given index. 2461 */ getAddressLines(int index)2462 public java.lang.String getAddressLines(int index) { 2463 return addressLines_.get(index); 2464 } 2465 /** 2466 * 2467 * 2468 * <pre> 2469 * Unstructured address lines describing the lower levels of an address. 2470 * Because values in address_lines do not have type information and may 2471 * sometimes contain multiple values in a single field (e.g. 2472 * "Austin, TX"), it is important that the line order is clear. The order of 2473 * address lines should be "envelope order" for the country/region of the 2474 * address. In places where this can vary (e.g. Japan), address_language is 2475 * used to make it explicit (e.g. "ja" for large-to-small ordering and 2476 * "ja-Latn" or "en" for small-to-large). This way, the most specific line of 2477 * an address can be selected based on the language. 2478 * The minimum permitted structural representation of an address consists 2479 * of a region_code with all remaining information placed in the 2480 * address_lines. It would be possible to format such an address very 2481 * approximately without geocoding, but no semantic reasoning could be 2482 * made about any of the address components until it was at least 2483 * partially resolved. 2484 * Creating an address only containing a region_code and address_lines, and 2485 * then geocoding is the recommended way to handle completely unstructured 2486 * addresses (as opposed to guessing which parts of the address should be 2487 * localities or administrative areas). 2488 * </pre> 2489 * 2490 * <code>repeated string address_lines = 9;</code> 2491 * 2492 * @param index The index of the value to return. 2493 * @return The bytes of the addressLines at the given index. 2494 */ getAddressLinesBytes(int index)2495 public com.google.protobuf.ByteString getAddressLinesBytes(int index) { 2496 return addressLines_.getByteString(index); 2497 } 2498 /** 2499 * 2500 * 2501 * <pre> 2502 * Unstructured address lines describing the lower levels of an address. 2503 * Because values in address_lines do not have type information and may 2504 * sometimes contain multiple values in a single field (e.g. 2505 * "Austin, TX"), it is important that the line order is clear. The order of 2506 * address lines should be "envelope order" for the country/region of the 2507 * address. In places where this can vary (e.g. Japan), address_language is 2508 * used to make it explicit (e.g. "ja" for large-to-small ordering and 2509 * "ja-Latn" or "en" for small-to-large). This way, the most specific line of 2510 * an address can be selected based on the language. 2511 * The minimum permitted structural representation of an address consists 2512 * of a region_code with all remaining information placed in the 2513 * address_lines. It would be possible to format such an address very 2514 * approximately without geocoding, but no semantic reasoning could be 2515 * made about any of the address components until it was at least 2516 * partially resolved. 2517 * Creating an address only containing a region_code and address_lines, and 2518 * then geocoding is the recommended way to handle completely unstructured 2519 * addresses (as opposed to guessing which parts of the address should be 2520 * localities or administrative areas). 2521 * </pre> 2522 * 2523 * <code>repeated string address_lines = 9;</code> 2524 * 2525 * @param index The index to set the value at. 2526 * @param value The addressLines to set. 2527 * @return This builder for chaining. 2528 */ setAddressLines(int index, java.lang.String value)2529 public Builder setAddressLines(int index, java.lang.String value) { 2530 if (value == null) { 2531 throw new NullPointerException(); 2532 } 2533 ensureAddressLinesIsMutable(); 2534 addressLines_.set(index, value); 2535 onChanged(); 2536 return this; 2537 } 2538 /** 2539 * 2540 * 2541 * <pre> 2542 * Unstructured address lines describing the lower levels of an address. 2543 * Because values in address_lines do not have type information and may 2544 * sometimes contain multiple values in a single field (e.g. 2545 * "Austin, TX"), it is important that the line order is clear. The order of 2546 * address lines should be "envelope order" for the country/region of the 2547 * address. In places where this can vary (e.g. Japan), address_language is 2548 * used to make it explicit (e.g. "ja" for large-to-small ordering and 2549 * "ja-Latn" or "en" for small-to-large). This way, the most specific line of 2550 * an address can be selected based on the language. 2551 * The minimum permitted structural representation of an address consists 2552 * of a region_code with all remaining information placed in the 2553 * address_lines. It would be possible to format such an address very 2554 * approximately without geocoding, but no semantic reasoning could be 2555 * made about any of the address components until it was at least 2556 * partially resolved. 2557 * Creating an address only containing a region_code and address_lines, and 2558 * then geocoding is the recommended way to handle completely unstructured 2559 * addresses (as opposed to guessing which parts of the address should be 2560 * localities or administrative areas). 2561 * </pre> 2562 * 2563 * <code>repeated string address_lines = 9;</code> 2564 * 2565 * @param value The addressLines to add. 2566 * @return This builder for chaining. 2567 */ addAddressLines(java.lang.String value)2568 public Builder addAddressLines(java.lang.String value) { 2569 if (value == null) { 2570 throw new NullPointerException(); 2571 } 2572 ensureAddressLinesIsMutable(); 2573 addressLines_.add(value); 2574 onChanged(); 2575 return this; 2576 } 2577 /** 2578 * 2579 * 2580 * <pre> 2581 * Unstructured address lines describing the lower levels of an address. 2582 * Because values in address_lines do not have type information and may 2583 * sometimes contain multiple values in a single field (e.g. 2584 * "Austin, TX"), it is important that the line order is clear. The order of 2585 * address lines should be "envelope order" for the country/region of the 2586 * address. In places where this can vary (e.g. Japan), address_language is 2587 * used to make it explicit (e.g. "ja" for large-to-small ordering and 2588 * "ja-Latn" or "en" for small-to-large). This way, the most specific line of 2589 * an address can be selected based on the language. 2590 * The minimum permitted structural representation of an address consists 2591 * of a region_code with all remaining information placed in the 2592 * address_lines. It would be possible to format such an address very 2593 * approximately without geocoding, but no semantic reasoning could be 2594 * made about any of the address components until it was at least 2595 * partially resolved. 2596 * Creating an address only containing a region_code and address_lines, and 2597 * then geocoding is the recommended way to handle completely unstructured 2598 * addresses (as opposed to guessing which parts of the address should be 2599 * localities or administrative areas). 2600 * </pre> 2601 * 2602 * <code>repeated string address_lines = 9;</code> 2603 * 2604 * @param values The addressLines to add. 2605 * @return This builder for chaining. 2606 */ addAllAddressLines(java.lang.Iterable<java.lang.String> values)2607 public Builder addAllAddressLines(java.lang.Iterable<java.lang.String> values) { 2608 ensureAddressLinesIsMutable(); 2609 com.google.protobuf.AbstractMessageLite.Builder.addAll(values, addressLines_); 2610 onChanged(); 2611 return this; 2612 } 2613 /** 2614 * 2615 * 2616 * <pre> 2617 * Unstructured address lines describing the lower levels of an address. 2618 * Because values in address_lines do not have type information and may 2619 * sometimes contain multiple values in a single field (e.g. 2620 * "Austin, TX"), it is important that the line order is clear. The order of 2621 * address lines should be "envelope order" for the country/region of the 2622 * address. In places where this can vary (e.g. Japan), address_language is 2623 * used to make it explicit (e.g. "ja" for large-to-small ordering and 2624 * "ja-Latn" or "en" for small-to-large). This way, the most specific line of 2625 * an address can be selected based on the language. 2626 * The minimum permitted structural representation of an address consists 2627 * of a region_code with all remaining information placed in the 2628 * address_lines. It would be possible to format such an address very 2629 * approximately without geocoding, but no semantic reasoning could be 2630 * made about any of the address components until it was at least 2631 * partially resolved. 2632 * Creating an address only containing a region_code and address_lines, and 2633 * then geocoding is the recommended way to handle completely unstructured 2634 * addresses (as opposed to guessing which parts of the address should be 2635 * localities or administrative areas). 2636 * </pre> 2637 * 2638 * <code>repeated string address_lines = 9;</code> 2639 * 2640 * @return This builder for chaining. 2641 */ clearAddressLines()2642 public Builder clearAddressLines() { 2643 addressLines_ = com.google.protobuf.LazyStringArrayList.EMPTY; 2644 bitField0_ = (bitField0_ & ~0x00000100); 2645 onChanged(); 2646 return this; 2647 } 2648 /** 2649 * 2650 * 2651 * <pre> 2652 * Unstructured address lines describing the lower levels of an address. 2653 * Because values in address_lines do not have type information and may 2654 * sometimes contain multiple values in a single field (e.g. 2655 * "Austin, TX"), it is important that the line order is clear. The order of 2656 * address lines should be "envelope order" for the country/region of the 2657 * address. In places where this can vary (e.g. Japan), address_language is 2658 * used to make it explicit (e.g. "ja" for large-to-small ordering and 2659 * "ja-Latn" or "en" for small-to-large). This way, the most specific line of 2660 * an address can be selected based on the language. 2661 * The minimum permitted structural representation of an address consists 2662 * of a region_code with all remaining information placed in the 2663 * address_lines. It would be possible to format such an address very 2664 * approximately without geocoding, but no semantic reasoning could be 2665 * made about any of the address components until it was at least 2666 * partially resolved. 2667 * Creating an address only containing a region_code and address_lines, and 2668 * then geocoding is the recommended way to handle completely unstructured 2669 * addresses (as opposed to guessing which parts of the address should be 2670 * localities or administrative areas). 2671 * </pre> 2672 * 2673 * <code>repeated string address_lines = 9;</code> 2674 * 2675 * @param value The bytes of the addressLines to add. 2676 * @return This builder for chaining. 2677 */ addAddressLinesBytes(com.google.protobuf.ByteString value)2678 public Builder addAddressLinesBytes(com.google.protobuf.ByteString value) { 2679 if (value == null) { 2680 throw new NullPointerException(); 2681 } 2682 checkByteStringIsUtf8(value); 2683 ensureAddressLinesIsMutable(); 2684 addressLines_.add(value); 2685 onChanged(); 2686 return this; 2687 } 2688 2689 private com.google.protobuf.LazyStringList recipients_ = 2690 com.google.protobuf.LazyStringArrayList.EMPTY; 2691 ensureRecipientsIsMutable()2692 private void ensureRecipientsIsMutable() { 2693 if (!((bitField0_ & 0x00000200) != 0)) { 2694 recipients_ = new com.google.protobuf.LazyStringArrayList(recipients_); 2695 bitField0_ |= 0x00000200; 2696 } 2697 } 2698 /** 2699 * 2700 * 2701 * <pre> 2702 * Optional. The recipient at the address. 2703 * This field may, under certain circumstances, contain multiline information. 2704 * For example, it might contain "care of" information. 2705 * </pre> 2706 * 2707 * <code>repeated string recipients = 10;</code> 2708 * 2709 * @return A list containing the recipients. 2710 */ getRecipientsList()2711 public com.google.protobuf.ProtocolStringList getRecipientsList() { 2712 return recipients_.getUnmodifiableView(); 2713 } 2714 /** 2715 * 2716 * 2717 * <pre> 2718 * Optional. The recipient at the address. 2719 * This field may, under certain circumstances, contain multiline information. 2720 * For example, it might contain "care of" information. 2721 * </pre> 2722 * 2723 * <code>repeated string recipients = 10;</code> 2724 * 2725 * @return The count of recipients. 2726 */ getRecipientsCount()2727 public int getRecipientsCount() { 2728 return recipients_.size(); 2729 } 2730 /** 2731 * 2732 * 2733 * <pre> 2734 * Optional. The recipient at the address. 2735 * This field may, under certain circumstances, contain multiline information. 2736 * For example, it might contain "care of" information. 2737 * </pre> 2738 * 2739 * <code>repeated string recipients = 10;</code> 2740 * 2741 * @param index The index of the element to return. 2742 * @return The recipients at the given index. 2743 */ getRecipients(int index)2744 public java.lang.String getRecipients(int index) { 2745 return recipients_.get(index); 2746 } 2747 /** 2748 * 2749 * 2750 * <pre> 2751 * Optional. The recipient at the address. 2752 * This field may, under certain circumstances, contain multiline information. 2753 * For example, it might contain "care of" information. 2754 * </pre> 2755 * 2756 * <code>repeated string recipients = 10;</code> 2757 * 2758 * @param index The index of the value to return. 2759 * @return The bytes of the recipients at the given index. 2760 */ getRecipientsBytes(int index)2761 public com.google.protobuf.ByteString getRecipientsBytes(int index) { 2762 return recipients_.getByteString(index); 2763 } 2764 /** 2765 * 2766 * 2767 * <pre> 2768 * Optional. The recipient at the address. 2769 * This field may, under certain circumstances, contain multiline information. 2770 * For example, it might contain "care of" information. 2771 * </pre> 2772 * 2773 * <code>repeated string recipients = 10;</code> 2774 * 2775 * @param index The index to set the value at. 2776 * @param value The recipients to set. 2777 * @return This builder for chaining. 2778 */ setRecipients(int index, java.lang.String value)2779 public Builder setRecipients(int index, java.lang.String value) { 2780 if (value == null) { 2781 throw new NullPointerException(); 2782 } 2783 ensureRecipientsIsMutable(); 2784 recipients_.set(index, value); 2785 onChanged(); 2786 return this; 2787 } 2788 /** 2789 * 2790 * 2791 * <pre> 2792 * Optional. The recipient at the address. 2793 * This field may, under certain circumstances, contain multiline information. 2794 * For example, it might contain "care of" information. 2795 * </pre> 2796 * 2797 * <code>repeated string recipients = 10;</code> 2798 * 2799 * @param value The recipients to add. 2800 * @return This builder for chaining. 2801 */ addRecipients(java.lang.String value)2802 public Builder addRecipients(java.lang.String value) { 2803 if (value == null) { 2804 throw new NullPointerException(); 2805 } 2806 ensureRecipientsIsMutable(); 2807 recipients_.add(value); 2808 onChanged(); 2809 return this; 2810 } 2811 /** 2812 * 2813 * 2814 * <pre> 2815 * Optional. The recipient at the address. 2816 * This field may, under certain circumstances, contain multiline information. 2817 * For example, it might contain "care of" information. 2818 * </pre> 2819 * 2820 * <code>repeated string recipients = 10;</code> 2821 * 2822 * @param values The recipients to add. 2823 * @return This builder for chaining. 2824 */ addAllRecipients(java.lang.Iterable<java.lang.String> values)2825 public Builder addAllRecipients(java.lang.Iterable<java.lang.String> values) { 2826 ensureRecipientsIsMutable(); 2827 com.google.protobuf.AbstractMessageLite.Builder.addAll(values, recipients_); 2828 onChanged(); 2829 return this; 2830 } 2831 /** 2832 * 2833 * 2834 * <pre> 2835 * Optional. The recipient at the address. 2836 * This field may, under certain circumstances, contain multiline information. 2837 * For example, it might contain "care of" information. 2838 * </pre> 2839 * 2840 * <code>repeated string recipients = 10;</code> 2841 * 2842 * @return This builder for chaining. 2843 */ clearRecipients()2844 public Builder clearRecipients() { 2845 recipients_ = com.google.protobuf.LazyStringArrayList.EMPTY; 2846 bitField0_ = (bitField0_ & ~0x00000200); 2847 onChanged(); 2848 return this; 2849 } 2850 /** 2851 * 2852 * 2853 * <pre> 2854 * Optional. The recipient at the address. 2855 * This field may, under certain circumstances, contain multiline information. 2856 * For example, it might contain "care of" information. 2857 * </pre> 2858 * 2859 * <code>repeated string recipients = 10;</code> 2860 * 2861 * @param value The bytes of the recipients to add. 2862 * @return This builder for chaining. 2863 */ addRecipientsBytes(com.google.protobuf.ByteString value)2864 public Builder addRecipientsBytes(com.google.protobuf.ByteString value) { 2865 if (value == null) { 2866 throw new NullPointerException(); 2867 } 2868 checkByteStringIsUtf8(value); 2869 ensureRecipientsIsMutable(); 2870 recipients_.add(value); 2871 onChanged(); 2872 return this; 2873 } 2874 2875 private java.lang.Object organization_ = ""; 2876 /** 2877 * 2878 * 2879 * <pre> 2880 * Optional. The name of the organization at the address. 2881 * </pre> 2882 * 2883 * <code>string organization = 11;</code> 2884 * 2885 * @return The organization. 2886 */ getOrganization()2887 public java.lang.String getOrganization() { 2888 java.lang.Object ref = organization_; 2889 if (!(ref instanceof java.lang.String)) { 2890 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 2891 java.lang.String s = bs.toStringUtf8(); 2892 organization_ = s; 2893 return s; 2894 } else { 2895 return (java.lang.String) ref; 2896 } 2897 } 2898 /** 2899 * 2900 * 2901 * <pre> 2902 * Optional. The name of the organization at the address. 2903 * </pre> 2904 * 2905 * <code>string organization = 11;</code> 2906 * 2907 * @return The bytes for organization. 2908 */ getOrganizationBytes()2909 public com.google.protobuf.ByteString getOrganizationBytes() { 2910 java.lang.Object ref = organization_; 2911 if (ref instanceof String) { 2912 com.google.protobuf.ByteString b = 2913 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 2914 organization_ = b; 2915 return b; 2916 } else { 2917 return (com.google.protobuf.ByteString) ref; 2918 } 2919 } 2920 /** 2921 * 2922 * 2923 * <pre> 2924 * Optional. The name of the organization at the address. 2925 * </pre> 2926 * 2927 * <code>string organization = 11;</code> 2928 * 2929 * @param value The organization to set. 2930 * @return This builder for chaining. 2931 */ setOrganization(java.lang.String value)2932 public Builder setOrganization(java.lang.String value) { 2933 if (value == null) { 2934 throw new NullPointerException(); 2935 } 2936 organization_ = value; 2937 bitField0_ |= 0x00000400; 2938 onChanged(); 2939 return this; 2940 } 2941 /** 2942 * 2943 * 2944 * <pre> 2945 * Optional. The name of the organization at the address. 2946 * </pre> 2947 * 2948 * <code>string organization = 11;</code> 2949 * 2950 * @return This builder for chaining. 2951 */ clearOrganization()2952 public Builder clearOrganization() { 2953 organization_ = getDefaultInstance().getOrganization(); 2954 bitField0_ = (bitField0_ & ~0x00000400); 2955 onChanged(); 2956 return this; 2957 } 2958 /** 2959 * 2960 * 2961 * <pre> 2962 * Optional. The name of the organization at the address. 2963 * </pre> 2964 * 2965 * <code>string organization = 11;</code> 2966 * 2967 * @param value The bytes for organization to set. 2968 * @return This builder for chaining. 2969 */ setOrganizationBytes(com.google.protobuf.ByteString value)2970 public Builder setOrganizationBytes(com.google.protobuf.ByteString value) { 2971 if (value == null) { 2972 throw new NullPointerException(); 2973 } 2974 checkByteStringIsUtf8(value); 2975 organization_ = value; 2976 bitField0_ |= 0x00000400; 2977 onChanged(); 2978 return this; 2979 } 2980 2981 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)2982 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 2983 return super.setUnknownFields(unknownFields); 2984 } 2985 2986 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)2987 public final Builder mergeUnknownFields( 2988 final com.google.protobuf.UnknownFieldSet unknownFields) { 2989 return super.mergeUnknownFields(unknownFields); 2990 } 2991 2992 // @@protoc_insertion_point(builder_scope:google.type.PostalAddress) 2993 } 2994 2995 // @@protoc_insertion_point(class_scope:google.type.PostalAddress) 2996 private static final com.google.type.PostalAddress DEFAULT_INSTANCE; 2997 2998 static { 2999 DEFAULT_INSTANCE = new com.google.type.PostalAddress(); 3000 } 3001 getDefaultInstance()3002 public static com.google.type.PostalAddress getDefaultInstance() { 3003 return DEFAULT_INSTANCE; 3004 } 3005 3006 private static final com.google.protobuf.Parser<PostalAddress> PARSER = 3007 new com.google.protobuf.AbstractParser<PostalAddress>() { 3008 @java.lang.Override 3009 public PostalAddress parsePartialFrom( 3010 com.google.protobuf.CodedInputStream input, 3011 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 3012 throws com.google.protobuf.InvalidProtocolBufferException { 3013 Builder builder = newBuilder(); 3014 try { 3015 builder.mergeFrom(input, extensionRegistry); 3016 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 3017 throw e.setUnfinishedMessage(builder.buildPartial()); 3018 } catch (com.google.protobuf.UninitializedMessageException e) { 3019 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 3020 } catch (java.io.IOException e) { 3021 throw new com.google.protobuf.InvalidProtocolBufferException(e) 3022 .setUnfinishedMessage(builder.buildPartial()); 3023 } 3024 return builder.buildPartial(); 3025 } 3026 }; 3027 parser()3028 public static com.google.protobuf.Parser<PostalAddress> parser() { 3029 return PARSER; 3030 } 3031 3032 @java.lang.Override getParserForType()3033 public com.google.protobuf.Parser<PostalAddress> getParserForType() { 3034 return PARSER; 3035 } 3036 3037 @java.lang.Override getDefaultInstanceForType()3038 public com.google.type.PostalAddress getDefaultInstanceForType() { 3039 return DEFAULT_INSTANCE; 3040 } 3041 } 3042