Class StructMatcher.Builder
- java.lang.Object
-
- com.google.protobuf.AbstractMessageLite.Builder
-
- com.google.protobuf.AbstractMessage.Builder<BuilderType>
-
- com.google.protobuf.GeneratedMessageV3.Builder<StructMatcher.Builder>
-
- io.envoyproxy.envoy.type.matcher.v3.StructMatcher.Builder
-
- All Implemented Interfaces:
com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,StructMatcherOrBuilder,Cloneable
- Enclosing class:
- StructMatcher
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 typeenvoy.type.matcher.v3.StructMatcher
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StructMatcher.BuilderaddAllPath(Iterable<? extends StructMatcher.PathSegment> values)The path to retrieve the Value from the Struct.StructMatcher.BuilderaddPath(int index, StructMatcher.PathSegment value)The path to retrieve the Value from the Struct.StructMatcher.BuilderaddPath(int index, StructMatcher.PathSegment.Builder builderForValue)The path to retrieve the Value from the Struct.StructMatcher.BuilderaddPath(StructMatcher.PathSegment value)The path to retrieve the Value from the Struct.StructMatcher.BuilderaddPath(StructMatcher.PathSegment.Builder builderForValue)The path to retrieve the Value from the Struct.StructMatcher.PathSegment.BuilderaddPathBuilder()The path to retrieve the Value from the Struct.StructMatcher.PathSegment.BuilderaddPathBuilder(int index)The path to retrieve the Value from the Struct.StructMatcher.BuilderaddRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)StructMatcherbuild()StructMatcherbuildPartial()StructMatcher.Builderclear()StructMatcher.BuilderclearField(com.google.protobuf.Descriptors.FieldDescriptor field)StructMatcher.BuilderclearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)StructMatcher.BuilderclearPath()The path to retrieve the Value from the Struct.StructMatcher.BuilderclearValue()The StructMatcher is matched if the value retrieved by path is matched to this value.StructMatcher.Builderclone()StructMatchergetDefaultInstanceForType()static com.google.protobuf.Descriptors.DescriptorgetDescriptor()com.google.protobuf.Descriptors.DescriptorgetDescriptorForType()StructMatcher.PathSegmentgetPath(int index)The path to retrieve the Value from the Struct.StructMatcher.PathSegment.BuildergetPathBuilder(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.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.ValueMatchergetValue()The StructMatcher is matched if the value retrieved by path is matched to this value.ValueMatcher.BuildergetValueBuilder()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.booleanhasValue()The StructMatcher is matched if the value retrieved by path is matched to this value.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()booleanisInitialized()StructMatcher.BuildermergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)StructMatcher.BuildermergeFrom(com.google.protobuf.Message other)StructMatcher.BuildermergeFrom(StructMatcher other)StructMatcher.BuildermergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)StructMatcher.BuildermergeValue(ValueMatcher value)The StructMatcher is matched if the value retrieved by path is matched to this value.StructMatcher.BuilderremovePath(int index)The path to retrieve the Value from the Struct.StructMatcher.BuildersetField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)StructMatcher.BuildersetPath(int index, StructMatcher.PathSegment value)The path to retrieve the Value from the Struct.StructMatcher.BuildersetPath(int index, StructMatcher.PathSegment.Builder builderForValue)The path to retrieve the Value from the Struct.StructMatcher.BuildersetRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)StructMatcher.BuildersetUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)StructMatcher.BuildersetValue(ValueMatcher value)The StructMatcher is matched if the value retrieved by path is matched to this value.StructMatcher.BuildersetValue(ValueMatcher.Builder builderForValue)The StructMatcher is matched if the value retrieved by path is matched to this value.-
Methods inherited from class com.google.protobuf.GeneratedMessageV3.Builder
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMutableMapField, isClean, markClean, newBuilderForField, onBuilt, onChanged, setUnknownFieldsProto3
-
Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString
-
Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageException
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Method Detail
-
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.Builder<StructMatcher.Builder>
-
clear
public StructMatcher.Builder clear()
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessageV3.Builder<StructMatcher.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.Message.Builder- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getDescriptorForTypein classcom.google.protobuf.GeneratedMessageV3.Builder<StructMatcher.Builder>
-
getDefaultInstanceForType
public StructMatcher getDefaultInstanceForType()
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
public StructMatcher build()
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
public StructMatcher buildPartial()
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
clone
public StructMatcher.Builder clone()
- Specified by:
clonein interfacecom.google.protobuf.Message.Builder- Specified by:
clonein interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clonein classcom.google.protobuf.GeneratedMessageV3.Builder<StructMatcher.Builder>
-
setField
public StructMatcher.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
- Specified by:
setFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<StructMatcher.Builder>
-
clearField
public StructMatcher.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
- Specified by:
clearFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
clearFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<StructMatcher.Builder>
-
clearOneof
public StructMatcher.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
- Specified by:
clearOneofin interfacecom.google.protobuf.Message.Builder- Overrides:
clearOneofin classcom.google.protobuf.GeneratedMessageV3.Builder<StructMatcher.Builder>
-
setRepeatedField
public StructMatcher.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
- Specified by:
setRepeatedFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setRepeatedFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<StructMatcher.Builder>
-
addRepeatedField
public StructMatcher.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
- Specified by:
addRepeatedFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
addRepeatedFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<StructMatcher.Builder>
-
mergeFrom
public StructMatcher.Builder mergeFrom(com.google.protobuf.Message other)
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<StructMatcher.Builder>
-
mergeFrom
public StructMatcher.Builder mergeFrom(StructMatcher other)
-
isInitialized
public final boolean isInitialized()
- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessageV3.Builder<StructMatcher.Builder>
-
mergeFrom
public StructMatcher.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<StructMatcher.Builder>- Throws:
IOException
-
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
-
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
-
setPath
public StructMatcher.Builder setPath(int index, StructMatcher.PathSegment value)
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v3.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... }
-
setPath
public StructMatcher.Builder setPath(int index, StructMatcher.PathSegment.Builder builderForValue)
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v3.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... }
-
addPath
public StructMatcher.Builder addPath(StructMatcher.PathSegment value)
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v3.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... }
-
addPath
public StructMatcher.Builder addPath(int index, StructMatcher.PathSegment value)
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v3.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... }
-
addPath
public StructMatcher.Builder addPath(StructMatcher.PathSegment.Builder builderForValue)
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v3.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... }
-
addPath
public StructMatcher.Builder addPath(int index, StructMatcher.PathSegment.Builder builderForValue)
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v3.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... }
-
addAllPath
public StructMatcher.Builder addAllPath(Iterable<? extends StructMatcher.PathSegment> values)
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v3.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... }
-
clearPath
public StructMatcher.Builder clearPath()
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v3.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... }
-
removePath
public StructMatcher.Builder removePath(int index)
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v3.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... }
-
getPathBuilder
public StructMatcher.PathSegment.Builder getPathBuilder(int index)
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v3.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... }
-
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
-
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
-
addPathBuilder
public StructMatcher.PathSegment.Builder addPathBuilder()
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v3.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... }
-
addPathBuilder
public StructMatcher.PathSegment.Builder addPathBuilder(int index)
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v3.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... }
-
getPathBuilderList
public List<StructMatcher.PathSegment.Builder> getPathBuilderList()
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v3.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... }
-
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.
-
setValue
public StructMatcher.Builder setValue(ValueMatcher value)
The StructMatcher is matched if the value retrieved by path is matched to this value.
.envoy.type.matcher.v3.ValueMatcher value = 3 [(.validate.rules) = { ... }
-
setValue
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.v3.ValueMatcher value = 3 [(.validate.rules) = { ... }
-
mergeValue
public StructMatcher.Builder mergeValue(ValueMatcher value)
The StructMatcher is matched if the value retrieved by path is matched to this value.
.envoy.type.matcher.v3.ValueMatcher value = 3 [(.validate.rules) = { ... }
-
clearValue
public StructMatcher.Builder clearValue()
The StructMatcher is matched if the value retrieved by path is matched to this value.
.envoy.type.matcher.v3.ValueMatcher value = 3 [(.validate.rules) = { ... }
-
getValueBuilder
public ValueMatcher.Builder getValueBuilder()
The StructMatcher is matched if the value retrieved by path is matched to this value.
.envoy.type.matcher.v3.ValueMatcher value = 3 [(.validate.rules) = { ... }
-
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
-
setUnknownFields
public final StructMatcher.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
- Specified by:
setUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
setUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<StructMatcher.Builder>
-
mergeUnknownFields
public final StructMatcher.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
- Specified by:
mergeUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<StructMatcher.Builder>
-
-