blob: 30e2268c62aaee0350fe7451045b66a212be9e58 [file] [log] [blame]
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) -->
<title>DefaultThreadContextMap (Apache Log4j API 2.23.1 API)</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="declaration: package: org.apache.logging.log4j.spi, class: DefaultThreadContextMap">
<meta name="generator" content="javadoc/ClassWriterImpl">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../script-dir/jquery-ui.min.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../jquery-ui.overrides.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
<script type="text/javascript" src="../../../../../script-dir/jquery-3.6.1.min.js"></script>
<script type="text/javascript" src="../../../../../script-dir/jquery-ui.min.js"></script>
</head>
<body class="class-declaration-page">
<script type="text/javascript">var evenRowColor = "even-row-color";
var oddRowColor = "odd-row-color";
var tableTab = "table-tab";
var activeTableTab = "active-table-tab";
var pathtoroot = "../../../../../";
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="flex-box">
<header role="banner" class="flex-header">
<nav role="navigation">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="top-nav" id="navbar-top">
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
<li><a href="../../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="nav-bar-cell1-rev">Class</li>
<li><a href="class-use/DefaultThreadContextMap.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html#class">Help</a></li>
</ul>
</div>
<div class="sub-nav">
<div>
<ul class="sub-nav-list">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field-summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor-summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method-summary">Method</a></li>
</ul>
<ul class="sub-nav-list">
<li>Detail:&nbsp;</li>
<li><a href="#field-detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor-detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method-detail">Method</a></li>
</ul>
</div>
<div class="nav-list-search"><label for="search-input">SEARCH:</label>
<input type="text" id="search-input" value="search" disabled="disabled">
<input type="reset" id="reset-button" value="reset" disabled="disabled">
</div>
</div>
<!-- ========= END OF TOP NAVBAR ========= -->
<span class="skip-nav" id="skip-navbar-top"></span></nav>
</header>
<div class="flex-content">
<main role="main">
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="sub-title"><span class="package-label-in-type">Package</span>&nbsp;<a href="package-summary.html">org.apache.logging.log4j.spi</a></div>
<h1 title="Class DefaultThreadContextMap" class="title">Class DefaultThreadContextMap</h1>
</div>
<div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">java.lang.Object</a>
<div class="inheritance">org.apache.logging.log4j.spi.DefaultThreadContextMap</div>
</div>
<section class="class-description" id="class-description">
<dl class="notes">
<dt>All Implemented Interfaces:</dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html" title="class or interface in java.io" class="external-link">Serializable</a></code>, <code><a href="ThreadContextMap.html" title="interface in org.apache.logging.log4j.spi">ThreadContextMap</a></code>, <code><a href="../util/ReadOnlyStringMap.html" title="interface in org.apache.logging.log4j.util">ReadOnlyStringMap</a></code></dd>
</dl>
<hr>
<div class="type-signature"><span class="modifiers">public class </span><span class="element-name type-name-label">DefaultThreadContextMap</span>
<span class="extends-implements">extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>
implements <a href="ThreadContextMap.html" title="interface in org.apache.logging.log4j.spi">ThreadContextMap</a>, <a href="../util/ReadOnlyStringMap.html" title="interface in org.apache.logging.log4j.util">ReadOnlyStringMap</a></span></div>
<div class="block">The actual ThreadContext Map. A new ThreadContext Map is created each time it is updated and the Map stored is always
immutable. This means the Map can be passed to other threads without concern that it will be updated. Since it is
expected that the Map will be passed to many more log events than the number of keys it contains the performance
should be much better than if the Map was copied for each event.</div>
<dl class="notes">
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="../../../../../serialized-form.html#org.apache.logging.log4j.spi.DefaultThreadContextMap">Serialized Form</a></li>
</ul>
</dd>
</dl>
</section>
<section class="summary">
<ul class="summary-list">
<!-- =========== FIELD SUMMARY =========== -->
<li>
<section class="field-summary" id="field-summary">
<h2>Field Summary</h2>
<div class="caption"><span>Fields</span></div>
<div class="summary-table three-column-summary">
<div class="table-header col-first">Modifier and Type</div>
<div class="table-header col-second">Field</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color"><code>static final <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
<div class="col-second even-row-color"><code><a href="#INHERITABLE_MAP" class="member-name-link">INHERITABLE_MAP</a></code></div>
<div class="col-last even-row-color">
<div class="block">Property name ("isThreadContextMapInheritable" ) for selecting <code>InheritableThreadLocal</code> (value "true") or plain
<code>ThreadLocal</code> (value is not "true") in the implementation.</div>
</div>
</div>
</section>
</li>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<li>
<section class="constructor-summary" id="constructor-summary">
<h2>Constructor Summary</h2>
<div class="caption"><span>Constructors</span></div>
<div class="summary-table two-column-summary">
<div class="table-header col-first">Constructor</div>
<div class="table-header col-last">Description</div>
<div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E()" class="member-name-link">DefaultThreadContextMap</a>()</code></div>
<div class="col-last even-row-color">&nbsp;</div>
<div class="col-constructor-name odd-row-color"><code><a href="#%3Cinit%3E(boolean)" class="member-name-link">DefaultThreadContextMap</a><wbr>(boolean&nbsp;useMap)</code></div>
<div class="col-last odd-row-color">&nbsp;</div>
</div>
</section>
</li>
<!-- ========== METHOD SUMMARY =========== -->
<li>
<section class="method-summary" id="method-summary">
<h2>Method Summary</h2>
<div id="method-summary-table">
<div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div>
<div id="method-summary-table.tabpanel" role="tabpanel">
<div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">
<div class="table-header col-first">Modifier and Type</div>
<div class="table-header col-second">Method</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#clear()" class="member-name-link">clear</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Clears the context.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#containsKey(java.lang.String)" class="member-name-link">containsKey</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;key)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Determines if the key is in the context.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#equals(java.lang.Object)" class="member-name-link">equals</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>&nbsp;obj)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>&lt;V&gt;&nbsp;void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#forEach(org.apache.logging.log4j.util.BiConsumer)" class="member-name-link">forEach</a><wbr>(<a href="../util/BiConsumer.html" title="interface in org.apache.logging.log4j.util">BiConsumer</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>,<wbr>? super V&gt;&nbsp;action)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Performs the given action for each key-value pair in this data structure
until all entries have been processed or the action throws an exception.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>&lt;V,<wbr>
S&gt;&nbsp;void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#forEach(org.apache.logging.log4j.util.TriConsumer,S)" class="member-name-link">forEach</a><wbr>(<a href="../util/TriConsumer.html" title="interface in org.apache.logging.log4j.util">TriConsumer</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>,<wbr>? super V,<wbr>S&gt;&nbsp;action,
S&nbsp;state)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Performs the given action for each key-value pair in this data structure
until all entries have been processed or the action throws an exception.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#get(java.lang.String)" class="member-name-link">get</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;key)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Gets the context identified by the <code>key</code> parameter.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>,<wbr><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&gt;</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getCopy()" class="member-name-link">getCopy</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Gets a non-<code>null</code> mutable copy of current thread's context Map.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>,<wbr><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&gt;</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getImmutableMapOrNull()" class="member-name-link">getImmutableMapOrNull</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns an immutable view on the context Map or <code>null</code> if the context map is empty.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>&lt;V&gt;&nbsp;V</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getValue(java.lang.String)" class="member-name-link">getValue</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;key)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns the value for the specified key, or <code>null</code> if the specified key does not exist in this collection.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>int</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#hashCode()" class="member-name-link">hashCode</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#isEmpty()" class="member-name-link">isEmpty</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns true if the Map is empty.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#put(java.lang.String,java.lang.String)" class="member-name-link">put</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;key,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;value)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Puts a context value (the <code>o</code> parameter) as identified
with the <code>key</code> parameter into the current thread's
context map.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#putAll(java.util.Map)" class="member-name-link">putAll</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>,<wbr><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&gt;&nbsp;m)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#remove(java.lang.String)" class="member-name-link">remove</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;key)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Removes the context identified by the <code>key</code>
parameter.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#removeAll(java.lang.Iterable)" class="member-name-link">removeAll</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html" title="class or interface in java.lang" class="external-link">Iterable</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&gt;&nbsp;keys)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>int</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#size()" class="member-name-link">size</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns the number of key-value pairs in this collection.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>,<wbr><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&gt;</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#toMap()" class="member-name-link">toMap</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns a non-<code>null</code> mutable <code>Map&lt;String, String&gt;</code> containing a snapshot of this data structure.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#toString()" class="member-name-link">toString</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
</div>
</div>
</div>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3>
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--" title="class or interface in java.lang" class="external-link">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-" title="class or interface in java.lang" class="external-link">wait</a></code></div>
</section>
</li>
</ul>
</section>
<section class="details">
<ul class="details-list">
<!-- ============ FIELD DETAIL =========== -->
<li>
<section class="field-details" id="field-detail">
<h2>Field Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="INHERITABLE_MAP">
<h3>INHERITABLE_MAP</h3>
<div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span>&nbsp;<span class="element-name">INHERITABLE_MAP</span></div>
<div class="block">Property name ("isThreadContextMapInheritable" ) for selecting <code>InheritableThreadLocal</code> (value "true") or plain
<code>ThreadLocal</code> (value is not "true") in the implementation.</div>
<dl class="notes">
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="../../../../../constant-values.html#org.apache.logging.log4j.spi.DefaultThreadContextMap.INHERITABLE_MAP">Constant Field Values</a></li>
</ul>
</dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<li>
<section class="constructor-details" id="constructor-detail">
<h2>Constructor Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="&lt;init&gt;()">
<h3>DefaultThreadContextMap</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">DefaultThreadContextMap</span>()</div>
</section>
</li>
<li>
<section class="detail" id="&lt;init&gt;(boolean)">
<h3>DefaultThreadContextMap</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">DefaultThreadContextMap</span><wbr><span class="parameters">(boolean&nbsp;useMap)</span></div>
</section>
</li>
</ul>
</section>
</li>
<!-- ============ METHOD DETAIL ========== -->
<li>
<section class="method-details" id="method-detail">
<h2>Method Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="put(java.lang.String,java.lang.String)">
<h3>put</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">put</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;key,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;value)</span></div>
<div class="block"><span class="descfrm-type-label">Description copied from interface:&nbsp;<code><a href="ThreadContextMap.html#put(java.lang.String,java.lang.String)">ThreadContextMap</a></code></span></div>
<div class="block">Puts a context value (the <code>o</code> parameter) as identified
with the <code>key</code> parameter into the current thread's
context map.
<p>If the current thread does not have a context map it is
created as a side effect.</p></div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="ThreadContextMap.html#put(java.lang.String,java.lang.String)">put</a></code>&nbsp;in interface&nbsp;<code><a href="ThreadContextMap.html" title="interface in org.apache.logging.log4j.spi">ThreadContextMap</a></code></dd>
<dt>Parameters:</dt>
<dd><code>key</code> - The key name.</dd>
<dd><code>value</code> - The key value.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="putAll(java.util.Map)">
<h3>putAll</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">putAll</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>,<wbr><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&gt;&nbsp;m)</span></div>
</section>
</li>
<li>
<section class="detail" id="get(java.lang.String)">
<h3>get</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span>&nbsp;<span class="element-name">get</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;key)</span></div>
<div class="block"><span class="descfrm-type-label">Description copied from interface:&nbsp;<code><a href="ThreadContextMap.html#get(java.lang.String)">ThreadContextMap</a></code></span></div>
<div class="block">Gets the context identified by the <code>key</code> parameter.
<p>This method has no side effects.</p></div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="ThreadContextMap.html#get(java.lang.String)">get</a></code>&nbsp;in interface&nbsp;<code><a href="ThreadContextMap.html" title="interface in org.apache.logging.log4j.spi">ThreadContextMap</a></code></dd>
<dt>Parameters:</dt>
<dd><code>key</code> - The key to locate.</dd>
<dt>Returns:</dt>
<dd>The value associated with the key or null.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="remove(java.lang.String)">
<h3>remove</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">remove</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;key)</span></div>
<div class="block"><span class="descfrm-type-label">Description copied from interface:&nbsp;<code><a href="ThreadContextMap.html#remove(java.lang.String)">ThreadContextMap</a></code></span></div>
<div class="block">Removes the context identified by the <code>key</code>
parameter.</div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="ThreadContextMap.html#remove(java.lang.String)">remove</a></code>&nbsp;in interface&nbsp;<code><a href="ThreadContextMap.html" title="interface in org.apache.logging.log4j.spi">ThreadContextMap</a></code></dd>
<dt>Parameters:</dt>
<dd><code>key</code> - The key to remove.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="removeAll(java.lang.Iterable)">
<h3>removeAll</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">removeAll</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html" title="class or interface in java.lang" class="external-link">Iterable</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&gt;&nbsp;keys)</span></div>
</section>
</li>
<li>
<section class="detail" id="clear()">
<h3>clear</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">clear</span>()</div>
<div class="block"><span class="descfrm-type-label">Description copied from interface:&nbsp;<code><a href="ThreadContextMap.html#clear()">ThreadContextMap</a></code></span></div>
<div class="block">Clears the context.</div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="ThreadContextMap.html#clear()">clear</a></code>&nbsp;in interface&nbsp;<code><a href="ThreadContextMap.html" title="interface in org.apache.logging.log4j.spi">ThreadContextMap</a></code></dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="toMap()">
<h3>toMap</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>,<wbr><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&gt;</span>&nbsp;<span class="element-name">toMap</span>()</div>
<div class="block"><span class="descfrm-type-label">Description copied from interface:&nbsp;<code><a href="../util/ReadOnlyStringMap.html#toMap()">ReadOnlyStringMap</a></code></span></div>
<div class="block">Returns a non-<code>null</code> mutable <code>Map&lt;String, String&gt;</code> containing a snapshot of this data structure.</div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="../util/ReadOnlyStringMap.html#toMap()">toMap</a></code>&nbsp;in interface&nbsp;<code><a href="../util/ReadOnlyStringMap.html" title="interface in org.apache.logging.log4j.util">ReadOnlyStringMap</a></code></dd>
<dt>Returns:</dt>
<dd>a mutable copy of this data structure in <code>Map&lt;String, String&gt;</code> form.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="containsKey(java.lang.String)">
<h3>containsKey</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">containsKey</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;key)</span></div>
<div class="block"><span class="descfrm-type-label">Description copied from interface:&nbsp;<code><a href="ThreadContextMap.html#containsKey(java.lang.String)">ThreadContextMap</a></code></span></div>
<div class="block">Determines if the key is in the context.</div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="../util/ReadOnlyStringMap.html#containsKey(java.lang.String)">containsKey</a></code>&nbsp;in interface&nbsp;<code><a href="../util/ReadOnlyStringMap.html" title="interface in org.apache.logging.log4j.util">ReadOnlyStringMap</a></code></dd>
<dt>Specified by:</dt>
<dd><code><a href="ThreadContextMap.html#containsKey(java.lang.String)">containsKey</a></code>&nbsp;in interface&nbsp;<code><a href="ThreadContextMap.html" title="interface in org.apache.logging.log4j.spi">ThreadContextMap</a></code></dd>
<dt>Parameters:</dt>
<dd><code>key</code> - The key to locate.</dd>
<dt>Returns:</dt>
<dd>True if the key is in the context, false otherwise.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="forEach(org.apache.logging.log4j.util.BiConsumer)">
<h3>forEach</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="type-parameters">&lt;V&gt;</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">forEach</span><wbr><span class="parameters">(<a href="../util/BiConsumer.html" title="interface in org.apache.logging.log4j.util">BiConsumer</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>,<wbr>? super V&gt;&nbsp;action)</span></div>
<div class="block"><span class="descfrm-type-label">Description copied from interface:&nbsp;<code><a href="../util/ReadOnlyStringMap.html#forEach(org.apache.logging.log4j.util.BiConsumer)">ReadOnlyStringMap</a></code></span></div>
<div class="block">Performs the given action for each key-value pair in this data structure
until all entries have been processed or the action throws an exception.
<p>
Some implementations may not support structural modifications (adding new elements or removing elements) while
iterating over the contents. In such implementations, attempts to add or remove elements from the
<code>BiConsumer</code>'s <a href="../util/BiConsumer.html#accept(K,V)"><code>BiConsumer.accept(Object, Object)</code></a> accept} method may cause a
<code>ConcurrentModificationException</code> to be thrown.
</p></div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="../util/ReadOnlyStringMap.html#forEach(org.apache.logging.log4j.util.BiConsumer)">forEach</a></code>&nbsp;in interface&nbsp;<code><a href="../util/ReadOnlyStringMap.html" title="interface in org.apache.logging.log4j.util">ReadOnlyStringMap</a></code></dd>
<dt>Type Parameters:</dt>
<dd><code>V</code> - type of the value.</dd>
<dt>Parameters:</dt>
<dd><code>action</code> - The action to be performed for each key-value pair in this collection.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="forEach(org.apache.logging.log4j.util.TriConsumer,S)">
<h3 id="forEach(org.apache.logging.log4j.util.TriConsumer,java.lang.Object)">forEach</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="type-parameters">&lt;V,<wbr>
S&gt;</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">forEach</span><wbr><span class="parameters">(<a href="../util/TriConsumer.html" title="interface in org.apache.logging.log4j.util">TriConsumer</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>,<wbr>? super V,<wbr>S&gt;&nbsp;action,
S&nbsp;state)</span></div>
<div class="block"><span class="descfrm-type-label">Description copied from interface:&nbsp;<code><a href="../util/ReadOnlyStringMap.html#forEach(org.apache.logging.log4j.util.TriConsumer,S)">ReadOnlyStringMap</a></code></span></div>
<div class="block">Performs the given action for each key-value pair in this data structure
until all entries have been processed or the action throws an exception.
<p>
The third parameter lets callers pass in a stateful object to be modified with the key-value pairs,
so the TriConsumer implementation itself can be stateless and potentially reusable.
</p>
<p>
Some implementations may not support structural modifications (adding new elements or removing elements) while
iterating over the contents. In such implementations, attempts to add or remove elements from the
<code>TriConsumer</code>'s <a href="../util/TriConsumer.html#accept(K,V,S)"><code>accept</code></a> method may cause a
<code>ConcurrentModificationException</code> to be thrown.
</p></div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="../util/ReadOnlyStringMap.html#forEach(org.apache.logging.log4j.util.TriConsumer,S)">forEach</a></code>&nbsp;in interface&nbsp;<code><a href="../util/ReadOnlyStringMap.html" title="interface in org.apache.logging.log4j.util">ReadOnlyStringMap</a></code></dd>
<dt>Type Parameters:</dt>
<dd><code>V</code> - type of the value.</dd>
<dd><code>S</code> - type of the third parameter.</dd>
<dt>Parameters:</dt>
<dd><code>action</code> - The action to be performed for each key-value pair in this collection.</dd>
<dd><code>state</code> - the object to be passed as the third parameter to each invocation on the specified
triconsumer.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getValue(java.lang.String)">
<h3>getValue</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="type-parameters">&lt;V&gt;</span>&nbsp;<span class="return-type">V</span>&nbsp;<span class="element-name">getValue</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;key)</span></div>
<div class="block"><span class="descfrm-type-label">Description copied from interface:&nbsp;<code><a href="../util/ReadOnlyStringMap.html#getValue(java.lang.String)">ReadOnlyStringMap</a></code></span></div>
<div class="block">Returns the value for the specified key, or <code>null</code> if the specified key does not exist in this collection.</div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="../util/ReadOnlyStringMap.html#getValue(java.lang.String)">getValue</a></code>&nbsp;in interface&nbsp;<code><a href="../util/ReadOnlyStringMap.html" title="interface in org.apache.logging.log4j.util">ReadOnlyStringMap</a></code></dd>
<dt>Parameters:</dt>
<dd><code>key</code> - the key whose value to return.</dd>
<dt>Returns:</dt>
<dd>the value for the specified key or <code>null</code>.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getCopy()">
<h3>getCopy</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>,<wbr><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&gt;</span>&nbsp;<span class="element-name">getCopy</span>()</div>
<div class="block"><span class="descfrm-type-label">Description copied from interface:&nbsp;<code><a href="ThreadContextMap.html#getCopy()">ThreadContextMap</a></code></span></div>
<div class="block">Gets a non-<code>null</code> mutable copy of current thread's context Map.</div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="ThreadContextMap.html#getCopy()">getCopy</a></code>&nbsp;in interface&nbsp;<code><a href="ThreadContextMap.html" title="interface in org.apache.logging.log4j.spi">ThreadContextMap</a></code></dd>
<dt>Returns:</dt>
<dd>a mutable copy of the context.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getImmutableMapOrNull()">
<h3>getImmutableMapOrNull</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>,<wbr><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&gt;</span>&nbsp;<span class="element-name">getImmutableMapOrNull</span>()</div>
<div class="block"><span class="descfrm-type-label">Description copied from interface:&nbsp;<code><a href="ThreadContextMap.html#getImmutableMapOrNull()">ThreadContextMap</a></code></span></div>
<div class="block">Returns an immutable view on the context Map or <code>null</code> if the context map is empty.</div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="ThreadContextMap.html#getImmutableMapOrNull()">getImmutableMapOrNull</a></code>&nbsp;in interface&nbsp;<code><a href="ThreadContextMap.html" title="interface in org.apache.logging.log4j.spi">ThreadContextMap</a></code></dd>
<dt>Returns:</dt>
<dd>an immutable context Map or <code>null</code>.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="isEmpty()">
<h3>isEmpty</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">isEmpty</span>()</div>
<div class="block"><span class="descfrm-type-label">Description copied from interface:&nbsp;<code><a href="ThreadContextMap.html#isEmpty()">ThreadContextMap</a></code></span></div>
<div class="block">Returns true if the Map is empty.</div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="../util/ReadOnlyStringMap.html#isEmpty()">isEmpty</a></code>&nbsp;in interface&nbsp;<code><a href="../util/ReadOnlyStringMap.html" title="interface in org.apache.logging.log4j.util">ReadOnlyStringMap</a></code></dd>
<dt>Specified by:</dt>
<dd><code><a href="ThreadContextMap.html#isEmpty()">isEmpty</a></code>&nbsp;in interface&nbsp;<code><a href="ThreadContextMap.html" title="interface in org.apache.logging.log4j.spi">ThreadContextMap</a></code></dd>
<dt>Returns:</dt>
<dd>true if the Map is empty, false otherwise.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="size()">
<h3>size</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">size</span>()</div>
<div class="block"><span class="descfrm-type-label">Description copied from interface:&nbsp;<code><a href="../util/ReadOnlyStringMap.html#size()">ReadOnlyStringMap</a></code></span></div>
<div class="block">Returns the number of key-value pairs in this collection.</div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="../util/ReadOnlyStringMap.html#size()">size</a></code>&nbsp;in interface&nbsp;<code><a href="../util/ReadOnlyStringMap.html" title="interface in org.apache.logging.log4j.util">ReadOnlyStringMap</a></code></dd>
<dt>Returns:</dt>
<dd>the number of key-value pairs in this collection.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="toString()">
<h3>toString</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span>&nbsp;<span class="element-name">toString</span>()</div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--" title="class or interface in java.lang" class="external-link">toString</a></code>&nbsp;in class&nbsp;<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></code></dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="hashCode()">
<h3>hashCode</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">hashCode</span>()</div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--" title="class or interface in java.lang" class="external-link">hashCode</a></code>&nbsp;in class&nbsp;<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></code></dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="equals(java.lang.Object)">
<h3>equals</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">equals</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>&nbsp;obj)</span></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-" title="class or interface in java.lang" class="external-link">equals</a></code>&nbsp;in class&nbsp;<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></code></dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
</ul>
</section>
<!-- ========= END OF CLASS DATA ========= -->
</main>
<footer role="contentinfo">
<hr>
<p class="legal-copy"><small><p align="center"> Copyright &copy; 1999-2024 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.<br/> Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation. </p></small></p>
</footer>
</div>
</div>
</body>
</html>