Class LinkResolveCounter


  • public final class LinkResolveCounter
    extends java.lang.Object
    Counts number of recursive link resolve requests to detect endless loops. Max. 5 hops are allowed in isMaximumReached() method.
    • Constructor Detail

      • LinkResolveCounter

        public LinkResolveCounter()
    • Method Detail

      • getCount

        public int getCount()
        Returns:
        Counter value
      • increaseCount

        public void increaseCount()
        Increase counter by 1.
      • decreaseCount

        public void decreaseCount()
        Decrease counter by 1. If 0 is reached the counter instance is removed from the current thread.
      • isMaximumReached

        public boolean isMaximumReached()
        Returns:
        true if maximum of allowed recursion steps is reached.
      • get

        @NotNull
        public static @NotNull LinkResolveCounter get()
        Returns:
        Counter for current request/thread. If instance was not set in thread before it is newly created and attached to the current thread.