Class StackUtils

  • Direct Known Subclasses:
    StackUtilsImpl

    class StackUtils
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static StackUtils INSTANCE  
    • Constructor Summary

      Constructors 
      Constructor Description
      StackUtils()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean wasInvokedFrom​(java.lang.String className, java.lang.String methodName, int limit)
      Checks whether current method was invoked from the given class and method.
      static boolean wasInvokedFrom​(java.util.function.BiPredicate<java.lang.String,​java.lang.String> predicate, int limit)
      Checks whether current method was invoked from a class and method using the given predicate, which gets the class name of the stack frame as first parameter and the method name as second parameter.
      (package private) boolean wasInvokedFromImpl​(java.util.function.BiPredicate<java.lang.String,​java.lang.String> predicate, int limit)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • INSTANCE

        private static final StackUtils INSTANCE
    • Constructor Detail

      • StackUtils

        StackUtils()
    • Method Detail

      • wasInvokedFrom

        public static boolean wasInvokedFrom​(java.lang.String className,
                                             java.lang.String methodName,
                                             int limit)
        Checks whether current method was invoked from the given class and method.
      • wasInvokedFrom

        public static boolean wasInvokedFrom​(java.util.function.BiPredicate<java.lang.String,​java.lang.String> predicate,
                                             int limit)
        Checks whether current method was invoked from a class and method using the given predicate, which gets the class name of the stack frame as first parameter and the method name as second parameter.
      • wasInvokedFromImpl

        boolean wasInvokedFromImpl​(java.util.function.BiPredicate<java.lang.String,​java.lang.String> predicate,
                                   int limit)