public final class MDC
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
clear()
Clears the message diagnostics context.
|
static java.lang.Object |
get(java.lang.String key)
Returns the value for the key or
null if no value was found. |
static java.util.Map<java.lang.String,java.lang.Object> |
getMap()
Returns the map from the context.
|
static java.lang.Object |
put(java.lang.String key,
java.lang.Object val)
Puts the value onto the context.
|
static void |
remove(java.lang.String key)
Removes the value from the context.
|
public static java.lang.Object put(java.lang.String key, java.lang.Object val)
key
- the key for the valueval
- the valuenull
if no value was setpublic static java.lang.Object get(java.lang.String key)
null
if no value was found.key
- the key to lookup the value fornull
if not foundpublic static void remove(java.lang.String key)
key
- the key of the value to removepublic static java.util.Map<java.lang.String,java.lang.Object> getMap()
Note that in most implementations this is an expensive operation and should be used sparingly.
null
public static void clear()
Copyright © 2015 Red Hat, Inc.