Top Description Constructors Methods
org.apache.logging.log4j.spi

public Class NoOpThreadContextMap

extends Object
implements ThreadContextMap
Class Inheritance
All Implemented Interfaces
org.apache.logging.log4j.spi.ThreadContextMap
Imports
java.util.HashMap, .Map

ThreadContextMap implementation used when either of system properties disableThreadContextMap or . disableThreadContext is true. This implementation does nothing.
Since
2.7

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public boolean
containsKey(final String
The key to locate.
key
)

Implements org.apache.logging.log4j.spi.ThreadContextMap.containsKey.

Determines if the key is in the context.

public String
get(final String
The key to locate.
key
)

Implements org.apache.logging.log4j.spi.ThreadContextMap.get.

Gets the context identified by the key parameter.

public Map<String, String>
getCopy()

Implements org.apache.logging.log4j.spi.ThreadContextMap.getCopy.

Gets a non-null mutable copy of current thread's context Map.

public Map<String, String>
getImmutableMapOrNull()

Implements org.apache.logging.log4j.spi.ThreadContextMap.getImmutableMapOrNull.

Returns an immutable view on the context Map or null if the context map is empty.

public boolean
isEmpty()

Implements org.apache.logging.log4j.spi.ThreadContextMap.isEmpty.

Returns true if the Map is empty.

public void
put(final String
The key name.
key
,
final String
The key value.
value
)

Implements org.apache.logging.log4j.spi.ThreadContextMap.put.

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

public void
remove(final String
The key to remove.
key
)

Implements org.apache.logging.log4j.spi.ThreadContextMap.remove.

Removes the context identified by the key parameter.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

NoOpThreadContextMapback to summary
public NoOpThreadContextMap()

Method Detail

clearback to summary
public void clear()

Implements org.apache.logging.log4j.spi.ThreadContextMap.clear.

Doc from org.apache.logging.log4j.spi.ThreadContextMap.clear.

Clears the context.

Annotations
@Override
containsKeyback to summary
public boolean containsKey(final String key)

Implements org.apache.logging.log4j.spi.ThreadContextMap.containsKey.

Doc from org.apache.logging.log4j.spi.ThreadContextMap.containsKey.

Determines if the key is in the context.

Parameters
key:String

The key to locate.

Returns:boolean

True if the key is in the context, false otherwise.

Annotations
@Override
getback to summary
public String get(final String key)

Implements org.apache.logging.log4j.spi.ThreadContextMap.get.

Doc from org.apache.logging.log4j.spi.ThreadContextMap.get.

Gets the context identified by the key parameter.

This method has no side effects.

Parameters
key:String

The key to locate.

Returns:String

The value associated with the key or null.

Annotations
@Override
getCopyback to summary
public Map<String, String> getCopy()

Implements org.apache.logging.log4j.spi.ThreadContextMap.getCopy.

Doc from org.apache.logging.log4j.spi.ThreadContextMap.getCopy.

Gets a non-null mutable copy of current thread's context Map.

Returns:Map<String, String>

a mutable copy of the context.

Annotations
@Override
getImmutableMapOrNullback to summary
public Map<String, String> getImmutableMapOrNull()

Implements org.apache.logging.log4j.spi.ThreadContextMap.getImmutableMapOrNull.

Doc from org.apache.logging.log4j.spi.ThreadContextMap.getImmutableMapOrNull.

Returns an immutable view on the context Map or null if the context map is empty.

Returns:Map<String, String>

an immutable context Map or null.

Annotations
@Override
isEmptyback to summary
public boolean isEmpty()

Implements org.apache.logging.log4j.spi.ThreadContextMap.isEmpty.

Doc from org.apache.logging.log4j.spi.ThreadContextMap.isEmpty.

Returns true if the Map is empty.

Returns:boolean

true if the Map is empty, false otherwise.

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

Implements org.apache.logging.log4j.spi.ThreadContextMap.put.

Doc from org.apache.logging.log4j.spi.ThreadContextMap.put.

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

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

Parameters
key:String

The key name.

value:String

The key value.

Annotations
@Override
removeback to summary
public void remove(final String key)

Implements org.apache.logging.log4j.spi.ThreadContextMap.remove.

Doc from org.apache.logging.log4j.spi.ThreadContextMap.remove.

Removes the context identified by the key parameter.

Parameters
key:String

The key to remove.

Annotations
@Override