T
- the type of the fast thread-local variablepublic class FastThreadLocal<T> extends ThreadLocal<T>
IFastThreadLocalThread
. For other threads it can provide thread-local
variables or none if the class is created with the forAllThreads
argument set to false
.Constructor and Description |
---|
FastThreadLocal()
Creates a fast thread-local variable for all threads.
|
FastThreadLocal(boolean forAllThreads)
Creates a fast thread-local variable.
|
Modifier and Type | Method and Description |
---|---|
T |
get() |
boolean |
isForAllThreads()
Informs if the variable is provided for all threads or only for threads
implementing
IFastThreadLocalThread . |
void |
remove() |
void |
set(T value) |
initialValue, withInitial
public FastThreadLocal(boolean forAllThreads)
forAllThreads
- determines if the variable will be provided for all
threads or only for threads implementing
IFastThreadLocalThread
.public FastThreadLocal()
public boolean isForAllThreads()
IFastThreadLocalThread
.true
if the variable is provided for all threadspublic T get()
It does nothing if the current thread does not implement
IFastThreadLocalThread
and the fast thread-local was created to
provide the variable not for all threads.
get
in class ThreadLocal<T>
null
if the current thread does not implement
IFastThreadLocalThread
and the fast thread-local was created
to provide the variable not for all threads.public void set(T value)
It does nothing if the current thread does not implement
IFastThreadLocalThread
and the fast thread-local was created to
provide the variable not for all threads.
set
in class ThreadLocal<T>
public void remove()
It does nothing if the current thread does not implement
IFastThreadLocalThread
and the fast thread-local was created to
provide the variable not for all threads.
remove
in class ThreadLocal<T>
Copyright © 2017–2022 SNF4J.ORG. All rights reserved.