Class StructMatcher.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<StructMatcher.Builder>
com.google.protobuf.GeneratedMessage.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.GeneratedMessage.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.v3.StructMatcher-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate List<StructMatcher.PathSegment> private com.google.protobuf.RepeatedFieldBuilder<StructMatcher.PathSegment, StructMatcher.PathSegment.Builder, StructMatcher.PathSegmentOrBuilder> private ValueMatcherprivate com.google.protobuf.SingleFieldBuilder<ValueMatcher, ValueMatcher.Builder, ValueMatcherOrBuilder> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAllPath(Iterable<? extends StructMatcher.PathSegment> values) The path to retrieve the Value from the Struct.addPath(int index, StructMatcher.PathSegment value) The path to retrieve the Value from the Struct.addPath(int index, StructMatcher.PathSegment.Builder builderForValue) The path to retrieve the Value from the Struct.addPath(StructMatcher.PathSegment value) The path to retrieve the Value from the Struct.addPath(StructMatcher.PathSegment.Builder builderForValue) The path to retrieve the Value from the Struct.The path to retrieve the Value from the Struct.addPathBuilder(int index) The path to retrieve the Value from the Struct.build()private voidbuildPartial0(StructMatcher result) private voidclear()The path to retrieve the Value from the Struct.The StructMatcher is matched if the value retrieved by path is matched to this value.private voidstatic final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.DescriptorgetPath(int index) The path to retrieve the Value from the Struct.getPathBuilder(int index) The path to retrieve the Value from the Struct.The path to retrieve the Value from the Struct.intThe path to retrieve the Value from the Struct.The path to retrieve the Value from the Struct.getPathOrBuilder(int index) The path to retrieve the Value from the Struct.List<? extends StructMatcher.PathSegmentOrBuilder> The path to retrieve the Value from the Struct.getValue()The StructMatcher is matched if the value retrieved by path is matched to this value.The StructMatcher is matched if the value retrieved by path is matched to this value.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.GeneratedMessage.FieldAccessorTableprivate com.google.protobuf.RepeatedFieldBuilder<StructMatcher.PathSegment, StructMatcher.PathSegment.Builder, StructMatcher.PathSegmentOrBuilder> private com.google.protobuf.SingleFieldBuilder<ValueMatcher, ValueMatcher.Builder, ValueMatcherOrBuilder> The StructMatcher is matched if the value retrieved by path is matched to this value.final booleanprivate voidmergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) mergeFrom(StructMatcher other) mergeValue(ValueMatcher value) The StructMatcher is matched if the value retrieved by path is matched to this value.removePath(int index) The path to retrieve the Value from the Struct.setPath(int index, StructMatcher.PathSegment value) The path to retrieve the Value from the Struct.setPath(int index, StructMatcher.PathSegment.Builder builderForValue) The path to retrieve the Value from the Struct.setValue(ValueMatcher value) The StructMatcher is matched if the value retrieved by path is matched to this value.setValue(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.GeneratedMessage.Builder
addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFromMethods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFromMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Field Details
-
bitField0_
private int bitField0_ -
path_
-
pathBuilder_
private com.google.protobuf.RepeatedFieldBuilder<StructMatcher.PathSegment,StructMatcher.PathSegment.Builder, pathBuilder_StructMatcher.PathSegmentOrBuilder> -
value_
-
valueBuilder_
private com.google.protobuf.SingleFieldBuilder<ValueMatcher,ValueMatcher.Builder, valueBuilder_ValueMatcherOrBuilder>
-
-
Constructor Details
-
Builder
private Builder() -
Builder
private Builder(com.google.protobuf.AbstractMessage.BuilderParent parent)
-
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessage.Builder<StructMatcher.Builder>
-
maybeForceBuilderInitialization
private void maybeForceBuilderInitialization() -
clear
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessage.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.GeneratedMessage.Builder<StructMatcher.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartialRepeatedFields
-
buildPartial0
-
mergeFrom
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<StructMatcher.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessage.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
-
ensurePathIsMutable
private void ensurePathIsMutable() -
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
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
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v3.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... } -
setPath
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v3.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... } -
addPath
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v3.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... } -
addPath
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v3.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... } -
addPath
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v3.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... } -
addPath
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v3.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... } -
addAllPath
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v3.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... } -
clearPath
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v3.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... } -
removePath
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v3.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... } -
getPathBuilder
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v3.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... } -
getPathOrBuilder
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
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
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v3.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... } -
addPathBuilder
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v3.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... } -
getPathBuilderList
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v3.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... } -
internalGetPathFieldBuilder
private com.google.protobuf.RepeatedFieldBuilder<StructMatcher.PathSegment,StructMatcher.PathSegment.Builder, internalGetPathFieldBuilder()StructMatcher.PathSegmentOrBuilder> -
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
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
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
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
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
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
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
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
-
internalGetValueFieldBuilder
private com.google.protobuf.SingleFieldBuilder<ValueMatcher,ValueMatcher.Builder, internalGetValueFieldBuilder()ValueMatcherOrBuilder> The StructMatcher is matched if the value retrieved by path is matched to this value.
.envoy.type.matcher.v3.ValueMatcher value = 3 [(.validate.rules) = { ... }
-