# Interface TlsRoute.RouteMatchOrBuilder (0.16.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [0.16.0 (latest)](https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.networkservices.v1.TlsRoute.RouteMatchOrBuilder)
- [0.15.0](https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/0.15.0/com.google.events.cloud.networkservices.v1.TlsRoute.RouteMatchOrBuilder)
- [0.14.1](https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/0.14.1/com.google.events.cloud.networkservices.v1.TlsRoute.RouteMatchOrBuilder)

    public static interface TlsRoute.RouteMatchOrBuilder extends MessageOrBuilder

## Implements

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

## Methods

### getAlpn(int index)

    public abstract String getAlpn(int index)

Optional. ALPN (Application-Layer Protocol Negotiation) to match against.
Examples: "http/1.1", "h2".
At least one of sni_host and alpn is required.
Up to 5 alpns across all matches can be set.

`repeated string alpn = 2;`

| **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 alpn at the given index. |

### getAlpnBytes(int index)

    public abstract ByteString getAlpnBytes(int index)

Optional. ALPN (Application-Layer Protocol Negotiation) to match against.
Examples: "http/1.1", "h2".
At least one of sni_host and alpn is required.
Up to 5 alpns across all matches can be set.

`repeated string alpn = 2;`

| **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 alpn at the given index. |

### getAlpnCount()

    public abstract int getAlpnCount()

Optional. ALPN (Application-Layer Protocol Negotiation) to match against.
Examples: "http/1.1", "h2".
At least one of sni_host and alpn is required.
Up to 5 alpns across all matches can be set.

`repeated string alpn = 2;`

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

### getAlpnList()

    public abstract List<String> getAlpnList()

Optional. ALPN (Application-Layer Protocol Negotiation) to match against.
Examples: "http/1.1", "h2".
At least one of sni_host and alpn is required.
Up to 5 alpns across all matches can be set.

`repeated string alpn = 2;`

| **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 alpn. |

### getSniHost(int index)

    public abstract String getSniHost(int index)

Optional. SNI (server name indicator) to match against.
SNI will be matched against all wildcard domains, i.e. `www.example.com`
will be first matched against `www.example.com`, then `.example.com`,
then `.com.`
Partial wildcards are not supported, and values like \*w.example.com are
invalid.
At least one of sni_host and alpn is required.
Up to 5 sni hosts across all matches can be set.

`repeated string sni_host = 1;`

| **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 sniHost at the given index. |

### getSniHostBytes(int index)

    public abstract ByteString getSniHostBytes(int index)

Optional. SNI (server name indicator) to match against.
SNI will be matched against all wildcard domains, i.e. `www.example.com`
will be first matched against `www.example.com`, then `.example.com`,
then `.com.`
Partial wildcards are not supported, and values like \*w.example.com are
invalid.
At least one of sni_host and alpn is required.
Up to 5 sni hosts across all matches can be set.

`repeated string sni_host = 1;`

| **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 sniHost at the given index. |

### getSniHostCount()

    public abstract int getSniHostCount()

Optional. SNI (server name indicator) to match against.
SNI will be matched against all wildcard domains, i.e. `www.example.com`
will be first matched against `www.example.com`, then `.example.com`,
then `.com.`
Partial wildcards are not supported, and values like \*w.example.com are
invalid.
At least one of sni_host and alpn is required.
Up to 5 sni hosts across all matches can be set.

`repeated string sni_host = 1;`

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

### getSniHostList()

    public abstract List<String> getSniHostList()

Optional. SNI (server name indicator) to match against.
SNI will be matched against all wildcard domains, i.e. `www.example.com`
will be first matched against `www.example.com`, then `.example.com`,
then `.com.`
Partial wildcards are not supported, and values like \*w.example.com are
invalid.
At least one of sni_host and alpn is required.
Up to 5 sni hosts across all matches can be set.

`repeated string sni_host = 1;`

| **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 sniHost. |