类 NamedInheritableThreadLocal<T>

java.lang.Object
java.lang.ThreadLocal<T>
java.lang.InheritableThreadLocal<T>
cn.taketoday.core.NamedInheritableThreadLocal<T>
类型参数:
T - the value type

public class NamedInheritableThreadLocal<T> extends InheritableThreadLocal<T>
InheritableThreadLocal subclass that exposes a specified name as toString() result (allowing for introspection).
从以下版本开始:
4.0
作者:
Juergen Hoeller, TODAY 2021/9/11 12:13
另请参阅:
  • 构造器详细资料

    • NamedInheritableThreadLocal

      public NamedInheritableThreadLocal(String name)
      Create a new NamedInheritableThreadLocal with the given name.
      参数:
      name - a descriptive name for this ThreadLocal
  • 方法详细资料

    • toString

      public String toString()
      覆盖:
      toString 在类中 Object
    • withInitial

      public static <S> NamedInheritableThreadLocal<S> withInitial(String name, Supplier<? extends S> supplier)
      Creates a thread local variable. The initial value of the variable is determined by invoking the get method on the Supplier.
      类型参数:
      S - the type of the thread local's value
      参数:
      supplier - the supplier to be used to determine the initial value
      返回:
      a new thread local variable
      抛出:
      NullPointerException - if the specified supplier is null
      从以下版本开始:
      4.0