Class StructMatcher
- java.lang.Object
-
- com.google.protobuf.AbstractMessageLite
-
- com.google.protobuf.AbstractMessage
-
- com.google.protobuf.GeneratedMessageV3
-
- io.envoyproxy.envoy.type.matcher.v3.StructMatcher
-
- All Implemented Interfaces:
com.google.protobuf.Message,com.google.protobuf.MessageLite,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,StructMatcherOrBuilder,Serializable
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 typeenvoy.type.matcher.v3.StructMatcher- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStructMatcher.BuilderStructMatcher provides a general interface to check if a given value is matched in google.protobuf.Struct.static classStructMatcher.PathSegmentSpecifies the segment in a path to retrieve value from Struct.static interfaceStructMatcher.PathSegmentOrBuilder-
Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessageV3
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
-
-
Field Summary
Fields Modifier and Type Field Description static intPATH_FIELD_NUMBERstatic intVALUE_FIELD_NUMBER
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)static StructMatchergetDefaultInstance()StructMatchergetDefaultInstanceForType()static com.google.protobuf.Descriptors.DescriptorgetDescriptor()com.google.protobuf.Parser<StructMatcher>getParserForType()StructMatcher.PathSegmentgetPath(int index)The path to retrieve the Value from the Struct.intgetPathCount()The path to retrieve the Value from the Struct.List<StructMatcher.PathSegment>getPathList()The path to retrieve the Value from the Struct.StructMatcher.PathSegmentOrBuildergetPathOrBuilder(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.intgetSerializedSize()com.google.protobuf.UnknownFieldSetgetUnknownFields()ValueMatchergetValue()The StructMatcher is matched if the value retrieved by path is matched to this value.ValueMatcherOrBuildergetValueOrBuilder()The StructMatcher is matched if the value retrieved by path is matched to this value.inthashCode()booleanhasValue()The StructMatcher is matched if the value retrieved by path is matched to this value.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()booleanisInitialized()static StructMatcher.BuildernewBuilder()static StructMatcher.BuildernewBuilder(StructMatcher prototype)StructMatcher.BuildernewBuilderForType()protected StructMatcher.BuildernewBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)protected ObjectnewInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)static StructMatcherparseDelimitedFrom(InputStream input)static StructMatcherparseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static StructMatcherparseFrom(byte[] data)static StructMatcherparseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static StructMatcherparseFrom(com.google.protobuf.ByteString data)static StructMatcherparseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static StructMatcherparseFrom(com.google.protobuf.CodedInputStream input)static StructMatcherparseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static StructMatcherparseFrom(InputStream input)static StructMatcherparseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static StructMatcherparseFrom(ByteBuffer data)static StructMatcherparseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static com.google.protobuf.Parser<StructMatcher>parser()StructMatcher.BuildertoBuilder()voidwriteTo(com.google.protobuf.CodedOutputStream output)-
Methods inherited from class com.google.protobuf.GeneratedMessageV3
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, internalGetMapField, isStringEmpty, 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, writeStringNoTag
-
Methods inherited from class com.google.protobuf.AbstractMessage
findInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toString
-
Methods inherited from class com.google.protobuf.AbstractMessageLite
addAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Field Detail
-
PATH_FIELD_NUMBER
public static final int PATH_FIELD_NUMBER
- See Also:
- Constant Field Values
-
VALUE_FIELD_NUMBER
public static final int VALUE_FIELD_NUMBER
- See Also:
- Constant Field Values
-
-
Method Detail
-
newInstance
protected Object newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
- Overrides:
newInstancein classcom.google.protobuf.GeneratedMessageV3
-
getUnknownFields
public final com.google.protobuf.UnknownFieldSet getUnknownFields()
- Specified by:
getUnknownFieldsin interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
-
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessageV3
-
getPathList
public List<StructMatcher.PathSegment> getPathList()
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v3.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... }- Specified by:
getPathListin interfaceStructMatcherOrBuilder
-
getPathOrBuilderList
public List<? extends StructMatcher.PathSegmentOrBuilder> getPathOrBuilderList()
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v3.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... }- Specified by:
getPathOrBuilderListin interfaceStructMatcherOrBuilder
-
getPathCount
public int getPathCount()
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v3.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... }- Specified by:
getPathCountin interfaceStructMatcherOrBuilder
-
getPath
public StructMatcher.PathSegment getPath(int index)
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v3.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... }- Specified by:
getPathin interfaceStructMatcherOrBuilder
-
getPathOrBuilder
public StructMatcher.PathSegmentOrBuilder getPathOrBuilder(int index)
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v3.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... }- Specified by:
getPathOrBuilderin interfaceStructMatcherOrBuilder
-
hasValue
public boolean hasValue()
The StructMatcher is matched if the value retrieved by path is matched to this value.
.envoy.type.matcher.v3.ValueMatcher value = 3 [(.validate.rules) = { ... }- Specified by:
hasValuein interfaceStructMatcherOrBuilder- Returns:
- Whether the value field is set.
-
getValue
public ValueMatcher getValue()
The StructMatcher is matched if the value retrieved by path is matched to this value.
.envoy.type.matcher.v3.ValueMatcher value = 3 [(.validate.rules) = { ... }- Specified by:
getValuein interfaceStructMatcherOrBuilder- Returns:
- The value.
-
getValueOrBuilder
public ValueMatcherOrBuilder getValueOrBuilder()
The StructMatcher is matched if the value retrieved by path is matched to this value.
.envoy.type.matcher.v3.ValueMatcher value = 3 [(.validate.rules) = { ... }- Specified by:
getValueOrBuilderin interfaceStructMatcherOrBuilder
-
isInitialized
public final boolean isInitialized()
- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessageV3
-
writeTo
public void writeTo(com.google.protobuf.CodedOutputStream output) throws IOException- Specified by:
writeToin interfacecom.google.protobuf.MessageLite- Overrides:
writeToin classcom.google.protobuf.GeneratedMessageV3- Throws:
IOException
-
getSerializedSize
public int getSerializedSize()
- Specified by:
getSerializedSizein interfacecom.google.protobuf.MessageLite- Overrides:
getSerializedSizein classcom.google.protobuf.GeneratedMessageV3
-
equals
public boolean equals(Object obj)
- Specified by:
equalsin interfacecom.google.protobuf.Message- Overrides:
equalsin classcom.google.protobuf.AbstractMessage
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfacecom.google.protobuf.Message- Overrides:
hashCodein classcom.google.protobuf.AbstractMessage
-
parseFrom
public static StructMatcher parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static StructMatcher parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static StructMatcher parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static StructMatcher parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static StructMatcher parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static StructMatcher parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static StructMatcher parseFrom(InputStream input) throws IOException
- Throws:
IOException
-
parseFrom
public static StructMatcher parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
- Throws:
IOException
-
parseDelimitedFrom
public static StructMatcher parseDelimitedFrom(InputStream input) throws IOException
- Throws:
IOException
-
parseDelimitedFrom
public static StructMatcher parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
- Throws:
IOException
-
parseFrom
public static StructMatcher parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
- Throws:
IOException
-
parseFrom
public static StructMatcher parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
- Throws:
IOException
-
newBuilderForType
public StructMatcher.Builder newBuilderForType()
- Specified by:
newBuilderForTypein interfacecom.google.protobuf.Message- Specified by:
newBuilderForTypein interfacecom.google.protobuf.MessageLite
-
newBuilder
public static StructMatcher.Builder newBuilder()
-
newBuilder
public static StructMatcher.Builder newBuilder(StructMatcher prototype)
-
toBuilder
public StructMatcher.Builder toBuilder()
- Specified by:
toBuilderin interfacecom.google.protobuf.Message- Specified by:
toBuilderin interfacecom.google.protobuf.MessageLite
-
newBuilderForType
protected StructMatcher.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
- Specified by:
newBuilderForTypein classcom.google.protobuf.GeneratedMessageV3
-
getDefaultInstance
public static StructMatcher getDefaultInstance()
-
parser
public static com.google.protobuf.Parser<StructMatcher> parser()
-
getParserForType
public com.google.protobuf.Parser<StructMatcher> getParserForType()
- Specified by:
getParserForTypein interfacecom.google.protobuf.Message- Specified by:
getParserForTypein interfacecom.google.protobuf.MessageLite- Overrides:
getParserForTypein classcom.google.protobuf.GeneratedMessageV3
-
getDefaultInstanceForType
public StructMatcher getDefaultInstanceForType()
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
-