Top Description Constructors Methods
org.slf4j.helpers

public Class NOPMDCAdapter

extends Object
implements MDCAdapter
Class Inheritance
All Implemented Interfaces
org.slf4j.spi.MDCAdapter
Imports
java.util.Deque, .Map, org.slf4j.spi.MDCAdapter

This adapter is an empty implementation of the MDCAdapter interface. It is used for all logging systems which do not support mapped diagnostic contexts such as JDK14, simple and NOP.
Author
Ceki Gülcü
Since
1.4.1

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Implements org.slf4j.spi.MDCAdapter.clear.

Clear all entries in the MDC.

public void
clearDequeByKey(String key)

Implements org.slf4j.spi.MDCAdapter.clearDequeByKey.

Clear the deque(stack) referenced by 'key'.

public String
get(String key)

Implements org.slf4j.spi.MDCAdapter.get.

Get the context identified by the key parameter.

public Map<String, String>
getCopyOfContextMap()

Implements org.slf4j.spi.MDCAdapter.getCopyOfContextMap.

Return a copy of the current thread's context map, with keys and values of type String.

public Deque<String>
getCopyOfDequeByKey(String key)

Implements org.slf4j.spi.MDCAdapter.getCopyOfDequeByKey.

Returns a copy of the deque(stack) referenced by 'key'.

public String
popByKey(String key)

Implements org.slf4j.spi.MDCAdapter.popByKey.

Pop the stack referenced by 'key' and return the value possibly null.

public void
pushByKey(String key, String value)

Implements org.slf4j.spi.MDCAdapter.pushByKey.

Push a value into the deque(stack) referenced by 'key'.

public void
put(String key, String val)

Implements org.slf4j.spi.MDCAdapter.put.

Put a context value (the val parameter) as identified with the key parameter into the current thread's context map.

public void
remove(String key)

Implements org.slf4j.spi.MDCAdapter.remove.

Remove the context identified by the key parameter.

public void
setContextMap(Map<String, String> contextMap)

Implements org.slf4j.spi.MDCAdapter.setContextMap.

Set the current thread's context map by first clearing any existing map and then copying the map passed as parameter.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

NOPMDCAdapterback to summary
public NOPMDCAdapter()

Method Detail

clearback to summary
public void clear()

Implements org.slf4j.spi.MDCAdapter.clear.

Doc from org.slf4j.spi.MDCAdapter.clear.

Clear all entries in the MDC.

clearDequeByKeyback to summary
public void clearDequeByKey(String key)

Implements org.slf4j.spi.MDCAdapter.clearDequeByKey.

Doc from org.slf4j.spi.MDCAdapter.clearDequeByKey.

Clear the deque(stack) referenced by 'key'.

getback to summary
public String get(String key)

Implements org.slf4j.spi.MDCAdapter.get.

Doc from org.slf4j.spi.MDCAdapter.get.

Get the context identified by the key parameter. The key parameter cannot be null.

getCopyOfContextMapback to summary
public Map<String, String> getCopyOfContextMap()

Implements org.slf4j.spi.MDCAdapter.getCopyOfContextMap.

Doc from org.slf4j.spi.MDCAdapter.getCopyOfContextMap.

Return a copy of the current thread's context map, with keys and values of type String. Returned value may be null.

getCopyOfDequeByKeyback to summary
public Deque<String> getCopyOfDequeByKey(String key)

Implements org.slf4j.spi.MDCAdapter.getCopyOfDequeByKey.

Doc from org.slf4j.spi.MDCAdapter.getCopyOfDequeByKey.

Returns a copy of the deque(stack) referenced by 'key'. May be null.

Annotations
@Override
popByKeyback to summary
public String popByKey(String key)

Implements org.slf4j.spi.MDCAdapter.popByKey.

Doc from org.slf4j.spi.MDCAdapter.popByKey.

Pop the stack referenced by 'key' and return the value possibly null.

Annotations
@Override
pushByKeyback to summary
public void pushByKey(String key, String value)

Implements org.slf4j.spi.MDCAdapter.pushByKey.

Doc from org.slf4j.spi.MDCAdapter.pushByKey.

Push a value into the deque(stack) referenced by 'key'.

Annotations
@Override
putback to summary
public void put(String key, String val)

Implements org.slf4j.spi.MDCAdapter.put.

Doc from org.slf4j.spi.MDCAdapter.put.

Put a context value (the val parameter) as identified with the key parameter into the current thread's context map. The key parameter cannot be null. The val parameter can be null only if the underlying implementation supports it.

If the current thread does not have a context map it is created as a side effect of this call.

removeback to summary
public void remove(String key)

Implements org.slf4j.spi.MDCAdapter.remove.

Doc from org.slf4j.spi.MDCAdapter.remove.

Remove the context identified by the key parameter. The key parameter cannot be null.

This method does nothing if there is no previous value associated with key.

setContextMapback to summary
public void setContextMap(Map<String, String> contextMap)

Implements org.slf4j.spi.MDCAdapter.setContextMap.

Doc from org.slf4j.spi.MDCAdapter.setContextMap.

Set the current thread's context map by first clearing any existing map and then copying the map passed as parameter. The context map parameter must only contain keys and values of type String. Implementations must support null valued map passed as parameter.