public class DefaultThreadContextMap extends Objectimplements ThreadContextMap
| Modifier and Type | Field and Description |
|---|---|
static String |
INHERITABLE_MAP
Property name ("isThreadContextMapInheritable" ) for selecting
InheritableThreadLocal (value "true") or plain
ThreadLocal (value is not "true") in the implementation.
|
| Constructor and Description |
|---|
DefaultThreadContextMap(boolean useMap)
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear the context.
|
boolean |
containsKey(String
Determine if the key is in the context.
|
boolean |
equals(Object
|
String |
get(String
Get the context identified by the
key parameter.
|
Map |
getCopy()
Get a non-
null mutable copy of current thread's context Map.
|
Map |
getImmutableMapOrNull()
Return an immutable view on the context Map or
null if the context map is empty.
|
int |
hashCode()
|
boolean |
isEmpty()
Returns true if the Map is empty.
|
void |
put(String
Put a context value (the
o parameter) as identified with the
key parameter into the current thread's context map.
|
void |
remove(String
Remove the the context identified by the
key parameter.
|
String |
toString()
|
public static final StringINHERITABLE_MAP
InheritableThreadLocal (value "true") or plain
ThreadLocal (value is not "true") in the implementation.
public void put(Stringkey, String value)
ThreadContextMap
o parameter) as identified with the
key parameter into the current thread's context map.
If the current thread does not have a context map it is created as a side effect.
put in interface
ThreadContextMap
key - The key name.
value - The key value.
public Stringget(String key)
ThreadContextMap
key parameter.
This method has no side effects.
get in interface
ThreadContextMap
key - The key to locate.
public void remove(Stringkey)
ThreadContextMap
key parameter.
remove in interface
ThreadContextMap
key - The key to remove.
public void clear()
ThreadContextMap
public boolean containsKey(Stringkey)
ThreadContextMap
containsKey in interface
ThreadContextMap
key - The key to locate.
public Map<String ,String > getCopy()
ThreadContextMap
null mutable copy of current thread's context Map.
getCopy in interface
ThreadContextMap
public Map<String ,String > getImmutableMapOrNull()
ThreadContextMap
null if the context map is empty.
getImmutableMapOrNull in interface
ThreadContextMap
null.
public boolean isEmpty()
ThreadContextMap
isEmpty in interface
ThreadContextMap
public StringtoString()
public int hashCode()
public boolean equals(Objectobj)