public final class StructMatcher extends com.google.protobuf.GeneratedMessageV3 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.StructMatcher| Modifier and Type | Class and Description |
|---|---|
static class |
StructMatcher.Builder
StructMatcher provides a general interface to check if a given value is matched in
google.protobuf.Struct.
|
static class |
StructMatcher.PathSegment
Specifies the segment in a path to retrieve value from Struct.
|
static interface |
StructMatcher.PathSegmentOrBuilder |
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage,BuilderType extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType,BuilderType>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter| Modifier and Type | Field and Description |
|---|---|
static int |
PATH_FIELD_NUMBER |
static int |
VALUE_FIELD_NUMBER |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
static StructMatcher |
getDefaultInstance() |
StructMatcher |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
com.google.protobuf.Parser<StructMatcher> |
getParserForType() |
StructMatcher.PathSegment |
getPath(int index)
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.
|
int |
getSerializedSize() |
com.google.protobuf.UnknownFieldSet |
getUnknownFields() |
ValueMatcher |
getValue()
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.
|
int |
hashCode() |
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() |
static StructMatcher.Builder |
newBuilder() |
static StructMatcher.Builder |
newBuilder(StructMatcher prototype) |
StructMatcher.Builder |
newBuilderForType() |
protected StructMatcher.Builder |
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) |
protected Object |
newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused) |
static StructMatcher |
parseDelimitedFrom(InputStream input) |
static StructMatcher |
parseDelimitedFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static StructMatcher |
parseFrom(byte[] data) |
static StructMatcher |
parseFrom(byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static StructMatcher |
parseFrom(ByteBuffer data) |
static StructMatcher |
parseFrom(ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static StructMatcher |
parseFrom(com.google.protobuf.ByteString data) |
static StructMatcher |
parseFrom(com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static StructMatcher |
parseFrom(com.google.protobuf.CodedInputStream input) |
static StructMatcher |
parseFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static StructMatcher |
parseFrom(InputStream input) |
static StructMatcher |
parseFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static com.google.protobuf.Parser<StructMatcher> |
parser() |
StructMatcher.Builder |
toBuilder() |
void |
writeTo(com.google.protobuf.CodedOutputStream output) |
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, internalGetMapField, makeExtensionsImmutable, mergeFromAndMakeImmutableInternal, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagfindInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toStringaddAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic static final int PATH_FIELD_NUMBER
public static final int VALUE_FIELD_NUMBER
protected Object newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
newInstance in class com.google.protobuf.GeneratedMessageV3public final com.google.protobuf.UnknownFieldSet getUnknownFields()
getUnknownFields in interface com.google.protobuf.MessageOrBuildergetUnknownFields in class com.google.protobuf.GeneratedMessageV3public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3public List<StructMatcher.PathSegment> getPathList()
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... }getPathList in interface StructMatcherOrBuilderpublic List<? extends StructMatcher.PathSegmentOrBuilder> getPathOrBuilderList()
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... }getPathOrBuilderList in interface StructMatcherOrBuilderpublic int getPathCount()
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.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.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... }getPath in interface StructMatcherOrBuilderpublic StructMatcher.PathSegmentOrBuilder getPathOrBuilder(int index)
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... }getPathOrBuilder in interface StructMatcherOrBuilderpublic boolean hasValue()
The StructMatcher is matched if the value retrieved by path is matched to this value.
.envoy.type.matcher.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.ValueMatcher value = 3 [(.validate.rules) = { ... }getValue in interface StructMatcherOrBuilderpublic ValueMatcherOrBuilder getValueOrBuilder()
The StructMatcher is matched if the value retrieved by path is matched to this value.
.envoy.type.matcher.ValueMatcher value = 3 [(.validate.rules) = { ... }getValueOrBuilder in interface StructMatcherOrBuilderpublic final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessageV3public void writeTo(com.google.protobuf.CodedOutputStream output)
throws IOException
writeTo in interface com.google.protobuf.MessageLitewriteTo in class com.google.protobuf.GeneratedMessageV3IOExceptionpublic int getSerializedSize()
getSerializedSize in interface com.google.protobuf.MessageLitegetSerializedSize in class com.google.protobuf.GeneratedMessageV3public boolean equals(Object obj)
equals in interface com.google.protobuf.Messageequals in class com.google.protobuf.AbstractMessagepublic int hashCode()
hashCode in interface com.google.protobuf.MessagehashCode in class com.google.protobuf.AbstractMessagepublic static StructMatcher parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static StructMatcher parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static StructMatcher parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static StructMatcher parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static StructMatcher parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static StructMatcher parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static StructMatcher parseFrom(InputStream input) throws IOException
IOExceptionpublic static StructMatcher parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static StructMatcher parseDelimitedFrom(InputStream input) throws IOException
IOExceptionpublic static StructMatcher parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static StructMatcher parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
IOExceptionpublic static StructMatcher parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic StructMatcher.Builder newBuilderForType()
newBuilderForType in interface com.google.protobuf.MessagenewBuilderForType in interface com.google.protobuf.MessageLitepublic static StructMatcher.Builder newBuilder()
public static StructMatcher.Builder newBuilder(StructMatcher prototype)
public StructMatcher.Builder toBuilder()
toBuilder in interface com.google.protobuf.MessagetoBuilder in interface com.google.protobuf.MessageLiteprotected StructMatcher.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
newBuilderForType in class com.google.protobuf.GeneratedMessageV3public static StructMatcher getDefaultInstance()
public static com.google.protobuf.Parser<StructMatcher> parser()
public com.google.protobuf.Parser<StructMatcher> getParserForType()
getParserForType in interface com.google.protobuf.MessagegetParserForType in interface com.google.protobuf.MessageLitegetParserForType in class com.google.protobuf.GeneratedMessageV3public StructMatcher getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderCopyright © 2018–2021 The Envoy Project. All rights reserved.