|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public static interface ThreadContext.ContextStack
The ThreadContext Stack interface.
Method Summary | |
---|---|
List<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 . |
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. |
void |
push(String message)
Pushes an element onto the stack. |
void |
trim(int depth)
Trims elements from the end of the stack. |
Methods inherited from interface java.util.Collection |
---|
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
Method Detail |
---|
String pop()
NoSuchElementException
- if the stack is empty.String peek()
void push(String message)
message
- The element to add.int getDepth()
List<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
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1999-2014 Apache Software Foundation. All Rights Reserved.
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.