Package net.minestom.server.utils
Class ObjectPool<T>
java.lang.Object
net.minestom.server.utils.ObjectPool<T>
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
clear()
int
count()
get()
getAndRegister
(@NotNull Object ref) ObjectPool<T>.@NotNull Holder
hold()
static <T> ObjectPool
<T> static <T> ObjectPool
<T> pool
(Supplier<T> supplier, UnaryOperator<T> sanitizer) void
register
(@NotNull Object ref, @NotNull Collection<T> objects) void
register
(@NotNull Object ref, @NotNull AtomicReference<T> objectRef) void
<R> R
-
Method Details
-
pool
-
pool
-
get
-
getAndRegister
-
add
-
clear
public void clear() -
count
public int count() -
register
-
register
-
register
-
hold
-
use
-