Class 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 type envoy.type.matcher.v3.StructMatcher
    • Method Detail

      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<StructMatcher.Builder>
      • clear

        public StructMatcher.Builder clear()
        Specified by:
        clear in interface com.google.protobuf.Message.Builder
        Specified by:
        clear in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clear in class com.google.protobuf.GeneratedMessageV3.Builder<StructMatcher.Builder>
      • getDescriptorForType

        public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
        Specified by:
        getDescriptorForType in interface com.google.protobuf.Message.Builder
        Specified by:
        getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
        Overrides:
        getDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<StructMatcher.Builder>
      • getDefaultInstanceForType

        public StructMatcher getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
      • build

        public StructMatcher build()
        Specified by:
        build in interface com.google.protobuf.Message.Builder
        Specified by:
        build in interface com.google.protobuf.MessageLite.Builder
      • buildPartial

        public StructMatcher buildPartial()
        Specified by:
        buildPartial in interface com.google.protobuf.Message.Builder
        Specified by:
        buildPartial in interface com.google.protobuf.MessageLite.Builder
      • clone

        public StructMatcher.Builder clone()
        Specified by:
        clone in interface com.google.protobuf.Message.Builder
        Specified by:
        clone in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clone in class com.google.protobuf.GeneratedMessageV3.Builder<StructMatcher.Builder>
      • setField

        public StructMatcher.Builder setField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                              Object value)
        Specified by:
        setField in interface com.google.protobuf.Message.Builder
        Overrides:
        setField in class com.google.protobuf.GeneratedMessageV3.Builder<StructMatcher.Builder>
      • clearField

        public StructMatcher.Builder clearField​(com.google.protobuf.Descriptors.FieldDescriptor field)
        Specified by:
        clearField in interface com.google.protobuf.Message.Builder
        Overrides:
        clearField in class com.google.protobuf.GeneratedMessageV3.Builder<StructMatcher.Builder>
      • clearOneof

        public StructMatcher.Builder clearOneof​(com.google.protobuf.Descriptors.OneofDescriptor oneof)
        Specified by:
        clearOneof in interface com.google.protobuf.Message.Builder
        Overrides:
        clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<StructMatcher.Builder>
      • setRepeatedField

        public StructMatcher.Builder setRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                      int index,
                                                      Object value)
        Specified by:
        setRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<StructMatcher.Builder>
      • addRepeatedField

        public StructMatcher.Builder addRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                      Object value)
        Specified by:
        addRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<StructMatcher.Builder>
      • mergeFrom

        public StructMatcher.Builder mergeFrom​(com.google.protobuf.Message other)
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<StructMatcher.Builder>
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.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:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Specified by:
        mergeFrom in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<StructMatcher.Builder>
        Throws:
        IOException
      • 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 interface StructMatcherOrBuilder
      • 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 interface StructMatcherOrBuilder
      • 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) = { ... }
      • 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) = { ... }
      • 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) = { ... }
      • 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:
        hasValue in interface StructMatcherOrBuilder
        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 interface StructMatcherOrBuilder
        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 interface StructMatcherOrBuilder
      • setUnknownFields

        public final StructMatcher.Builder setUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        setUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<StructMatcher.Builder>
      • mergeUnknownFields

        public final StructMatcher.Builder mergeUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        mergeUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<StructMatcher.Builder>