Package org.apache.logging.log4j.spi
Interface ObjectThreadContextMap
- All Superinterfaces:
CleanableThreadContextMap
,ThreadContextMap
,ThreadContextMap2
Extension service provider interface to allow putting Object values in the
ThreadContext
.- Since:
- 2.8
- See Also:
-
Method Summary
Modifier and TypeMethodDescription<V> V
Returns the Object value for the specified key, ornull
if the specified key does not exist in this collection.<V> void
putAllValues
(Map<String, V> values) Puts all given key-value pairs into the collection.<V> void
Puts the specified key-value pair into the collection.Methods inherited from interface org.apache.logging.log4j.spi.CleanableThreadContextMap
removeAll
Methods inherited from interface org.apache.logging.log4j.spi.ThreadContextMap
clear, containsKey, get, getCopy, getImmutableMapOrNull, isEmpty, put, remove
Methods inherited from interface org.apache.logging.log4j.spi.ThreadContextMap2
getReadOnlyContextData, putAll
-
Method Details
-
getValue
Returns the Object value for the specified key, ornull
if the specified key does not exist in this collection.- Parameters:
key
- the key whose value to return- Returns:
- the value for the specified key or
null
-
putValue
Puts the specified key-value pair into the collection.- Parameters:
key
- the key to add or remove. Keys may benull
.value
- the value to add. Values may benull
.
-
putAllValues
Puts all given key-value pairs into the collection.- Parameters:
values
- the map of key-value pairs to add
-