# Interface PostalAddressOrBuilder (2.72.0)

2.72.0 (latest) 2.70.0 2.67.0 2.66.0 2.65.1 2.64.1 2.63.2 2.62.0 2.61.3 2.60.0 2.59.2 2.58.0 2.57.0 2.56.0 2.54.1 2.53.0 2.52.0 2.51.0 2.50.1 2.49.0 2.48.0 2.46.0 2.45.1 2.44.0 2.43.0 2.42.0 2.41.0 2.40.0 2.39.1 2.38.0 2.37.1 2.36.0 2.34.0 2.33.0 2.32.0 2.30.0 2.29.0 2.28.0 2.27.0 2.26.0 2.25.1 2.24.0 2.23.1 2.22.1 2.21.1 2.15.0 2.14.3 2.13.0 2.12.0 2.11.0 2.10.0 2.9.6 2.8.4 2.7.4

    public interface PostalAddressOrBuilder extends MessageOrBuilder

## Implements

[MessageOrBuilder](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.MessageOrBuilder.html)

## Methods

### getAddressLines(int index)

    public abstract String getAddressLines(int index)

Unstructured address lines describing the lower levels of an address.

Because values in `address_lines` do not have type information and may
sometimes contain multiple values in a single field (for example,
"Austin, TX"), it is important that the line order is clear. The order of
address lines should be "envelope order" for the country or region of the
address. In places where this can vary (for example, Japan),
`address_language` is used to make it explicit (for example, "ja" for
large-to-small ordering and "ja-Latn" or "en" for small-to-large). In this
way, the most specific line of an address can be selected based on the
language.

The minimum permitted structural representation of an address consists
of a `region_code` with all remaining information placed in the
`address_lines`. It would be possible to format such an address very
approximately without geocoding, but no semantic reasoning could be
made about any of the address components until it was at least
partially resolved.

Creating an address only containing a `region_code` and `address_lines` and
then geocoding is the recommended way to handle completely unstructured
addresses (as opposed to guessing which parts of the address should be
localities or administrative areas).

`repeated string address_lines = 9;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` The index of the element to return. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The addressLines at the given index. |

### getAddressLinesBytes(int index)

    public abstract ByteString getAddressLinesBytes(int index)

Unstructured address lines describing the lower levels of an address.

Because values in `address_lines` do not have type information and may
sometimes contain multiple values in a single field (for example,
"Austin, TX"), it is important that the line order is clear. The order of
address lines should be "envelope order" for the country or region of the
address. In places where this can vary (for example, Japan),
`address_language` is used to make it explicit (for example, "ja" for
large-to-small ordering and "ja-Latn" or "en" for small-to-large). In this
way, the most specific line of an address can be selected based on the
language.

The minimum permitted structural representation of an address consists
of a `region_code` with all remaining information placed in the
`address_lines`. It would be possible to format such an address very
approximately without geocoding, but no semantic reasoning could be
made about any of the address components until it was at least
partially resolved.

Creating an address only containing a `region_code` and `address_lines` and
then geocoding is the recommended way to handle completely unstructured
addresses (as opposed to guessing which parts of the address should be
localities or administrative areas).

`repeated string address_lines = 9;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` The index of the value to return. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes of the addressLines at the given index. |

### getAddressLinesCount()

    public abstract int getAddressLinesCount()

Unstructured address lines describing the lower levels of an address.

Because values in `address_lines` do not have type information and may
sometimes contain multiple values in a single field (for example,
"Austin, TX"), it is important that the line order is clear. The order of
address lines should be "envelope order" for the country or region of the
address. In places where this can vary (for example, Japan),
`address_language` is used to make it explicit (for example, "ja" for
large-to-small ordering and "ja-Latn" or "en" for small-to-large). In this
way, the most specific line of an address can be selected based on the
language.

The minimum permitted structural representation of an address consists
of a `region_code` with all remaining information placed in the
`address_lines`. It would be possible to format such an address very
approximately without geocoding, but no semantic reasoning could be
made about any of the address components until it was at least
partially resolved.

Creating an address only containing a `region_code` and `address_lines` and
then geocoding is the recommended way to handle completely unstructured
addresses (as opposed to guessing which parts of the address should be
localities or administrative areas).

`repeated string address_lines = 9;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The count of addressLines. |

### getAddressLinesList()

    public abstract List<String> getAddressLinesList()

Unstructured address lines describing the lower levels of an address.

Because values in `address_lines` do not have type information and may
sometimes contain multiple values in a single field (for example,
"Austin, TX"), it is important that the line order is clear. The order of
address lines should be "envelope order" for the country or region of the
address. In places where this can vary (for example, Japan),
`address_language` is used to make it explicit (for example, "ja" for
large-to-small ordering and "ja-Latn" or "en" for small-to-large). In this
way, the most specific line of an address can be selected based on the
language.

The minimum permitted structural representation of an address consists
of a `region_code` with all remaining information placed in the
`address_lines`. It would be possible to format such an address very
approximately without geocoding, but no semantic reasoning could be
made about any of the address components until it was at least
partially resolved.

Creating an address only containing a `region_code` and `address_lines` and
then geocoding is the recommended way to handle completely unstructured
addresses (as opposed to guessing which parts of the address should be
localities or administrative areas).

`repeated string address_lines = 9;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` | A list containing the addressLines. |

### getAdministrativeArea()

    public abstract String getAdministrativeArea()

Optional. Highest administrative subdivision which is used for postal
addresses of a country or region.
For example, this can be a state, a province, an oblast, or a prefecture.
For Spain, this is the province and not the autonomous
community (for example, "Barcelona" and not "Catalonia").
Many countries don't use an administrative area in postal addresses. For
example, in Switzerland, this should be left unpopulated.

`string administrative_area = 6;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The administrativeArea. |

### getAdministrativeAreaBytes()

    public abstract ByteString getAdministrativeAreaBytes()

Optional. Highest administrative subdivision which is used for postal
addresses of a country or region.
For example, this can be a state, a province, an oblast, or a prefecture.
For Spain, this is the province and not the autonomous
community (for example, "Barcelona" and not "Catalonia").
Many countries don't use an administrative area in postal addresses. For
example, in Switzerland, this should be left unpopulated.

`string administrative_area = 6;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for administrativeArea. |

### getLanguageCode()

    public abstract String getLanguageCode()

Optional. BCP-47 language code of the contents of this address (if
known). This is often the UI language of the input form or is expected
to match one of the languages used in the address' country/region, or their
transliterated equivalents.
This can affect formatting in certain countries, but is not critical
to the correctness of the data and will never affect any validation or
other non-formatting related operations.

If this value is not known, it should be omitted (rather than specifying a
possibly incorrect default).

Examples: "zh-Hant", "ja", "ja-Latn", "en".

`string language_code = 3;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The languageCode. |

### getLanguageCodeBytes()

    public abstract ByteString getLanguageCodeBytes()

Optional. BCP-47 language code of the contents of this address (if
known). This is often the UI language of the input form or is expected
to match one of the languages used in the address' country/region, or their
transliterated equivalents.
This can affect formatting in certain countries, but is not critical
to the correctness of the data and will never affect any validation or
other non-formatting related operations.

If this value is not known, it should be omitted (rather than specifying a
possibly incorrect default).

Examples: "zh-Hant", "ja", "ja-Latn", "en".

`string language_code = 3;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for languageCode. |

### getLocality()

    public abstract String getLocality()

Optional. Generally refers to the city or town portion of the address.
Examples: US city, IT comune, UK post town.
In regions of the world where localities are not well defined or do not fit
into this structure well, leave `locality` empty and use `address_lines`.

`string locality = 7;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The locality. |

### getLocalityBytes()

    public abstract ByteString getLocalityBytes()

Optional. Generally refers to the city or town portion of the address.
Examples: US city, IT comune, UK post town.
In regions of the world where localities are not well defined or do not fit
into this structure well, leave `locality` empty and use `address_lines`.

`string locality = 7;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for locality. |

### getOrganization()

    public abstract String getOrganization()

Optional. The name of the organization at the address.

`string organization = 11;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The organization. |

### getOrganizationBytes()

    public abstract ByteString getOrganizationBytes()

Optional. The name of the organization at the address.

`string organization = 11;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for organization. |

### getPostalCode()

    public abstract String getPostalCode()

Optional. Postal code of the address. Not all countries use or require
postal codes to be present, but where they are used, they may trigger
additional validation with other parts of the address (for example,
state or zip code validation in the United States).

`string postal_code = 4;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The postalCode. |

### getPostalCodeBytes()

    public abstract ByteString getPostalCodeBytes()

Optional. Postal code of the address. Not all countries use or require
postal codes to be present, but where they are used, they may trigger
additional validation with other parts of the address (for example,
state or zip code validation in the United States).

`string postal_code = 4;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for postalCode. |

### getRecipients(int index)

    public abstract String getRecipients(int index)

Optional. The recipient at the address.
This field may, under certain circumstances, contain multiline information.
For example, it might contain "care of" information.

`repeated string recipients = 10;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` The index of the element to return. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The recipients at the given index. |

### getRecipientsBytes(int index)

    public abstract ByteString getRecipientsBytes(int index)

Optional. The recipient at the address.
This field may, under certain circumstances, contain multiline information.
For example, it might contain "care of" information.

`repeated string recipients = 10;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` The index of the value to return. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes of the recipients at the given index. |

### getRecipientsCount()

    public abstract int getRecipientsCount()

Optional. The recipient at the address.
This field may, under certain circumstances, contain multiline information.
For example, it might contain "care of" information.

`repeated string recipients = 10;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The count of recipients. |

### getRecipientsList()

    public abstract List<String> getRecipientsList()

Optional. The recipient at the address.
This field may, under certain circumstances, contain multiline information.
For example, it might contain "care of" information.

`repeated string recipients = 10;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` | A list containing the recipients. |

### getRegionCode()

    public abstract String getRegionCode()

Required. CLDR region code of the country/region of the address. This
is never inferred and it is up to the user to ensure the value is
correct. See <https://cldr.unicode.org/> and
<https://www.unicode.org/cldr/charts/30/supplemental/territory_information.html>
for details. Example: "CH" for Switzerland.

`string region_code = 2;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The regionCode. |

### getRegionCodeBytes()

    public abstract ByteString getRegionCodeBytes()

Required. CLDR region code of the country/region of the address. This
is never inferred and it is up to the user to ensure the value is
correct. See <https://cldr.unicode.org/> and
<https://www.unicode.org/cldr/charts/30/supplemental/territory_information.html>
for details. Example: "CH" for Switzerland.

`string region_code = 2;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for regionCode. |

### getRevision()

    public abstract int getRevision()

The schema revision of the `PostalAddress`. This must be set to 0, which is
the latest revision.

All new revisions **must** be backward compatible with old revisions.

`int32 revision = 1;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The revision. |

### getSortingCode()

    public abstract String getSortingCode()

Optional. Additional, country-specific, sorting code. This is not used
in most regions. Where it is used, the value is either a string like
"CEDEX", optionally followed by a number (for example, "CEDEX 7"), or just
a number alone, representing the "sector code" (Jamaica), "delivery area
indicator" (Malawi) or "post office indicator" (Côte d'Ivoire).

`string sorting_code = 5;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The sortingCode. |

### getSortingCodeBytes()

    public abstract ByteString getSortingCodeBytes()

Optional. Additional, country-specific, sorting code. This is not used
in most regions. Where it is used, the value is either a string like
"CEDEX", optionally followed by a number (for example, "CEDEX 7"), or just
a number alone, representing the "sector code" (Jamaica), "delivery area
indicator" (Malawi) or "post office indicator" (Côte d'Ivoire).

`string sorting_code = 5;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for sortingCode. |

### getSublocality()

    public abstract String getSublocality()

Optional. Sublocality of the address.
For example, this can be a neighborhood, borough, or district.

`string sublocality = 8;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The sublocality. |

### getSublocalityBytes()

    public abstract ByteString getSublocalityBytes()

Optional. Sublocality of the address.
For example, this can be a neighborhood, borough, or district.

`string sublocality = 8;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for sublocality. |