blob: c5ad6da833c4a199f749b8cacfeb1bb0bf09fb70 [file] [log] [blame]
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) -->
<title>ThreadContext.ContextStack (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, class: ThreadContext, interface: ContextStack">
<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/ThreadContext.ContextStack.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>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method-summary">Method</a></li>
</ul>
<ul class="sub-nav-list">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&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</a></div>
<h1 title="Interface ThreadContext.ContextStack" class="title">Interface ThreadContext.ContextStack</h1>
</div>
<section class="class-description" id="class-description">
<dl class="notes">
<dt>All Superinterfaces:</dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html" title="class or interface in java.util" class="external-link">Collection</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;</code>, <code><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;</code>, <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></dd>
</dl>
<dl class="notes">
<dt>All Known Subinterfaces:</dt>
<dd><code><a href="spi/ThreadContextStack.html" title="interface in org.apache.logging.log4j.spi">ThreadContextStack</a></code></dd>
</dl>
<dl class="notes">
<dt>All Known Implementing Classes:</dt>
<dd><code><a href="spi/DefaultThreadContextStack.html" title="class in org.apache.logging.log4j.spi">DefaultThreadContextStack</a></code>, <code><a href="spi/MutableThreadContextStack.html" title="class in org.apache.logging.log4j.spi">MutableThreadContextStack</a></code></dd>
</dl>
<dl class="notes">
<dt>Enclosing class:</dt>
<dd><a href="ThreadContext.html" title="class in org.apache.logging.log4j">ThreadContext</a></dd>
</dl>
<hr>
<div class="type-signature"><span class="modifiers">public static interface </span><span class="element-name type-name-label">ThreadContext.ContextStack</span><span class="extends-implements">
extends <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>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html" title="class or interface in java.util" class="external-link">Collection</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;</span></div>
<div class="block">The ThreadContext Stack interface.</div>
</section>
<section class="summary">
<ul class="summary-list">
<!-- ========== 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-tab3" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab3', 3)" class="table-tab">Abstract 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-tab3"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html" title="class or interface in java.util" class="external-link">List</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;</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#asList()" class="member-name-link">asList</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Returns all the elements in the stack in a List.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="ThreadContext.ContextStack.html" title="interface in org.apache.logging.log4j">ThreadContext.ContextStack</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#copy()" class="member-name-link">copy</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Returns a copy of the ContextStack.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>int</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#getDepth()" class="member-name-link">getDepth</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Returns the number of elements in the stack.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="ThreadContext.ContextStack.html" title="interface in org.apache.logging.log4j">ThreadContext.ContextStack</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#getImmutableStackOrNull()" class="member-name-link">getImmutableStackOrNull</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Returns a ContextStack with the same contents as this ContextStack or <code>null</code>.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><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 even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#peek()" class="member-name-link">peek</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Returns the element at the top of the stack without removing it or null if the stack is empty.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><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-tab3"><code><a href="#pop()" class="member-name-link">pop</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Returns the element at the top of the stack.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#push(java.lang.String)" class="member-name-link">push</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;message)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Pushes an element onto the stack.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#trim(int)" class="member-name-link">trim</a><wbr>(int&nbsp;depth)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Trims elements from the end of the stack.</div>
</div>
</div>
</div>
</div>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-java.util.Collection">Methods inherited from interface&nbsp;java.util.<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html" title="class or interface in java.util" class="external-link">Collection</a></h3>
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html#add-E-" title="class or interface in java.util" class="external-link">add</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html#addAll-java.util.Collection-" title="class or interface in java.util" class="external-link">addAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html#clear--" title="class or interface in java.util" class="external-link">clear</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html#contains-java.lang.Object-" title="class or interface in java.util" class="external-link">contains</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html#containsAll-java.util.Collection-" title="class or interface in java.util" class="external-link">containsAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html#equals-java.lang.Object-" title="class or interface in java.util" class="external-link">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html#hashCode--" title="class or interface in java.util" class="external-link">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html#isEmpty--" title="class or interface in java.util" class="external-link">isEmpty</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html#iterator--" title="class or interface in java.util" class="external-link">iterator</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html#parallelStream--" title="class or interface in java.util" class="external-link">parallelStream</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html#remove-java.lang.Object-" title="class or interface in java.util" class="external-link">remove</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html#removeAll-java.util.Collection-" title="class or interface in java.util" class="external-link">removeAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html#removeIf-java.util.function.Predicate-" title="class or interface in java.util" class="external-link">removeIf</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html#retainAll-java.util.Collection-" title="class or interface in java.util" class="external-link">retainAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html#size--" title="class or interface in java.util" class="external-link">size</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html#spliterator--" title="class or interface in java.util" class="external-link">spliterator</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html#stream--" title="class or interface in java.util" class="external-link">stream</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html#toArray--" title="class or interface in java.util" class="external-link">toArray</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html#toArray-T:A-" title="class or interface in java.util" class="external-link">toArray</a></code></div>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-java.lang.Iterable">Methods inherited from interface&nbsp;java.lang.<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></h3>
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html#forEach-java.util.function.Consumer-" title="class or interface in java.lang" class="external-link">forEach</a></code></div>
</section>
</li>
</ul>
</section>
<section class="details">
<ul class="details-list">
<!-- ============ METHOD DETAIL ========== -->
<li>
<section class="method-details" id="method-detail">
<h2>Method Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="pop()">
<h3>pop</h3>
<div class="member-signature"><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">pop</span>()</div>
<div class="block">Returns the element at the top of the stack.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>The element at the top of the stack.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/NoSuchElementException.html" title="class or interface in java.util" class="external-link">NoSuchElementException</a></code> - if the stack is empty.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="peek()">
<h3>peek</h3>
<div class="member-signature"><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">peek</span>()</div>
<div class="block">Returns the element at the top of the stack without removing it or null if the stack is empty.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>the element at the top of the stack or null if the stack is empty.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="push(java.lang.String)">
<h3>push</h3>
<div class="member-signature"><span class="return-type">void</span>&nbsp;<span class="element-name">push</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;message)</span></div>
<div class="block">Pushes an element onto the stack.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>message</code> - The element to add.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getDepth()">
<h3>getDepth</h3>
<div class="member-signature"><span class="return-type">int</span>&nbsp;<span class="element-name">getDepth</span>()</div>
<div class="block">Returns the number of elements in the stack.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>the number of elements in the stack.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="asList()">
<h3>asList</h3>
<div class="member-signature"><span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html" title="class or interface in java.util" class="external-link">List</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;</span>&nbsp;<span class="element-name">asList</span>()</div>
<div class="block">Returns all the elements in the stack in a List.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>all the elements in the stack in a List.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="trim(int)">
<h3>trim</h3>
<div class="member-signature"><span class="return-type">void</span>&nbsp;<span class="element-name">trim</span><wbr><span class="parameters">(int&nbsp;depth)</span></div>
<div class="block">Trims elements from the end of the stack.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>depth</code> - The maximum number of items in the stack to keep.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="copy()">
<h3>copy</h3>
<div class="member-signature"><span class="return-type"><a href="ThreadContext.ContextStack.html" title="interface in org.apache.logging.log4j">ThreadContext.ContextStack</a></span>&nbsp;<span class="element-name">copy</span>()</div>
<div class="block">Returns a copy of the ContextStack.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>a copy of the ContextStack.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getImmutableStackOrNull()">
<h3>getImmutableStackOrNull</h3>
<div class="member-signature"><span class="return-type"><a href="ThreadContext.ContextStack.html" title="interface in org.apache.logging.log4j">ThreadContext.ContextStack</a></span>&nbsp;<span class="element-name">getImmutableStackOrNull</span>()</div>
<div class="block">Returns a ContextStack with the same contents as this ContextStack or <code>null</code>. Attempts to modify the
returned stack may or may not throw an exception, but will not affect the contents of this ContextStack.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>a ContextStack with the same contents as this ContextStack or <code>null</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>