Interface ThreadLocalAccessor<V>


public interface ThreadLocalAccessor<V>
Contract to assist with access to a ThreadLocal including the ability to get, set, and reset it.
Since:
1.0.0
See Also:
  • Method Details

    • key

      Object key()
      The key to associate with the ThreadLocal value. This is the key under which the value is saved within a ContextSnapshot and the key under which it is looked up.
    • getValue

      @Nullable V getValue()
      Return the ThreadLocal value, or null if not set.
    • setValue

      void setValue(V value)
      Set the ThreadLocal value.
      Parameters:
      value - the value to set
    • reset

      void reset()
      Remove the ThreadLocal value.