# Interface EndpointMatcher.MetadataLabelMatcherOrBuilder (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.EndpointMatcher.MetadataLabelMatcherOrBuilder)
- [0.15.0](https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/0.15.0/com.google.events.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcherOrBuilder)
- [0.14.1](https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/0.14.1/com.google.events.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcherOrBuilder)

    public static interface EndpointMatcher.MetadataLabelMatcherOrBuilder extends MessageOrBuilder

## Implements

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

## Methods

### getMetadataLabelMatchCriteria()

    public abstract EndpointMatcher.MetadataLabelMatcher.MetadataLabelMatchCriteria getMetadataLabelMatchCriteria()

Specifies how matching should be done.
Supported values are:
MATCH_ANY: At least one of the Labels specified in the
matcher should match the metadata presented by xDS client.
MATCH_ALL: The metadata presented by the xDS client should
contain all of the labels specified here.
The selection is determined based on the best match. For
example, suppose there are three EndpointPolicy
resources P1, P2 and P3 and if P1 has a the matcher as
MATCH_ANY \<A:1, B:1\>, P2 has MATCH_ALL \<A:1,B:1\>, and P3 has
MATCH_ALL \<A:1,B:1,C:1\>.
If a client with label \<A:1\> connects, the config from P1
will be selected.
If a client with label \<A:1,B:1\> connects, the config from P2
will be selected.
If a client with label \<A:1,B:1,C:1\> connects, the config
from P3 will be selected.
If there is more than one best match, (for example, if a
config P4 with selector \<A:1,D:1\> exists and if a client with
label \<A:1,B:1,D:1\> connects), an error will be thrown.

`
.google.events.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabelMatchCriteria metadata_label_match_criteria = 1;
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabelMatchCriteria` | The metadataLabelMatchCriteria. |

### getMetadataLabelMatchCriteriaValue()

    public abstract int getMetadataLabelMatchCriteriaValue()

Specifies how matching should be done.
Supported values are:
MATCH_ANY: At least one of the Labels specified in the
matcher should match the metadata presented by xDS client.
MATCH_ALL: The metadata presented by the xDS client should
contain all of the labels specified here.
The selection is determined based on the best match. For
example, suppose there are three EndpointPolicy
resources P1, P2 and P3 and if P1 has a the matcher as
MATCH_ANY \<A:1, B:1\>, P2 has MATCH_ALL \<A:1,B:1\>, and P3 has
MATCH_ALL \<A:1,B:1,C:1\>.
If a client with label \<A:1\> connects, the config from P1
will be selected.
If a client with label \<A:1,B:1\> connects, the config from P2
will be selected.
If a client with label \<A:1,B:1,C:1\> connects, the config
from P3 will be selected.
If there is more than one best match, (for example, if a
config P4 with selector \<A:1,D:1\> exists and if a client with
label \<A:1,B:1,D:1\> connects), an error will be thrown.

`
.google.events.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabelMatchCriteria metadata_label_match_criteria = 1;
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The enum numeric value on the wire for metadataLabelMatchCriteria. |

### getMetadataLabels(int index)

    public abstract EndpointMatcher.MetadataLabelMatcher.MetadataLabels getMetadataLabels(int index)

The list of label value pairs that must match labels in the
provided metadata based on filterMatchCriteria This list can
have at most 64 entries. The list can be empty if the match
criteria is MATCH_ANY, to specify a wildcard match (i.e this
matches any client).

`
repeated .google.events.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels metadata_labels = 2;
`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels` |   |

### getMetadataLabelsCount()

    public abstract int getMetadataLabelsCount()

The list of label value pairs that must match labels in the
provided metadata based on filterMatchCriteria This list can
have at most 64 entries. The list can be empty if the match
criteria is MATCH_ANY, to specify a wildcard match (i.e this
matches any client).

`
repeated .google.events.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels metadata_labels = 2;
`

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

### getMetadataLabelsList()

    public abstract List<EndpointMatcher.MetadataLabelMatcher.MetadataLabels> getMetadataLabelsList()

The list of label value pairs that must match labels in the
provided metadata based on filterMatchCriteria This list can
have at most 64 entries. The list can be empty if the match
criteria is MATCH_ANY, to specify a wildcard match (i.e this
matches any client).

`
repeated .google.events.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels metadata_labels = 2;
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels>` |   |

### getMetadataLabelsOrBuilder(int index)

    public abstract EndpointMatcher.MetadataLabelMatcher.MetadataLabelsOrBuilder getMetadataLabelsOrBuilder(int index)

The list of label value pairs that must match labels in the
provided metadata based on filterMatchCriteria This list can
have at most 64 entries. The list can be empty if the match
criteria is MATCH_ANY, to specify a wildcard match (i.e this
matches any client).

`
repeated .google.events.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels metadata_labels = 2;
`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabelsOrBuilder` |   |

### getMetadataLabelsOrBuilderList()

    public abstract List<? extends EndpointMatcher.MetadataLabelMatcher.MetadataLabelsOrBuilder> getMetadataLabelsOrBuilderList()

The list of label value pairs that must match labels in the
provided metadata based on filterMatchCriteria This list can
have at most 64 entries. The list can be empty if the match
criteria is MATCH_ANY, to specify a wildcard match (i.e this
matches any client).

`
repeated .google.events.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels metadata_labels = 2;
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<? extends com.google.events.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabelsOrBuilder>` |   |