Class ObjectPool


  • public class ObjectPool
    extends Object
    An object pool maps classes and names to instances. An object pool can be prepared without actually instantiating the instances. Instead an object pool defer object instantiation to when the first instance is requested. This class can be used in complex assignments, when there are many classes involved and when there is need to share a test fixture between several test classes.
    • Method Detail

      • get

        public <T> T get​(Class<? extends T> clazz,
                         String name)
      • put

        public <T> T put​(Class<? extends T> clazz,
                         String name,
                         T val)