Class StructMatcher.Builder
- java.lang.Object
-
- com.google.protobuf.AbstractMessageLite.Builder
-
- com.google.protobuf.AbstractMessage.Builder<BuilderT>
-
- 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
,java.lang.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 typeenvoy.type.matcher.v3.StructMatcher
-
-
Field Summary
Fields Modifier and Type Field Description private int
bitField0_
private java.util.List<StructMatcher.PathSegment>
path_
private com.google.protobuf.RepeatedFieldBuilder<StructMatcher.PathSegment,StructMatcher.PathSegment.Builder,StructMatcher.PathSegmentOrBuilder>
pathBuilder_
private ValueMatcher
value_
private com.google.protobuf.SingleFieldBuilder<ValueMatcher,ValueMatcher.Builder,ValueMatcherOrBuilder>
valueBuilder_
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StructMatcher.Builder
addAllPath(java.lang.Iterable<? extends StructMatcher.PathSegment> values)
The path to retrieve the Value from the Struct.StructMatcher.Builder
addPath(int index, StructMatcher.PathSegment value)
The path to retrieve the Value from the Struct.StructMatcher.Builder
addPath(int index, StructMatcher.PathSegment.Builder builderForValue)
The path to retrieve the Value from the Struct.StructMatcher.Builder
addPath(StructMatcher.PathSegment value)
The path to retrieve the Value from the Struct.StructMatcher.Builder
addPath(StructMatcher.PathSegment.Builder builderForValue)
The path to retrieve the Value from the Struct.StructMatcher.PathSegment.Builder
addPathBuilder()
The path to retrieve the Value from the Struct.StructMatcher.PathSegment.Builder
addPathBuilder(int index)
The path to retrieve the Value from the Struct.StructMatcher
build()
StructMatcher
buildPartial()
private void
buildPartial0(StructMatcher result)
private void
buildPartialRepeatedFields(StructMatcher result)
StructMatcher.Builder
clear()
StructMatcher.Builder
clearPath()
The path to retrieve the Value from the Struct.StructMatcher.Builder
clearValue()
The StructMatcher is matched if the value retrieved by path is matched to this value.private void
ensurePathIsMutable()
StructMatcher
getDefaultInstanceForType()
static com.google.protobuf.Descriptors.Descriptor
getDescriptor()
com.google.protobuf.Descriptors.Descriptor
getDescriptorForType()
StructMatcher.PathSegment
getPath(int index)
The path to retrieve the Value from the Struct.StructMatcher.PathSegment.Builder
getPathBuilder(int index)
The path to retrieve the Value from the Struct.java.util.List<StructMatcher.PathSegment.Builder>
getPathBuilderList()
The path to retrieve the Value from the Struct.int
getPathCount()
The path to retrieve the Value from the Struct.private com.google.protobuf.RepeatedFieldBuilder<StructMatcher.PathSegment,StructMatcher.PathSegment.Builder,StructMatcher.PathSegmentOrBuilder>
getPathFieldBuilder()
java.util.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.java.util.List<? extends StructMatcher.PathSegmentOrBuilder>
getPathOrBuilderList()
The path to retrieve the Value from the Struct.ValueMatcher
getValue()
The StructMatcher is matched if the value retrieved by path is matched to this value.ValueMatcher.Builder
getValueBuilder()
The StructMatcher is matched if the value retrieved by path is matched to this value.private com.google.protobuf.SingleFieldBuilder<ValueMatcher,ValueMatcher.Builder,ValueMatcherOrBuilder>
getValueFieldBuilder()
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.boolean
hasValue()
The StructMatcher is matched if the value retrieved by path is matched to this value.protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable()
boolean
isInitialized()
private void
maybeForceBuilderInitialization()
StructMatcher.Builder
mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
StructMatcher.Builder
mergeFrom(com.google.protobuf.Message other)
StructMatcher.Builder
mergeFrom(StructMatcher other)
StructMatcher.Builder
mergeValue(ValueMatcher value)
The StructMatcher is matched if the value retrieved by path is matched to this value.StructMatcher.Builder
removePath(int index)
The path to retrieve the Value from the Struct.StructMatcher.Builder
setPath(int index, StructMatcher.PathSegment value)
The path to retrieve the Value from the Struct.StructMatcher.Builder
setPath(int index, StructMatcher.PathSegment.Builder builderForValue)
The path to retrieve the Value from the Struct.StructMatcher.Builder
setValue(ValueMatcher value)
The StructMatcher is matched if the value retrieved by path is matched to this value.StructMatcher.Builder
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
-
-
-
-
Field Detail
-
bitField0_
private int bitField0_
-
path_
private java.util.List<StructMatcher.PathSegment> path_
-
pathBuilder_
private com.google.protobuf.RepeatedFieldBuilder<StructMatcher.PathSegment,StructMatcher.PathSegment.Builder,StructMatcher.PathSegmentOrBuilder> pathBuilder_
-
value_
private ValueMatcher value_
-
valueBuilder_
private com.google.protobuf.SingleFieldBuilder<ValueMatcher,ValueMatcher.Builder,ValueMatcherOrBuilder> valueBuilder_
-
-
Method Detail
-
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
public StructMatcher.Builder 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
public StructMatcher getDefaultInstanceForType()
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageOrBuilder
-
build
public StructMatcher build()
- Specified by:
build
in interfacecom.google.protobuf.Message.Builder
- Specified by:
build
in interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
public StructMatcher buildPartial()
- Specified by:
buildPartial
in interfacecom.google.protobuf.Message.Builder
- Specified by:
buildPartial
in interfacecom.google.protobuf.MessageLite.Builder
-
buildPartialRepeatedFields
private void buildPartialRepeatedFields(StructMatcher result)
-
buildPartial0
private void buildPartial0(StructMatcher result)
-
mergeFrom
public StructMatcher.Builder mergeFrom(com.google.protobuf.Message other)
- Specified by:
mergeFrom
in interfacecom.google.protobuf.Message.Builder
- Overrides:
mergeFrom
in classcom.google.protobuf.AbstractMessage.Builder<StructMatcher.Builder>
-
mergeFrom
public StructMatcher.Builder mergeFrom(StructMatcher other)
-
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 java.io.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:
java.io.IOException
-
ensurePathIsMutable
private void ensurePathIsMutable()
-
getPathList
public java.util.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:
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
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:
getPath
in 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(java.lang.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:
getPathOrBuilder
in interfaceStructMatcherOrBuilder
-
getPathOrBuilderList
public java.util.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:
getPathOrBuilderList
in 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 java.util.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) = { ... }
-
getPathFieldBuilder
private com.google.protobuf.RepeatedFieldBuilder<StructMatcher.PathSegment,StructMatcher.PathSegment.Builder,StructMatcher.PathSegmentOrBuilder> getPathFieldBuilder()
-
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
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:
getValue
in 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:
getValueOrBuilder
in interfaceStructMatcherOrBuilder
-
getValueFieldBuilder
private com.google.protobuf.SingleFieldBuilder<ValueMatcher,ValueMatcher.Builder,ValueMatcherOrBuilder> getValueFieldBuilder()
The StructMatcher is matched if the value retrieved by path is matched to this value.
.envoy.type.matcher.v3.ValueMatcher value = 3 [(.validate.rules) = { ... }
-
-