Package jetbrains.buildServer.util
Class ObjectsPool<T>
- java.lang.Object
-
- jetbrains.buildServer.util.ObjectsPool<T>
-
public class ObjectsPool<T> extends Object
Auto-cleanable thread-safe implementation for deduplicate any objects (according to equals&hashcode methods). Usereuse(Object)
method for deduplication. The cache usesWeakHashMap
for storing duplicates, it stores same instance in key and value in weak references. So on reuse, it gets existing instance from map or puts if there are no instance and returns it. If deduplicated object is not reachable in application via strong reference GC will remove weak-reachable instances and standard java WeakHashMap implementation will remove map entry- Since:
- 2024.07
-
-
Constructor Summary
Constructors Constructor Description ObjectsPool()
-