public static interface ThreadContext.ContextStack
extends java.io.Serializable, java.util.Collection<java.lang.String>
Modifier and Type | Method and Description |
---|---|
java.util.List<java.lang.String> |
asList()
Returns all the elements in the stack in a List.
|
ThreadContext.ContextStack |
copy()
Returns a copy of the ContextStack.
|
int |
getDepth()
Returns the number of elements in the stack.
|
ThreadContext.ContextStack |
getImmutableStackOrNull()
Returns a ContextStack with the same contents as this ContextStack or
null . |
java.lang.String |
peek()
Returns the element at the top of the stack without removing it or null if the stack is empty.
|
java.lang.String |
pop()
Returns the element at the top of the stack.
|
void |
push(java.lang.String message)
Pushes an element onto the stack.
|
void |
trim(int depth)
Trims elements from the end of the stack.
|
java.lang.String pop()
java.util.NoSuchElementException
- if the stack is empty.java.lang.String peek()
void push(java.lang.String message)
message
- The element to add.int getDepth()
java.util.List<java.lang.String> asList()
void trim(int depth)
depth
- The maximum number of items in the stack to keep.ThreadContext.ContextStack copy()
ThreadContext.ContextStack getImmutableStackOrNull()
null
. Attempts to modify the
returned stack may or may not throw an exception, but will not affect the contents of this ContextStack.null
.