Interface ContextRecordConfig

All Superinterfaces:
Prototype.Api
All Known Implementing Classes:
ContextRecordConfig.BuilderBase.ContextRecordConfigImpl

public interface ContextRecordConfig extends Prototype.Api
Configuration of a single propagation record, a mapping of a header name to its context classifier, with optional default value(s), and definition whether it is a single value, or an array.
See Also:
  • Method Details

    • builder

      static ContextRecordConfig.Builder builder()
      Create a new fluent API builder to customize configuration.
      Returns:
      a new builder
    • builder

      Create a new fluent API builder from an existing instance.
      Parameters:
      instance - an existing instance used as a base for the builder
      Returns:
      a builder based on an instance
    • create

      static ContextRecordConfig create(Config config)
      Create a new instance from configuration.
      Parameters:
      config - used to configure the new instance
      Returns:
      a new instance configured from configuration
    • create

      @Deprecated static ContextRecordConfig create(Config config)
      Create a new instance from configuration.
      Parameters:
      config - used to configure the new instance
      Returns:
      a new instance configured from configuration
    • create

      static ContextRecordConfig create()
      Create a new instance with default values.
      Returns:
      a new instance
    • header

      HeaderName header()
      Name of the header to use when sending the context value over the network.
      Returns:
      header name
    • classifier

      Optional<String> classifier()
      String classifier of the value that will be used with Context.get(Object, Class).
      Returns:
      classifier to use, defaults to header name
    • defaultValue

      Optional<String> defaultValue()
      Default value to send if not configured in context.
      Returns:
      default value, used for non-array records, or when only a single value is desired as a default for array
    • defaultValues

      List<String> defaultValues()
      Default values to send if not configured in context. In case default values is an empty array, it will not be sent over the network if not present in context.
      Returns:
      default values, used for array records; if this record is not an array, only the first value will be used
    • array

      boolean array()
      Whether to treat the option as an array of strings. This would be read from the context as an array.
      Returns:
      whether the record is an array