Class ThreadNumToInteger

  • All Implemented Interfaces:
    java.util.function.LongFunction<java.lang.Integer>

    public class ThreadNumToInteger
    extends java.lang.Object
    implements java.util.function.LongFunction<java.lang.Integer>
    Matches a digit sequence in the current thread name and caches it in a thread local. This allows you to use any intentionally indexed thread factories to provide an analogue for concurrency. Note that once the thread number is cached, it will not be refreshed. This means you can't change the thread name and get an updated value.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Integer apply​(long value)  
      • Methods inherited from class java.lang.Object

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

      • ThreadNumToInteger

        public ThreadNumToInteger()
    • Method Detail

      • apply

        public java.lang.Integer apply​(long value)
        Specified by:
        apply in interface java.util.function.LongFunction<java.lang.Integer>