Class ObjectPool<T>


  • class ObjectPool<T>
    extends java.lang.Object
    Pool of immutable object instances, used to avoid excessive memory consumption of (dirty) dependency graph which tends to have many duplicate artifacts/dependencies.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Map<java.lang.Object,​java.lang.ref.Reference<T>> objects  
    • Constructor Summary

      Constructors 
      Constructor Description
      ObjectPool()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T intern​(T object)  
      • Methods inherited from class java.lang.Object

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

      • objects

        private final java.util.Map<java.lang.Object,​java.lang.ref.Reference<T>> objects
    • Constructor Detail

      • ObjectPool

        ObjectPool()
    • Method Detail

      • intern

        public T intern​(T object)