java.lang.Object
org.jboss.logmanager.MDC
Mapped diagnostic context. This is a thread-local map used to hold loggable information.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidclear()Clear the current MDC map.copy()Get a copy of the MDC map.Get a copy of the MDC map.static StringGet the value for a key, ornullif there is no mapping.static ObjectGet the value for a key, ornullif there is no mapping.static booleanisEmpty()Checks of the MDC map is empty.static StringSet the value of a key, returning the old value (if any) ornullif there was none.static ObjectSet the value of a key, returning the old value (if any) ornullif there was none.static StringRemove a key.static ObjectremoveObject(String key) Remove a key.
-
Method Details
-
get
Get the value for a key, ornullif there is no mapping.- Parameters:
key- the key- Returns:
- the value
-
getObject
Get the value for a key, ornullif there is no mapping.- Parameters:
key- the key- Returns:
- the value
-
put
Set the value of a key, returning the old value (if any) ornullif there was none.- Parameters:
key- the keyvalue- the new value- Returns:
- the old value or
nullif there was none
-
putObject
Set the value of a key, returning the old value (if any) ornullif there was none.- Parameters:
key- the keyvalue- the new value- Returns:
- the old value or
nullif there was none
-
remove
Remove a key.- Parameters:
key- the key- Returns:
- the old value or
nullif there was none
-
removeObject
Remove a key.- Parameters:
key- the key- Returns:
- the old value or
nullif there was none
-
copy
Get a copy of the MDC map. This is a relatively expensive operation.- Returns:
- a copy of the map
-
copyObject
Get a copy of the MDC map. This is a relatively expensive operation.- Returns:
- a copy of the map
-
isEmpty
public static boolean isEmpty()Checks of the MDC map is empty.- Returns:
trueif the MDC map is empty, otherwisefalse
-
clear
public static void clear()Clear the current MDC map.
-