Class LogEventWrapper.ContextDataMap

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.String,​java.lang.String>, ReadOnlyStringMap
    Enclosing class:
    LogEventWrapper

    private static class LogEventWrapper.ContextDataMap
    extends java.util.HashMap<java.lang.String,​java.lang.String>
    implements ReadOnlyStringMap
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.util.AbstractMap

        java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object>
      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Constructor Summary

      Constructors 
      Constructor Description
      ContextDataMap​(java.util.Map<java.lang.String,​java.lang.String> map)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean containsKey​(java.lang.String key)
      Returns true if this data structure contains the specified key, false otherwise.
      <V> void forEach​(BiConsumer<java.lang.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<java.lang.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> V getValue​(java.lang.String key)
      Returns the value for the specified key, or null if the specified key does not exist in this collection.
      java.util.Map<java.lang.String,​java.lang.String> toMap()
      Returns a non-null mutable Map<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, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
      • Methods inherited from class java.util.AbstractMap

        equals, hashCode, toString
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Map

        equals, hashCode
    • Constructor Detail

      • ContextDataMap

        ContextDataMap​(java.util.Map<java.lang.String,​java.lang.String> map)
    • Method Detail

      • toMap

        public java.util.Map<java.lang.String,​java.lang.String> toMap()
        Description copied from interface: ReadOnlyStringMap
        Returns a non-null mutable Map<String, String> containing a snapshot of this data structure.
        Specified by:
        toMap in interface ReadOnlyStringMap
        Returns:
        a mutable copy of this data structure in Map<String, String> form.
      • containsKey

        public boolean containsKey​(java.lang.String key)
        Description copied from interface: ReadOnlyStringMap
        Returns true if this data structure contains the specified key, false otherwise.
        Specified by:
        containsKey in interface ReadOnlyStringMap
        Parameters:
        key - the key whose presence to check. May be null.
        Returns:
        true if this data structure contains the specified key, false otherwise.
      • forEach

        public <V> void forEach​(BiConsumer<java.lang.String,​? super V> action)
        Description copied from interface: ReadOnlyStringMap
        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.

        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's BiConsumer.accept(Object, Object) accept} method may cause a ConcurrentModificationException to be thrown.

        Specified by:
        forEach in interface ReadOnlyStringMap
        Type Parameters:
        V - type of the value.
        Parameters:
        action - The action to be performed for each key-value pair in this collection.
      • forEach

        public <V,​S> void forEach​(TriConsumer<java.lang.String,​? super V,​S> action,
                                        S state)
        Description copied from interface: ReadOnlyStringMap
        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.

        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's accept method may cause a ConcurrentModificationException to be thrown.

        Specified by:
        forEach in interface ReadOnlyStringMap
        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

        public <V> V getValue​(java.lang.String key)
        Description copied from interface: ReadOnlyStringMap
        Returns the value for the specified key, or null if the specified key does not exist in this collection.
        Specified by:
        getValue in interface ReadOnlyStringMap
        Parameters:
        key - the key whose value to return.
        Returns:
        the value for the specified key or null.