Class MetadataKey.Builder

  • All Implemented Interfaces:
    com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, MetadataKeyOrBuilder, Cloneable
    Enclosing class:
    MetadataKey

    public static final class MetadataKey.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<MetadataKey.Builder>
    implements MetadataKeyOrBuilder
     MetadataKey provides a general interface using `key` and `path` to retrieve value from
     :ref:`Metadata <envoy_api_msg_core.Metadata>`.
     For example, for the following Metadata:
     .. code-block:: yaml
        filter_metadata:
          envoy.xxx:
            prop:
              foo: bar
              xyz:
                hello: envoy
     The following MetadataKey will retrieve a string value "bar" from the Metadata.
     .. code-block:: yaml
        key: envoy.xxx
        path:
        - key: prop
        - key: foo
     
    Protobuf type envoy.type.metadata.v2.MetadataKey
    • 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<MetadataKey.Builder>
      • clear

        public MetadataKey.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<MetadataKey.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<MetadataKey.Builder>
      • getDefaultInstanceForType

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

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

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

        public MetadataKey.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<MetadataKey.Builder>
      • setField

        public MetadataKey.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<MetadataKey.Builder>
      • clearField

        public MetadataKey.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<MetadataKey.Builder>
      • clearOneof

        public MetadataKey.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<MetadataKey.Builder>
      • setRepeatedField

        public MetadataKey.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<MetadataKey.Builder>
      • addRepeatedField

        public MetadataKey.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<MetadataKey.Builder>
      • mergeFrom

        public MetadataKey.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<MetadataKey.Builder>
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<MetadataKey.Builder>
      • mergeFrom

        public MetadataKey.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<MetadataKey.Builder>
        Throws:
        IOException
      • getKey

        public String getKey()
         The key name of Metadata to retrieve the Struct from the metadata.
         Typically, it represents a builtin subsystem or custom extension.
         
        string key = 1 [(.validate.rules) = { ... }
        Specified by:
        getKey in interface MetadataKeyOrBuilder
        Returns:
        The key.
      • getKeyBytes

        public com.google.protobuf.ByteString getKeyBytes()
         The key name of Metadata to retrieve the Struct from the metadata.
         Typically, it represents a builtin subsystem or custom extension.
         
        string key = 1 [(.validate.rules) = { ... }
        Specified by:
        getKeyBytes in interface MetadataKeyOrBuilder
        Returns:
        The bytes for key.
      • setKey

        public MetadataKey.Builder setKey​(String value)
         The key name of Metadata to retrieve the Struct from the metadata.
         Typically, it represents a builtin subsystem or custom extension.
         
        string key = 1 [(.validate.rules) = { ... }
        Parameters:
        value - The key to set.
        Returns:
        This builder for chaining.
      • clearKey

        public MetadataKey.Builder clearKey()
         The key name of Metadata to retrieve the Struct from the metadata.
         Typically, it represents a builtin subsystem or custom extension.
         
        string key = 1 [(.validate.rules) = { ... }
        Returns:
        This builder for chaining.
      • setKeyBytes

        public MetadataKey.Builder setKeyBytes​(com.google.protobuf.ByteString value)
         The key name of Metadata to retrieve the Struct from the metadata.
         Typically, it represents a builtin subsystem or custom extension.
         
        string key = 1 [(.validate.rules) = { ... }
        Parameters:
        value - The bytes for key to set.
        Returns:
        This builder for chaining.
      • getPathList

        public List<MetadataKey.PathSegment> getPathList()
         The path to retrieve the Value from the Struct. It can be a prefix or a full path,
         e.g. ``[prop, xyz]`` for a struct or ``[prop, foo]`` for a string in the example,
         which depends on the particular scenario.
         Note: Due to that only the key type segment is supported, the path can not specify a list
         unless the list is the last segment.
         
        repeated .envoy.type.metadata.v2.MetadataKey.PathSegment path = 2 [(.validate.rules) = { ... }
        Specified by:
        getPathList in interface MetadataKeyOrBuilder
      • getPathCount

        public int getPathCount()
         The path to retrieve the Value from the Struct. It can be a prefix or a full path,
         e.g. ``[prop, xyz]`` for a struct or ``[prop, foo]`` for a string in the example,
         which depends on the particular scenario.
         Note: Due to that only the key type segment is supported, the path can not specify a list
         unless the list is the last segment.
         
        repeated .envoy.type.metadata.v2.MetadataKey.PathSegment path = 2 [(.validate.rules) = { ... }
        Specified by:
        getPathCount in interface MetadataKeyOrBuilder
      • getPath

        public MetadataKey.PathSegment getPath​(int index)
         The path to retrieve the Value from the Struct. It can be a prefix or a full path,
         e.g. ``[prop, xyz]`` for a struct or ``[prop, foo]`` for a string in the example,
         which depends on the particular scenario.
         Note: Due to that only the key type segment is supported, the path can not specify a list
         unless the list is the last segment.
         
        repeated .envoy.type.metadata.v2.MetadataKey.PathSegment path = 2 [(.validate.rules) = { ... }
        Specified by:
        getPath in interface MetadataKeyOrBuilder
      • setPath

        public MetadataKey.Builder setPath​(int index,
                                           MetadataKey.PathSegment value)
         The path to retrieve the Value from the Struct. It can be a prefix or a full path,
         e.g. ``[prop, xyz]`` for a struct or ``[prop, foo]`` for a string in the example,
         which depends on the particular scenario.
         Note: Due to that only the key type segment is supported, the path can not specify a list
         unless the list is the last segment.
         
        repeated .envoy.type.metadata.v2.MetadataKey.PathSegment path = 2 [(.validate.rules) = { ... }
      • setPath

        public MetadataKey.Builder setPath​(int index,
                                           MetadataKey.PathSegment.Builder builderForValue)
         The path to retrieve the Value from the Struct. It can be a prefix or a full path,
         e.g. ``[prop, xyz]`` for a struct or ``[prop, foo]`` for a string in the example,
         which depends on the particular scenario.
         Note: Due to that only the key type segment is supported, the path can not specify a list
         unless the list is the last segment.
         
        repeated .envoy.type.metadata.v2.MetadataKey.PathSegment path = 2 [(.validate.rules) = { ... }
      • addPath

        public MetadataKey.Builder addPath​(MetadataKey.PathSegment value)
         The path to retrieve the Value from the Struct. It can be a prefix or a full path,
         e.g. ``[prop, xyz]`` for a struct or ``[prop, foo]`` for a string in the example,
         which depends on the particular scenario.
         Note: Due to that only the key type segment is supported, the path can not specify a list
         unless the list is the last segment.
         
        repeated .envoy.type.metadata.v2.MetadataKey.PathSegment path = 2 [(.validate.rules) = { ... }
      • addPath

        public MetadataKey.Builder addPath​(int index,
                                           MetadataKey.PathSegment value)
         The path to retrieve the Value from the Struct. It can be a prefix or a full path,
         e.g. ``[prop, xyz]`` for a struct or ``[prop, foo]`` for a string in the example,
         which depends on the particular scenario.
         Note: Due to that only the key type segment is supported, the path can not specify a list
         unless the list is the last segment.
         
        repeated .envoy.type.metadata.v2.MetadataKey.PathSegment path = 2 [(.validate.rules) = { ... }
      • addPath

        public MetadataKey.Builder addPath​(MetadataKey.PathSegment.Builder builderForValue)
         The path to retrieve the Value from the Struct. It can be a prefix or a full path,
         e.g. ``[prop, xyz]`` for a struct or ``[prop, foo]`` for a string in the example,
         which depends on the particular scenario.
         Note: Due to that only the key type segment is supported, the path can not specify a list
         unless the list is the last segment.
         
        repeated .envoy.type.metadata.v2.MetadataKey.PathSegment path = 2 [(.validate.rules) = { ... }
      • addPath

        public MetadataKey.Builder addPath​(int index,
                                           MetadataKey.PathSegment.Builder builderForValue)
         The path to retrieve the Value from the Struct. It can be a prefix or a full path,
         e.g. ``[prop, xyz]`` for a struct or ``[prop, foo]`` for a string in the example,
         which depends on the particular scenario.
         Note: Due to that only the key type segment is supported, the path can not specify a list
         unless the list is the last segment.
         
        repeated .envoy.type.metadata.v2.MetadataKey.PathSegment path = 2 [(.validate.rules) = { ... }
      • addAllPath

        public MetadataKey.Builder addAllPath​(Iterable<? extends MetadataKey.PathSegment> values)
         The path to retrieve the Value from the Struct. It can be a prefix or a full path,
         e.g. ``[prop, xyz]`` for a struct or ``[prop, foo]`` for a string in the example,
         which depends on the particular scenario.
         Note: Due to that only the key type segment is supported, the path can not specify a list
         unless the list is the last segment.
         
        repeated .envoy.type.metadata.v2.MetadataKey.PathSegment path = 2 [(.validate.rules) = { ... }
      • clearPath

        public MetadataKey.Builder clearPath()
         The path to retrieve the Value from the Struct. It can be a prefix or a full path,
         e.g. ``[prop, xyz]`` for a struct or ``[prop, foo]`` for a string in the example,
         which depends on the particular scenario.
         Note: Due to that only the key type segment is supported, the path can not specify a list
         unless the list is the last segment.
         
        repeated .envoy.type.metadata.v2.MetadataKey.PathSegment path = 2 [(.validate.rules) = { ... }
      • removePath

        public MetadataKey.Builder removePath​(int index)
         The path to retrieve the Value from the Struct. It can be a prefix or a full path,
         e.g. ``[prop, xyz]`` for a struct or ``[prop, foo]`` for a string in the example,
         which depends on the particular scenario.
         Note: Due to that only the key type segment is supported, the path can not specify a list
         unless the list is the last segment.
         
        repeated .envoy.type.metadata.v2.MetadataKey.PathSegment path = 2 [(.validate.rules) = { ... }
      • getPathBuilder

        public MetadataKey.PathSegment.Builder getPathBuilder​(int index)
         The path to retrieve the Value from the Struct. It can be a prefix or a full path,
         e.g. ``[prop, xyz]`` for a struct or ``[prop, foo]`` for a string in the example,
         which depends on the particular scenario.
         Note: Due to that only the key type segment is supported, the path can not specify a list
         unless the list is the last segment.
         
        repeated .envoy.type.metadata.v2.MetadataKey.PathSegment path = 2 [(.validate.rules) = { ... }
      • getPathOrBuilder

        public MetadataKey.PathSegmentOrBuilder getPathOrBuilder​(int index)
         The path to retrieve the Value from the Struct. It can be a prefix or a full path,
         e.g. ``[prop, xyz]`` for a struct or ``[prop, foo]`` for a string in the example,
         which depends on the particular scenario.
         Note: Due to that only the key type segment is supported, the path can not specify a list
         unless the list is the last segment.
         
        repeated .envoy.type.metadata.v2.MetadataKey.PathSegment path = 2 [(.validate.rules) = { ... }
        Specified by:
        getPathOrBuilder in interface MetadataKeyOrBuilder
      • getPathOrBuilderList

        public List<? extends MetadataKey.PathSegmentOrBuilder> getPathOrBuilderList()
         The path to retrieve the Value from the Struct. It can be a prefix or a full path,
         e.g. ``[prop, xyz]`` for a struct or ``[prop, foo]`` for a string in the example,
         which depends on the particular scenario.
         Note: Due to that only the key type segment is supported, the path can not specify a list
         unless the list is the last segment.
         
        repeated .envoy.type.metadata.v2.MetadataKey.PathSegment path = 2 [(.validate.rules) = { ... }
        Specified by:
        getPathOrBuilderList in interface MetadataKeyOrBuilder
      • addPathBuilder

        public MetadataKey.PathSegment.Builder addPathBuilder()
         The path to retrieve the Value from the Struct. It can be a prefix or a full path,
         e.g. ``[prop, xyz]`` for a struct or ``[prop, foo]`` for a string in the example,
         which depends on the particular scenario.
         Note: Due to that only the key type segment is supported, the path can not specify a list
         unless the list is the last segment.
         
        repeated .envoy.type.metadata.v2.MetadataKey.PathSegment path = 2 [(.validate.rules) = { ... }
      • addPathBuilder

        public MetadataKey.PathSegment.Builder addPathBuilder​(int index)
         The path to retrieve the Value from the Struct. It can be a prefix or a full path,
         e.g. ``[prop, xyz]`` for a struct or ``[prop, foo]`` for a string in the example,
         which depends on the particular scenario.
         Note: Due to that only the key type segment is supported, the path can not specify a list
         unless the list is the last segment.
         
        repeated .envoy.type.metadata.v2.MetadataKey.PathSegment path = 2 [(.validate.rules) = { ... }
      • getPathBuilderList

        public List<MetadataKey.PathSegment.Builder> getPathBuilderList()
         The path to retrieve the Value from the Struct. It can be a prefix or a full path,
         e.g. ``[prop, xyz]`` for a struct or ``[prop, foo]`` for a string in the example,
         which depends on the particular scenario.
         Note: Due to that only the key type segment is supported, the path can not specify a list
         unless the list is the last segment.
         
        repeated .envoy.type.metadata.v2.MetadataKey.PathSegment path = 2 [(.validate.rules) = { ... }
      • setUnknownFields

        public final MetadataKey.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<MetadataKey.Builder>
      • mergeUnknownFields

        public final MetadataKey.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<MetadataKey.Builder>