Package 

Class FactoryPools

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public interface FactoryPools.Factory

      Creates new instances of the given type.

      public interface FactoryPools.Resetter

      Resets state when objects are returned to the pool.

      public interface FactoryPools.Poolable

      Allows additional verification to catch errors caused by using objects while they are in anobject pool.

    • Method Summary

      Modifier and Type Method Description
      static <T extends FactoryPools.Poolable> Pools.Pool<T> simple(int size, @NonNull() FactoryPools.Factory<T> factory) Returns a non-thread safe Pool that never returns {@code null} from and that contains objects of the type created by the given Factory withthe given maximum size.
      static <T extends FactoryPools.Poolable> Pools.Pool<T> threadSafe(int size, @NonNull() FactoryPools.Factory<T> factory) Returns a new thread safe Pool that never returns {@code null} from and that contains objects of the type created by the given Factory withthe given maximum size.
      static <T> Pools.Pool<List<T>> threadSafeList() Returns a new Pool that never returns {@code null} and that contains Lists of a specific generic type with a standard maximum size of 20.
      static <T> Pools.Pool<List<T>> threadSafeList(int size) Returns a new thread safe Pool that never returns {@code null} and that contains Lists of a specific generic type with the given maximum size.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait