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 int
private List
<StructMatcher.PathSegment> private com.google.protobuf.RepeatedFieldBuilder
<StructMatcher.PathSegment, StructMatcher.PathSegment.Builder, StructMatcher.PathSegmentOrBuilder> private ValueMatcher
private 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 void
buildPartial0
(StructMatcher result) private void
clear()
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 void
static final com.google.protobuf.Descriptors.Descriptor
com.google.protobuf.Descriptors.Descriptor
getPath
(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.int
The path to retrieve the Value from the Struct.private com.google.protobuf.RepeatedFieldBuilder
<StructMatcher.PathSegment, StructMatcher.PathSegment.Builder, StructMatcher.PathSegmentOrBuilder> 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.private com.google.protobuf.SingleFieldBuilder
<ValueMatcher, ValueMatcher.Builder, ValueMatcherOrBuilder> 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.boolean
hasValue()
The StructMatcher is matched if the value retrieved by path is matched to this value.protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
final boolean
private void
mergeFrom
(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, 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
Methods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFrom
Methods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFrom
Methods 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:
internalGetFieldAccessorTable
in classcom.google.protobuf.GeneratedMessage.Builder<StructMatcher.Builder>
-
maybeForceBuilderInitialization
private void maybeForceBuilderInitialization() -
clear
- Specified by:
clear
in interfacecom.google.protobuf.Message.Builder
- Specified by:
clear
in interfacecom.google.protobuf.MessageLite.Builder
- Overrides:
clear
in classcom.google.protobuf.GeneratedMessage.Builder<StructMatcher.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()- Specified by:
getDescriptorForType
in interfacecom.google.protobuf.Message.Builder
- Specified by:
getDescriptorForType
in interfacecom.google.protobuf.MessageOrBuilder
- Overrides:
getDescriptorForType
in classcom.google.protobuf.GeneratedMessage.Builder<StructMatcher.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
build
in interfacecom.google.protobuf.Message.Builder
- Specified by:
build
in interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartial
in interfacecom.google.protobuf.Message.Builder
- Specified by:
buildPartial
in interfacecom.google.protobuf.MessageLite.Builder
-
buildPartialRepeatedFields
-
buildPartial0
-
mergeFrom
- Specified by:
mergeFrom
in interfacecom.google.protobuf.Message.Builder
- Overrides:
mergeFrom
in classcom.google.protobuf.AbstractMessage.Builder<StructMatcher.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitialized
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Overrides:
isInitialized
in 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:
mergeFrom
in interfacecom.google.protobuf.Message.Builder
- Specified by:
mergeFrom
in interfacecom.google.protobuf.MessageLite.Builder
- Overrides:
mergeFrom
in 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:
getPathList
in 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:
getPathCount
in interfaceStructMatcherOrBuilder
-
getPath
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v3.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... }
- Specified by:
getPath
in 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:
getPathOrBuilder
in interfaceStructMatcherOrBuilder
-
getPathOrBuilderList
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.v3.StructMatcher.PathSegment path = 2 [(.validate.rules) = { ... }
- Specified by:
getPathOrBuilderList
in 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) = { ... }
-
getPathFieldBuilder
private com.google.protobuf.RepeatedFieldBuilder<StructMatcher.PathSegment,StructMatcher.PathSegment.Builder, getPathFieldBuilder()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:
hasValue
in 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:
getValue
in 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:
getValueOrBuilder
in interfaceStructMatcherOrBuilder
-
getValueFieldBuilder
private com.google.protobuf.SingleFieldBuilder<ValueMatcher,ValueMatcher.Builder, getValueFieldBuilder()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) = { ... }
-