Interface ContextSnapshotFactory.Builder

Enclosing interface:
ContextSnapshotFactory

public static interface ContextSnapshotFactory.Builder
Builder for ContextSnapshotFactory instances.
  • Method Details

    • build

      Creates a new instance of ContextSnapshotFactory.
      Returns:
      an instance configured by the values set on the builder
    • clearMissing

      ContextSnapshotFactory.Builder clearMissing(boolean shouldClear)
      Determines whether to clear existing ThreadLocal values at the start of a scope, if there are no corresponding values in the source ContextSnapshot or context object.
      Parameters:
      shouldClear - if true, values not present in the context object or snapshot will be cleared at the start of a scope and later restored
      Returns:
      this builder instance
    • contextRegistry

      ContextSnapshotFactory.Builder contextRegistry(ContextRegistry contextRegistry)
      Configures the ContextRegistry to use by the created factory.
      Parameters:
      contextRegistry - the registry to use
      Returns:
      this builder instance
    • captureKeyPredicate

      ContextSnapshotFactory.Builder captureKeyPredicate(Predicate<Object> captureKeyPredicate)
      Instructs the factory to use the given predicate to select matching keys when capturing ThreadLocal values
      Parameters:
      captureKeyPredicate - predicate used to select matching keys
      Returns:
      this builder instance