public static final class StructMatcher.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<StructMatcher.Builder> implements StructMatcherOrBuilder
StructMatcher provides a general interface to check if a given value is matched in
google.protobuf.Struct. It uses `path` to retrieve the value
from the struct and then check if it's matched to the specified value.
For example, for the following Struct:
.. code-block:: yaml
fields:
a:
struct_value:
fields:
b:
struct_value:
fields:
c:
string_value: pro
t:
list_value:
values:
- string_value: m
- string_value: n
The following MetadataMatcher is matched as the path [a, b, c] will retrieve a string value "pro"
from the Metadata which is matched to the specified prefix match.
.. code-block:: yaml
path:
- key: a
- key: b
- key: c
value:
string_match:
prefix: pr
The following StructMatcher is matched as the code will match one of the string values in the
list at the path [a, t].
.. code-block:: yaml
path:
- key: a
- key: t
value:
list_match:
one_of:
string_match:
exact: m
An example use of StructMatcher is to match metadata in envoy.v*.core.Node.
Protobuf type envoy.type.matcher.v4alpha.StructMatcher| Modifier and Type | Method and Description |
|---|---|
StructMatcher.Builder |
addAllPath(Iterable<? extends StructMatcher.PathSegment> values)
The path to retrieve the Value from the Struct.
|
StructMatcher.Builder |
addPath(int index,
StructMatcher.PathSegment.Builder builderForValue)
The path to retrieve the Value from the Struct.
|
StructMatcher.Builder |
addPath(int index,
StructMatcher.PathSegment value)
The path to retrieve the Value from the Struct.
|
StructMatcher.Builder |
addPath(StructMatcher.PathSegment.Builder builderForValue)
The path to retrieve the Value from the Struct.
|
StructMatcher.Builder |
addPath(StructMatcher.PathSegment value)
The path to retrieve the Value from the Struct.
|
StructMatcher.PathSegment.Builder |
addPathBuilder()
The path to retrieve the Value from the Struct.
|
StructMatcher.PathSegment.Builder |
addPathBuilder(int index)
The path to retrieve the Value from the Struct.
|
StructMatcher.Builder |
addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) |
StructMatcher |
build() |
StructMatcher |
buildPartial() |
StructMatcher.Builder |
clear() |
StructMatcher.Builder |
clearField(com.google.protobuf.Descriptors.FieldDescriptor field) |
StructMatcher.Builder |
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) |
StructMatcher.Builder |
clearPath()
The path to retrieve the Value from the Struct.
|
StructMatcher.Builder |
clearValue()
The StructMatcher is matched if the value retrieved by path is matched to this value.
|
StructMatcher.Builder |
clone() |
StructMatcher |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
com.google.protobuf.Descriptors.Descriptor |
getDescriptorForType() |
StructMatcher.PathSegment |
getPath(int index)
The path to retrieve the Value from the Struct.
|
StructMatcher.PathSegment.Builder |
getPathBuilder(int index)
The path to retrieve the Value from the Struct.
|
List<StructMatcher.PathSegment.Builder> |
getPathBuilderList()
The path to retrieve the Value from the Struct.
|
int |
getPathCount()
The path to retrieve the Value from the Struct.
|
List<StructMatcher.PathSegment> |
getPathList()
The path to retrieve the Value from the Struct.
|
StructMatcher.PathSegmentOrBuilder |
getPathOrBuilder(int index)
The path to retrieve the Value from the Struct.
|
List<? extends StructMatcher.PathSegmentOrBuilder> |
getPathOrBuilderList()
The path to retrieve the Value from the Struct.
|
ValueMatcher |
getValue()
The StructMatcher is matched if the value retrieved by path is matched to this value.
|
ValueMatcher.Builder |
getValueBuilder()
The StructMatcher is matched if the value retrieved by path is matched to this value.
|
ValueMatcherOrBuilder |
getValueOrBuilder()
The StructMatcher is matched if the value retrieved by path is matched to this value.
|
boolean |
hasValue()
The StructMatcher is matched if the value retrieved by path is matched to this value.
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
StructMatcher.Builder |
mergeFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
StructMatcher.Builder |
mergeFrom(com.google.protobuf.Message other) |
StructMatcher.Builder |
mergeFrom(StructMatcher other) |
StructMatcher.Builder |
mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) |
StructMatcher.Builder |
mergeValue(ValueMatcher value)
The StructMatcher is matched if the value retrieved by path is matched to this value.
|
StructMatcher.Builder |
removePath(int index)
The path to retrieve the Value from the Struct.
|
StructMatcher.Builder |
setField(com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) |
StructMatcher.Builder |
setPath(int index,
StructMatcher.PathSegment.Builder builderForValue)
The path to retrieve the Value from the Struct.
|
StructMatcher.Builder |
setPath(int index,
StructMatcher.PathSegment value)
The path to retrieve the Value from the Struct.
|
StructMatcher.Builder |
setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field,
int index,
Object value) |
StructMatcher.Builder |
setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) |
StructMatcher.Builder |
setValue(ValueMatcher.Builder builderForValue)
The StructMatcher is matched if the value retrieved by path is matched to this value.
|
StructMatcher.Builder |
setValue(ValueMatcher value)
The StructMatcher is matched if the value retrieved by path is matched to this value.
|
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMutableMapField, isClean, markClean, newBuilderForField, onBuilt, onChanged, setUnknownFieldsProto3findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringaddAll, addAll, mergeFrom, newUninitializedMessageExceptionequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<StructMatcher.Builder>public StructMatcher.Builder clear()
clear in interface com.google.protobuf.Message.Builderclear in interface com.google.protobuf.MessageLite.Builderclear in class com.google.protobuf.GeneratedMessageV3.Builder<StructMatcher.Builder>public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
getDescriptorForType in interface com.google.protobuf.Message.BuildergetDescriptorForType in interface com.google.protobuf.MessageOrBuildergetDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<StructMatcher.Builder>public StructMatcher getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderpublic StructMatcher build()
build in interface com.google.protobuf.Message.Builderbuild in interface com.google.protobuf.MessageLite.Builderpublic StructMatcher buildPartial()
buildPartial in interface com.google.protobuf.Message.BuilderbuildPartial in interface com.google.protobuf.MessageLite.Builderpublic StructMatcher.Builder clone()
clone in interface com.google.protobuf.Message.Builderclone in interface com.google.protobuf.MessageLite.Builderclone in class com.google.protobuf.GeneratedMessageV3.Builder<StructMatcher.Builder>public StructMatcher.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
setField in interface com.google.protobuf.Message.BuildersetField in class com.google.protobuf.GeneratedMessageV3.Builder<StructMatcher.Builder>public StructMatcher.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
clearField in interface com.google.protobuf.Message.BuilderclearField in class com.google.protobuf.GeneratedMessageV3.Builder<StructMatcher.Builder>public StructMatcher.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
clearOneof in interface com.google.protobuf.Message.BuilderclearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<StructMatcher.Builder>public StructMatcher.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
setRepeatedField in interface com.google.protobuf.Message.BuildersetRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<StructMatcher.Builder>public StructMatcher.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
addRepeatedField in interface com.google.protobuf.Message.BuilderaddRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<StructMatcher.Builder>public StructMatcher.Builder mergeFrom(com.google.protobuf.Message other)
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<StructMatcher.Builder>public StructMatcher.Builder mergeFrom(StructMatcher other)
public final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<StructMatcher.Builder>public StructMatcher.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in interface com.google.protobuf.MessageLite.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<StructMatcher.Builder>IOExceptionpublic List<StructMatcher.PathSegment> getPathList()
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v4alpha.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... }getPathList in interface StructMatcherOrBuilderpublic int getPathCount()
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v4alpha.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... }getPathCount in interface StructMatcherOrBuilderpublic StructMatcher.PathSegment getPath(int index)
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v4alpha.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... }getPath in interface StructMatcherOrBuilderpublic StructMatcher.Builder setPath(int index, StructMatcher.PathSegment value)
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v4alpha.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... }public StructMatcher.Builder setPath(int index, StructMatcher.PathSegment.Builder builderForValue)
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v4alpha.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... }public StructMatcher.Builder addPath(StructMatcher.PathSegment value)
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v4alpha.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... }public StructMatcher.Builder addPath(int index, StructMatcher.PathSegment value)
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v4alpha.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... }public StructMatcher.Builder addPath(StructMatcher.PathSegment.Builder builderForValue)
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v4alpha.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... }public StructMatcher.Builder addPath(int index, StructMatcher.PathSegment.Builder builderForValue)
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v4alpha.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... }public StructMatcher.Builder addAllPath(Iterable<? extends StructMatcher.PathSegment> values)
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v4alpha.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... }public StructMatcher.Builder clearPath()
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v4alpha.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... }public StructMatcher.Builder removePath(int index)
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v4alpha.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... }public StructMatcher.PathSegment.Builder getPathBuilder(int index)
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v4alpha.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... }public StructMatcher.PathSegmentOrBuilder getPathOrBuilder(int index)
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v4alpha.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... }getPathOrBuilder in interface StructMatcherOrBuilderpublic List<? extends StructMatcher.PathSegmentOrBuilder> getPathOrBuilderList()
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v4alpha.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... }getPathOrBuilderList in interface StructMatcherOrBuilderpublic StructMatcher.PathSegment.Builder addPathBuilder()
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v4alpha.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... }public StructMatcher.PathSegment.Builder addPathBuilder(int index)
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v4alpha.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... }public List<StructMatcher.PathSegment.Builder> getPathBuilderList()
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v4alpha.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... }public boolean hasValue()
The StructMatcher is matched if the value retrieved by path is matched to this value.
.envoy.type.matcher.v4alpha.ValueMatcher value = 3 [(.validate.rules) = { ... }hasValue in interface StructMatcherOrBuilderpublic ValueMatcher getValue()
The StructMatcher is matched if the value retrieved by path is matched to this value.
.envoy.type.matcher.v4alpha.ValueMatcher value = 3 [(.validate.rules) = { ... }getValue in interface StructMatcherOrBuilderpublic StructMatcher.Builder setValue(ValueMatcher value)
The StructMatcher is matched if the value retrieved by path is matched to this value.
.envoy.type.matcher.v4alpha.ValueMatcher value = 3 [(.validate.rules) = { ... }public StructMatcher.Builder setValue(ValueMatcher.Builder builderForValue)
The StructMatcher is matched if the value retrieved by path is matched to this value.
.envoy.type.matcher.v4alpha.ValueMatcher value = 3 [(.validate.rules) = { ... }public StructMatcher.Builder mergeValue(ValueMatcher value)
The StructMatcher is matched if the value retrieved by path is matched to this value.
.envoy.type.matcher.v4alpha.ValueMatcher value = 3 [(.validate.rules) = { ... }public StructMatcher.Builder clearValue()
The StructMatcher is matched if the value retrieved by path is matched to this value.
.envoy.type.matcher.v4alpha.ValueMatcher value = 3 [(.validate.rules) = { ... }public ValueMatcher.Builder getValueBuilder()
The StructMatcher is matched if the value retrieved by path is matched to this value.
.envoy.type.matcher.v4alpha.ValueMatcher value = 3 [(.validate.rules) = { ... }public ValueMatcherOrBuilder getValueOrBuilder()
The StructMatcher is matched if the value retrieved by path is matched to this value.
.envoy.type.matcher.v4alpha.ValueMatcher value = 3 [(.validate.rules) = { ... }getValueOrBuilder in interface StructMatcherOrBuilderpublic final StructMatcher.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
setUnknownFields in interface com.google.protobuf.Message.BuildersetUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<StructMatcher.Builder>public final StructMatcher.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
mergeUnknownFields in interface com.google.protobuf.Message.BuildermergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<StructMatcher.Builder>Copyright © 2018–2021 The Envoy Project. All rights reserved.