Class FormatThreadLocal<T extends java.text.Format>

  • Type Parameters:
    T - the type of formatter to provide

    public class FormatThreadLocal<T extends java.text.Format>
    extends java.lang.ThreadLocal<T>
    Thread local implementation to use prototypes of Format subclasses that are not thread safe by themselves. Use ThreadLocal.get() on an instance of this class to get a thread local formatter instance.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private T prototype  
    • Constructor Summary

      Constructors 
      Constructor Description
      FormatThreadLocal​(T prototype)
      Create a new thread local formatter generator.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected T initialValue()  
      • Methods inherited from class java.lang.ThreadLocal

        get, remove, set, withInitial
      • Methods inherited from class java.lang.Object

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

      • prototype

        private final T extends java.text.Format prototype
    • Constructor Detail

      • FormatThreadLocal

        public FormatThreadLocal​(T prototype)
        Create a new thread local formatter generator.
        Parameters:
        prototype - prototype to use when getting a formatter
    • Method Detail

      • initialValue

        protected T initialValue()
        Overrides:
        initialValue in class java.lang.ThreadLocal<T extends java.text.Format>