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>
static class BaseGenericObjectPool.IdentityWrapper<T> extends java.lang.ObjectWrapper 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.
-
-
Constructor Summary
Constructors Constructor Description IdentityWrapper(T object)Constructs a wrapper for an instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object other)(package private) TgetObject()inthashCode()java.lang.StringtoString()(package private) static <T> BaseGenericObjectPool.IdentityWrapper<T>unwrap(PooledObject<T> p)Creates a new instance for the object inside aPooledObject.
-
-
-
Field Detail
-
object
private final T object
Wrapped object
-
-
Constructor Detail
-
IdentityWrapper
IdentityWrapper(T object)
Constructs a wrapper for an instance.- Parameters:
object- object to wrap
-
-
Method Detail
-
unwrap
static <T> BaseGenericObjectPool.IdentityWrapper<T> unwrap(PooledObject<T> p)
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
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
getObject
T getObject()
- Returns:
- the wrapped object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-