Class ThreadContext.EmptyThreadContextStack

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static long serialVersionUID  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean add​(java.lang.String ignored)  
      boolean addAll​(java.util.Collection<? extends java.lang.String> ignored)  
      java.util.List<java.lang.String> asList()
      Returns all the elements in the stack in a List.
      void clear()  
      boolean containsAll​(java.util.Collection<?> ignored)  
      ThreadContext.ContextStack copy()
      Returns a copy of the ContextStack.
      boolean equals​(java.lang.Object o)  
      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.
      int hashCode()  
      java.util.Iterator<java.lang.String> iterator()  
      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.
      boolean removeAll​(java.util.Collection<?> ignored)  
      boolean retainAll​(java.util.Collection<?> ignored)  
      int size()  
      <T> T[] toArray​(T[] ignored)  
      void trim​(int depth)
      Trims elements from the end of the stack.
      • Methods inherited from class java.util.AbstractCollection

        contains, isEmpty, remove, toArray, toString
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        contains, isEmpty, parallelStream, remove, removeIf, spliterator, stream, toArray, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
    • Constructor Detail

      • EmptyThreadContextStack

        private EmptyThreadContextStack()
    • Method Detail

      • peek

        public java.lang.String peek()
        Description copied from interface: ThreadContext.ContextStack
        Returns the element at the top of the stack without removing it or null if the stack is empty.
        Specified by:
        peek in interface ThreadContext.ContextStack
        Returns:
        the element at the top of the stack or null if the stack is empty.
      • equals

        public boolean equals​(java.lang.Object o)
        Specified by:
        equals in interface java.util.Collection<java.lang.String>
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface java.util.Collection<java.lang.String>
        Overrides:
        hashCode in class java.lang.Object
      • toArray

        public <T> T[] toArray​(T[] ignored)
        Specified by:
        toArray in interface java.util.Collection<java.lang.String>
        Overrides:
        toArray in class java.util.AbstractCollection<java.lang.String>
      • add

        public boolean add​(java.lang.String ignored)
        Specified by:
        add in interface java.util.Collection<java.lang.String>
        Overrides:
        add in class java.util.AbstractCollection<java.lang.String>
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Collection<java.lang.String>
        Overrides:
        clear in class java.util.AbstractCollection<java.lang.String>
      • containsAll

        public boolean containsAll​(java.util.Collection<?> ignored)
        Specified by:
        containsAll in interface java.util.Collection<java.lang.String>
        Overrides:
        containsAll in class java.util.AbstractCollection<java.lang.String>
      • addAll

        public boolean addAll​(java.util.Collection<? extends java.lang.String> ignored)
        Specified by:
        addAll in interface java.util.Collection<java.lang.String>
        Overrides:
        addAll in class java.util.AbstractCollection<java.lang.String>
      • removeAll

        public boolean removeAll​(java.util.Collection<?> ignored)
        Specified by:
        removeAll in interface java.util.Collection<java.lang.String>
        Overrides:
        removeAll in class java.util.AbstractCollection<java.lang.String>
      • retainAll

        public boolean retainAll​(java.util.Collection<?> ignored)
        Specified by:
        retainAll in interface java.util.Collection<java.lang.String>
        Overrides:
        retainAll in class java.util.AbstractCollection<java.lang.String>
      • iterator

        public java.util.Iterator<java.lang.String> iterator()
        Specified by:
        iterator in interface java.util.Collection<java.lang.String>
        Specified by:
        iterator in interface java.lang.Iterable<java.lang.String>
        Specified by:
        iterator in class java.util.AbstractCollection<java.lang.String>
      • size

        public int size()
        Specified by:
        size in interface java.util.Collection<java.lang.String>
        Specified by:
        size in class java.util.AbstractCollection<java.lang.String>
      • getImmutableStackOrNull

        public ThreadContext.ContextStack getImmutableStackOrNull()
        Description copied from interface: ThreadContext.ContextStack
        Returns a ContextStack with the same contents as this ContextStack or null. Attempts to modify the returned stack may or may not throw an exception, but will not affect the contents of this ContextStack.
        Specified by:
        getImmutableStackOrNull in interface ThreadContext.ContextStack
        Returns:
        a ContextStack with the same contents as this ContextStack or null.