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.
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.
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).
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).
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).
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).
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).
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[],[],null,["# Interface EndpointMatcher.MetadataLabelMatcherOrBuilder (0.16.0)\n\nVersion latestkeyboard_arrow_down\n\n- [0.16.0 (latest)](/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcherOrBuilder)\n- [0.15.0](/java/docs/reference/google-cloudevent-types/0.15.0/com.google.events.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcherOrBuilder)\n- [0.14.1](/java/docs/reference/google-cloudevent-types/0.14.1/com.google.events.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcherOrBuilder) \n\n public static interface EndpointMatcher.MetadataLabelMatcherOrBuilder extends MessageOrBuilder\n\nImplements\n----------\n\n[MessageOrBuilder](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.MessageOrBuilder.html)\n\nMethods\n-------\n\n### getMetadataLabelMatchCriteria()\n\n public abstract EndpointMatcher.MetadataLabelMatcher.MetadataLabelMatchCriteria getMetadataLabelMatchCriteria()\n\nSpecifies how matching should be done.\nSupported values are:\nMATCH_ANY: At least one of the Labels specified in the\nmatcher should match the metadata presented by xDS client.\nMATCH_ALL: The metadata presented by the xDS client should\ncontain all of the labels specified here.\nThe selection is determined based on the best match. For\nexample, suppose there are three EndpointPolicy\nresources P1, P2 and P3 and if P1 has a the matcher as\nMATCH_ANY \\\u003cA:1, B:1\\\u003e, P2 has MATCH_ALL \\\u003cA:1,B:1\\\u003e, and P3 has\nMATCH_ALL \\\u003cA:1,B:1,C:1\\\u003e.\nIf a client with label \\\u003cA:1\\\u003e connects, the config from P1\nwill be selected.\nIf a client with label \\\u003cA:1,B:1\\\u003e connects, the config from P2\nwill be selected.\nIf a client with label \\\u003cA:1,B:1,C:1\\\u003e connects, the config\nfrom P3 will be selected.\nIf there is more than one best match, (for example, if a\nconfig P4 with selector \\\u003cA:1,D:1\\\u003e exists and if a client with\nlabel \\\u003cA:1,B:1,D:1\\\u003e connects), an error will be thrown.\n\n`\n.google.events.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabelMatchCriteria metadata_label_match_criteria = 1;\n`\n\n### getMetadataLabelMatchCriteriaValue()\n\n public abstract int getMetadataLabelMatchCriteriaValue()\n\nSpecifies how matching should be done.\nSupported values are:\nMATCH_ANY: At least one of the Labels specified in the\nmatcher should match the metadata presented by xDS client.\nMATCH_ALL: The metadata presented by the xDS client should\ncontain all of the labels specified here.\nThe selection is determined based on the best match. For\nexample, suppose there are three EndpointPolicy\nresources P1, P2 and P3 and if P1 has a the matcher as\nMATCH_ANY \\\u003cA:1, B:1\\\u003e, P2 has MATCH_ALL \\\u003cA:1,B:1\\\u003e, and P3 has\nMATCH_ALL \\\u003cA:1,B:1,C:1\\\u003e.\nIf a client with label \\\u003cA:1\\\u003e connects, the config from P1\nwill be selected.\nIf a client with label \\\u003cA:1,B:1\\\u003e connects, the config from P2\nwill be selected.\nIf a client with label \\\u003cA:1,B:1,C:1\\\u003e connects, the config\nfrom P3 will be selected.\nIf there is more than one best match, (for example, if a\nconfig P4 with selector \\\u003cA:1,D:1\\\u003e exists and if a client with\nlabel \\\u003cA:1,B:1,D:1\\\u003e connects), an error will be thrown.\n\n`\n.google.events.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabelMatchCriteria metadata_label_match_criteria = 1;\n`\n\n### getMetadataLabels(int index)\n\n public abstract EndpointMatcher.MetadataLabelMatcher.MetadataLabels getMetadataLabels(int index)\n\nThe list of label value pairs that must match labels in the\nprovided metadata based on filterMatchCriteria This list can\nhave at most 64 entries. The list can be empty if the match\ncriteria is MATCH_ANY, to specify a wildcard match (i.e this\nmatches any client).\n\n`\nrepeated .google.events.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels metadata_labels = 2;\n`\n\n### getMetadataLabelsCount()\n\n public abstract int getMetadataLabelsCount()\n\nThe list of label value pairs that must match labels in the\nprovided metadata based on filterMatchCriteria This list can\nhave at most 64 entries. The list can be empty if the match\ncriteria is MATCH_ANY, to specify a wildcard match (i.e this\nmatches any client).\n\n`\nrepeated .google.events.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels metadata_labels = 2;\n`\n\n### getMetadataLabelsList()\n\n public abstract List\u003cEndpointMatcher.MetadataLabelMatcher.MetadataLabels\u003e getMetadataLabelsList()\n\nThe list of label value pairs that must match labels in the\nprovided metadata based on filterMatchCriteria This list can\nhave at most 64 entries. The list can be empty if the match\ncriteria is MATCH_ANY, to specify a wildcard match (i.e this\nmatches any client).\n\n`\nrepeated .google.events.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels metadata_labels = 2;\n`\n\n### getMetadataLabelsOrBuilder(int index)\n\n public abstract EndpointMatcher.MetadataLabelMatcher.MetadataLabelsOrBuilder getMetadataLabelsOrBuilder(int index)\n\nThe list of label value pairs that must match labels in the\nprovided metadata based on filterMatchCriteria This list can\nhave at most 64 entries. The list can be empty if the match\ncriteria is MATCH_ANY, to specify a wildcard match (i.e this\nmatches any client).\n\n`\nrepeated .google.events.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels metadata_labels = 2;\n`\n\n### getMetadataLabelsOrBuilderList()\n\n public abstract List\u003c? extends EndpointMatcher.MetadataLabelMatcher.MetadataLabelsOrBuilder\u003e getMetadataLabelsOrBuilderList()\n\nThe list of label value pairs that must match labels in the\nprovided metadata based on filterMatchCriteria This list can\nhave at most 64 entries. The list can be empty if the match\ncriteria is MATCH_ANY, to specify a wildcard match (i.e this\nmatches any client).\n\n`\nrepeated .google.events.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels metadata_labels = 2;\n`"]]