Class LogEventWrapper.ContextDataMap
- All Implemented Interfaces:
Serializable,Cloneable,Map<String,,String> ReadOnlyStringMap
- Enclosing class:
LogEventWrapper
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsKey(String key) Returnstrueif this data structure contains the specified key,falseotherwise.<V> voidforEach(BiConsumer<String, ? super V> action) Performs the given action for each key-value pair in this data structure until all entries have been processed or the action throws an exception.<V,S> void forEach(TriConsumer<String, ? super V, S> action, S state) Performs the given action for each key-value pair in this data structure until all entries have been processed or the action throws an exception.<V> VReturns the value for the specified key, ornullif the specified key does not exist in this collection.toMap()Returns a non-nullmutableMap<String, String>containing a snapshot of this data structure.Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, newHashMap, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesMethods inherited from class java.util.AbstractMap
equals, hashCode, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.logging.log4j.util.ReadOnlyStringMap
isEmpty, size
-
Constructor Details
-
ContextDataMap
-
-
Method Details
-
toMap
Description copied from interface:ReadOnlyStringMapReturns a non-nullmutableMap<String, String>containing a snapshot of this data structure.- Specified by:
toMapin interfaceReadOnlyStringMap- Returns:
- a mutable copy of this data structure in
Map<String, String>form.
-
containsKey
Description copied from interface:ReadOnlyStringMapReturnstrueif this data structure contains the specified key,falseotherwise.- Specified by:
containsKeyin interfaceReadOnlyStringMap- Parameters:
key- the key whose presence to check. May benull.- Returns:
trueif this data structure contains the specified key,falseotherwise.
-
forEach
Description copied from interface:ReadOnlyStringMapPerforms the given action for each key-value pair in this data structure until all entries have been processed or the action throws an exception.Some implementations may not support structural modifications (adding new elements or removing elements) while iterating over the contents. In such implementations, attempts to add or remove elements from the
BiConsumer'sBiConsumer.accept(Object, Object)accept} method may cause aConcurrentModificationExceptionto be thrown.- Specified by:
forEachin interfaceReadOnlyStringMap- Type Parameters:
V- type of the value.- Parameters:
action- The action to be performed for each key-value pair in this collection.
-
forEach
Description copied from interface:ReadOnlyStringMapPerforms the given action for each key-value pair in this data structure until all entries have been processed or the action throws an exception.The third parameter lets callers pass in a stateful object to be modified with the key-value pairs, so the TriConsumer implementation itself can be stateless and potentially reusable.
Some implementations may not support structural modifications (adding new elements or removing elements) while iterating over the contents. In such implementations, attempts to add or remove elements from the
TriConsumer'sacceptmethod may cause aConcurrentModificationExceptionto be thrown.- Specified by:
forEachin interfaceReadOnlyStringMap- Type Parameters:
V- type of the value.S- type of the third parameter.- Parameters:
action- The action to be performed for each key-value pair in this collection.state- the object to be passed as the third parameter to each invocation on the specified triconsumer.
-
getValue
Description copied from interface:ReadOnlyStringMapReturns the value for the specified key, ornullif the specified key does not exist in this collection.- Specified by:
getValuein interfaceReadOnlyStringMap- Parameters:
key- the key whose value to return.- Returns:
- the value for the specified key or
null.
-