Class BaseGenericObjectPool.IdentityWrapper<T>

java.lang.Object
org.datanucleus.store.rdbms.datasource.dbcp2.pool2.impl.BaseGenericObjectPool.IdentityWrapper<T>
Type Parameters:
T - type of objects in the pool
Enclosing class:
BaseGenericObjectPool<T>

static class BaseGenericObjectPool.IdentityWrapper<T> extends Object
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 Details

    • instance

      private final T instance
      Wrapped object
  • Constructor Details

    • IdentityWrapper

      public IdentityWrapper(T instance)
      Create a wrapper for an instance.
      Parameters:
      instance - object to wrap
  • Method Details

    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • getObject

      public T getObject()
      Returns:
      the wrapped object
    • toString

      public String toString()
      Overrides:
      toString in class Object