public static class ThreadContextStack.EmptyThreadContextStack extends AbstractCollection<String> implements ThreadContextStack
ThreadContextStack.EmptyIterator<E>, ThreadContextStack.EmptyThreadContextStack| Constructor and Description |
|---|
EmptyThreadContextStack() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(String e) |
boolean |
addAll(Collection<? extends String> c) |
List<String> |
asList()
Returns all the elements in the stack in a List.
|
boolean |
containsAll(Collection<?> c) |
ThreadContextStack |
copy()
Returns a copy of the ContextStack.
|
boolean |
equals(Object o) |
int |
getDepth()
Returns the number of elements in the stack.
|
ThreadContextStack |
getImmutableStackOrNull()
Returns a ContextStack with the same contents as this ContextStack or
null. |
int |
hashCode() |
Iterator<String> |
iterator() |
String |
peek()
Returns the element at the top of the stack without removing it or null if the stack is empty.
|
String |
pop()
Returns the element at the top of the stack.
|
ThreadContext.StoredContext |
preserveContext()
preserve thread context map and set default context
|
void |
push(String message)
Pushes an element onto the stack.
|
boolean |
removeAll(Collection<?> c) |
boolean |
retainAll(Collection<?> c) |
int |
size() |
ThreadContext.StoredContext |
storeContext()
preserve thread context map without default context
|
<T> T[] |
toArray(T[] a) |
void |
trim(int depth)
Trims elements from the end of the stack.
|
clear, contains, isEmpty, remove, toArray, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitclear, contains, isEmpty, parallelStream, remove, removeIf, spliterator, stream, toArraypublic ThreadContext.StoredContext preserveContext()
ThreadContextStackpreserveContext in interface ThreadContextStackpublic ThreadContext.StoredContext storeContext()
ThreadContextStackstoreContext in interface ThreadContextStackpublic String pop()
ThreadContextStackpop in interface ThreadContextStackpublic String peek()
ThreadContextStackpeek in interface ThreadContextStackpublic void push(String message)
ThreadContextStackpush in interface ThreadContextStackmessage - The element to add.public int getDepth()
ThreadContextStackgetDepth in interface ThreadContextStackpublic List<String> asList()
ThreadContextStackasList in interface ThreadContextStackpublic void trim(int depth)
ThreadContextStacktrim in interface ThreadContextStackdepth - The maximum number of items in the stack to keep.public boolean equals(Object o)
equals in interface Collection<String>equals in class Objectpublic int hashCode()
hashCode in interface Collection<String>hashCode in class Objectpublic ThreadContextStack copy()
ThreadContextStackcopy in interface ThreadContextStackpublic <T> T[] toArray(T[] a)
toArray in interface Collection<String>toArray in class AbstractCollection<String>public boolean add(String e)
add in interface Collection<String>add in class AbstractCollection<String>public boolean containsAll(Collection<?> c)
containsAll in interface Collection<String>containsAll in class AbstractCollection<String>public boolean addAll(Collection<? extends String> c)
addAll in interface Collection<String>addAll in class AbstractCollection<String>public boolean removeAll(Collection<?> c)
removeAll in interface Collection<String>removeAll in class AbstractCollection<String>public boolean retainAll(Collection<?> c)
retainAll in interface Collection<String>retainAll in class AbstractCollection<String>public Iterator<String> iterator()
iterator in interface Iterable<String>iterator in interface Collection<String>iterator in class AbstractCollection<String>public int size()
size in interface Collection<String>size in class AbstractCollection<String>public ThreadContextStack getImmutableStackOrNull()
ThreadContextStacknull. Attempts to modify the
returned stack may or may not throw an exception, but will not affect the contents of this ContextStack.getImmutableStackOrNull in interface ThreadContextStacknull.Copyright © 2022. All rights reserved.