public class DefaultThreadContextMap extends Object implements ThreadContextMap
| Constructor and Description |
|---|
DefaultThreadContextMap() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears the context.
|
boolean |
containsKey(String key)
Determines if the key is in the context.
|
boolean |
equals(Object obj) |
String |
get(String key)
Gets the context identified by the
key parameter. |
Map<String,String> |
getCopy()
Gets a non-
null mutable copy of current thread's context Map. |
Map<String,String> |
getImmutableMapOrNull()
Returns 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.
|
ThreadContext.StoredContext |
preserveContext()
preserve thread context map and set default context
|
void |
put(String key,
String value)
Puts a context value (the
o parameter) as identified
with the key parameter into the current thread's
context map. |
void |
remove(String key)
Removes the context identified by the
key
parameter. |
ThreadContext.StoredContext |
storeContext()
preserve thread context map without default context
|
String |
toString() |
public ThreadContext.StoredContext preserveContext()
ThreadContextMappreserveContext in interface ThreadContextMappublic ThreadContext.StoredContext storeContext()
ThreadContextMapstoreContext in interface ThreadContextMappublic void put(String key, String value)
ThreadContextMapo 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 ThreadContextMapkey - The key name.value - The key value.public String get(String key)
ThreadContextMapkey parameter.
This method has no side effects.
get in interface ThreadContextMapkey - The key to locate.public void remove(String key)
ThreadContextMapkey
parameter.remove in interface ThreadContextMapkey - The key to remove.public void clear()
ThreadContextMapclear in interface ThreadContextMappublic boolean containsKey(String key)
ThreadContextMapcontainsKey in interface ThreadContextMapkey - The key to locate.public Map<String,String> getCopy()
ThreadContextMapnull mutable copy of current thread's context Map.getCopy in interface ThreadContextMappublic Map<String,String> getImmutableMapOrNull()
ThreadContextMapnull if the context map is empty.getImmutableMapOrNull in interface ThreadContextMapnull.public boolean isEmpty()
ThreadContextMapisEmpty in interface ThreadContextMapCopyright © 2022. All rights reserved.