Class CoffeeMDCAdapter

  • All Implemented Interfaces:
    MDCAdapter

    public class CoffeeMDCAdapter
    extends Object
    implements MDCAdapter
    Fallback MDC adapter for coffee; if no other adapter is available
    Since:
    1.1.0
    Author:
    mark.petrenyi
    • Constructor Detail

      • CoffeeMDCAdapter

        public CoffeeMDCAdapter()
        Default constructor, constructs a new object.
    • Method Detail

      • put

        public void put​(String key,
                        String val)
        Puts value into underlying MDC implementation.
        Specified by:
        put in interface MDCAdapter
        Parameters:
        key - MDC lookup key fro the value
        val - the value
      • get

        public String get​(String key)
        Gets value for key or null from underlying MDC implementation.
        Specified by:
        get in interface MDCAdapter
        Parameters:
        key - MDC lookup key
        Returns:
        the value or null
      • remove

        public void remove​(String key)
        Removes the value for key from the underlying MDC implementation.
        Specified by:
        remove in interface MDCAdapter
        Parameters:
        key - MDC lookup key
      • getMap

        public Map<String,​String> getMap()
        Returns the diagnostic context map from the underlying MDC implementation.
        Specified by:
        getMap in interface MDCAdapter
        Returns:
        the MDC map
      • clear

        public void clear()
        Clears the underlying MDC implementation.
        Specified by:
        clear in interface MDCAdapter