Package org.apache.commons.pool2.impl
Class BaseGenericObjectPool.IdentityWrapper<T>
java.lang.Object
org.apache.commons.pool2.impl.BaseGenericObjectPool.IdentityWrapper<T>
- Type Parameters:
T- type of objects in the pool
- Enclosing class:
BaseGenericObjectPool<T>
Wrapper for objects under management by the pool.
GenericObjectPool and GenericKeyedObjectPool maintain references to all
objects under management using maps keyed on the objects. This wrapper
class ensures that objects can work as hash keys.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean(package private) TinthashCode()toString()(package private) static <T> BaseGenericObjectPool.IdentityWrapper<T> unwrap(PooledObject<T> p) Creates a new instance for the object inside aPooledObject.
-
Field Details
-
object
Wrapped object
-
-
Constructor Details
-
IdentityWrapper
IdentityWrapper(T object) Constructs a wrapper for an instance.- Parameters:
object- object to wrap
-
-
Method Details
-
unwrap
Creates a new instance for the object inside aPooledObject.- Type Parameters:
T- The type of the object in thePooledObject.- Parameters:
p- ThePooledObject.- Returns:
- a new instance.
-
equals
-
getObject
T getObject()- Returns:
- the wrapped object
-
hashCode
public int hashCode() -
toString
-