PoolManager#addPool(Class, PoolSupplier)/PoolManager#addPool(Class, Pool).
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public <T> void | addPool(Class<T> poolClass, DefaultPool.
Registers a new pool with the given supplier. |
| public <T> void | |
| public void | |
| public <T> void | |
| public <T> Pool | |
| public <T> Pool | |
| public boolean | |
| public <T> T | |
| public <T> T |
| typePools | back to summary |
|---|---|
| private final ObjectMap<Class<?>, Pool<?>> typePools | |
| PoolManager | back to summary |
|---|---|
| public PoolManager() | |
| addPool | back to summary |
|---|---|
| public <T> void addPool(Class<T> poolClass, DefaultPool. Registers a new pool with the given supplier. Will throw an exception, if a pool for the same class is already registered. This can be used like `PoolManager#addPoll(MyClass::new);` | |
| addPool | back to summary |
|---|---|
| public <T> void addPool(Class<T> poolClass, Pool<T> pool) Registers the new pool. Will throw an exception, if a pool for the same class is already registered | |
| clear | back to summary |
|---|---|
| public void clear() Clears all contents of the managed pools | |
| free | back to summary |
|---|---|
| public <T> void free(T object) Frees a pooled object. Will throw an exception, if no pool for this class is registered. It is unchecked, whether the object was obtained by the registered pool. | |
| getPool | back to summary |
|---|---|
| public <T> Pool Returns the pool registered for the class. Will throw an exception, if no pool for this class is registered | |
| getPoolOrNull | back to summary |
|---|---|
| public <T> Pool Returns the pool registered for the class. Will return null, if no pool for this class is registered | |
| hasPool | back to summary |
|---|---|
| public boolean hasPool(Class<?> clazz) Whether a pool for this class is already registered | |
| obtain | back to summary |
|---|---|
| public <T> T obtain(Class<T> clazz) Returns a new pooled object for the class. Will throw an exception, if no pool for this class is registered. Free with
| |
| obtainOrNull | back to summary |
|---|---|
| public <T> T obtainOrNull(Class<T> clazz) Returns a new pooled object for the class. Will return null, if no pool for this class is registered. Free with
| |