public class Log4jv2ThreadContextMap extends java.lang.Object implements ThreadContextMap
| Constructor and Description |
|---|
Log4jv2ThreadContextMap() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears the context.
|
boolean |
containsKey(java.lang.String key)
Determines if the key is in the context.
|
static void |
dispose() |
java.lang.String |
get(java.lang.String key)
Gets the context identified by the
key parameter. |
java.util.Map<java.lang.String,java.lang.String> |
getCopy()
Gets a non-
null mutable copy of current thread's context Map. |
java.util.Map<java.lang.String,java.lang.String> |
getImmutableMapOrNull()
Returns an immutable view on the context Map or
null if the context map is empty. |
boolean |
isEmpty()
Returns true if the Map is empty.
|
void |
put(java.lang.String key,
java.lang.String value)
Puts a context value (the
o parameter) as identified
with the key parameter into the current thread's
context map. |
void |
remove(java.lang.String key)
Removes the the context identified by the
key
parameter. |
public static void dispose()
public void put(java.lang.String key,
java.lang.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 java.lang.String get(java.lang.String key)
ThreadContextMapkey parameter.
This method has no side effects.
get in interface ThreadContextMapkey - The key to locate.public void remove(java.lang.String key)
ThreadContextMapkey
parameter.remove in interface ThreadContextMapkey - The key to remove.public void clear()
ThreadContextMapclear in interface ThreadContextMappublic boolean containsKey(java.lang.String key)
ThreadContextMapcontainsKey in interface ThreadContextMapkey - The key to locate.public java.util.Map<java.lang.String,java.lang.String> getCopy()
ThreadContextMapnull mutable copy of current thread's context Map.getCopy in interface ThreadContextMappublic java.util.Map<java.lang.String,java.lang.String> getImmutableMapOrNull()
ThreadContextMapnull if the context map is empty.getImmutableMapOrNull in interface ThreadContextMapnull.public boolean isEmpty()
ThreadContextMapisEmpty in interface ThreadContextMapCopyright © 2006-2021 OPS4J - Open Participation Software for Java. All Rights Reserved.