类 NamedThreadLocal<T>
java.lang.Object
java.lang.ThreadLocal<T>
cn.taketoday.core.NamedThreadLocal<T>
- 类型参数:
T- the value type
ThreadLocal subclass that exposes a specified name
as toString() result (allowing for introspection).- 从以下版本开始:
- 3.0
- 作者:
- Juergen Hoeller, TODAY 2021/2/1 20:43
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明toString()static <S> NamedThreadLocal<S>withInitial(String name, Supplier<? extends S> supplier) Creates a thread local variable.从类继承的方法 java.lang.ThreadLocal
get, initialValue, remove, set, withInitial
-
构造器详细资料
-
NamedThreadLocal
Create a new NamedThreadLocal with the given name.- 参数:
name- a descriptive name for this ThreadLocal
-
-
方法详细资料
-
toString
-
withInitial
Creates a thread local variable. The initial value of the variable is determined by invoking thegetmethod on theSupplier.- 类型参数:
S- the type of the thread local's value- 参数:
name- a descriptive name for this ThreadLocalsupplier- the supplier to be used to determine the initial value- 返回:
- a new thread local variable
- 抛出:
NullPointerException- if the specified supplier is null- 从以下版本开始:
- 4.0
-