public class DefaultThreadContextStack extends Object implements ThreadContextStack
ThreadContextStack.EmptyIterator<E>, ThreadContextStack.EmptyThreadContextStack| Constructor and Description |
|---|
DefaultThreadContextStack() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(String s) |
boolean |
addAll(Collection<? extends String> strings) |
List<String> |
asList()
Returns all the elements in the stack in a List.
|
void |
clear() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> objects) |
ThreadContextStack |
copy()
Returns a copy of the ContextStack.
|
boolean |
equals(Object obj) |
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() |
boolean |
isEmpty() |
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 context for later store then clear current thread context stack.
|
void |
push(String message)
Pushes an element onto the stack.
|
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> objects) |
boolean |
retainAll(Collection<?> objects) |
int |
size() |
ThreadContext.StoredContext |
storeContext()
preserve thread context map without default context
|
Object[] |
toArray() |
<T> T[] |
toArray(T[] ts) |
String |
toString() |
void |
trim(int depth)
Trims elements from the end of the stack.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitparallelStream, removeIf, spliterator, streampublic ThreadContext.StoredContext preserveContext()
preserveContext in interface ThreadContextStackpublic ThreadContext.StoredContext storeContext()
ThreadContextStackstoreContext in interface ThreadContextStackpublic boolean add(String s)
add in interface Collection<String>public boolean addAll(Collection<? extends String> strings)
addAll in interface Collection<String>public List<String> asList()
ThreadContextStackasList in interface ThreadContextStackpublic void clear()
clear in interface Collection<String>public boolean contains(Object o)
contains in interface Collection<String>public boolean containsAll(Collection<?> objects)
containsAll in interface Collection<String>public ThreadContextStack copy()
ThreadContextStackcopy in interface ThreadContextStackpublic boolean equals(Object obj)
equals in interface Collection<String>equals in class Objectpublic int getDepth()
ThreadContextStackgetDepth in interface ThreadContextStackpublic int hashCode()
hashCode in interface Collection<String>hashCode in class Objectpublic boolean isEmpty()
isEmpty in interface Collection<String>public String peek()
ThreadContextStackpeek in interface ThreadContextStackpublic String pop()
ThreadContextStackpop in interface ThreadContextStackpublic void push(String message)
ThreadContextStackpush in interface ThreadContextStackmessage - The element to add.public boolean remove(Object o)
remove in interface Collection<String>public boolean removeAll(Collection<?> objects)
removeAll in interface Collection<String>public boolean retainAll(Collection<?> objects)
retainAll in interface Collection<String>public int size()
size in interface Collection<String>public Object[] toArray()
toArray in interface Collection<String>public <T> T[] toArray(T[] ts)
toArray in interface Collection<String>public void trim(int depth)
ThreadContextStacktrim in interface ThreadContextStackdepth - The maximum number of items in the stack to keep.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.