Class PoolableWrapper<T>

java.lang.Object
com.landawn.abacus.pool.AbstractPoolable
com.landawn.abacus.pool.PoolableWrapper<T>
Type Parameters:
T -
All Implemented Interfaces:
Poolable, Immutable

@Immutable public final class PoolableWrapper<T> extends AbstractPoolable implements Immutable
Since:
0.8
Author:
Haiyang Li
  • Constructor Summary

    Constructors
    Constructor
    Description
    PoolableWrapper(T srcObject)
    Wrap the the source object with Long.MAX_VALUE liveTime and Long.MAX_VALUE maxIdleTime.
    PoolableWrapper(T srcObject, long liveTime, long maxIdleTime)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Destroy.
    boolean
     
    int
     
    static <T> PoolableWrapper<T>
    of(T srcObject)
    Wrap the the source object with Long.MAX_VALUE liveTime and Long.MAX_VALUE maxIdleTime.
    static <T> PoolableWrapper<T>
    of(T srcObject, long liveTime, long maxIdleTime)
    Wrap the the source object with specified liveTime and maxIdleTime.
     
     

    Methods inherited from class com.landawn.abacus.pool.AbstractPoolable

    activityPrint

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • PoolableWrapper

      public PoolableWrapper(T srcObject)
      Wrap the the source object with Long.MAX_VALUE liveTime and Long.MAX_VALUE maxIdleTime.
      Parameters:
      srcObject -
    • PoolableWrapper

      public PoolableWrapper(T srcObject, long liveTime, long maxIdleTime)
      Parameters:
      srcObject -
      liveTime -
      maxIdleTime -
  • Method Details

    • of

      public static <T> PoolableWrapper<T> of(T srcObject)
      Wrap the the source object with Long.MAX_VALUE liveTime and Long.MAX_VALUE maxIdleTime.
      Type Parameters:
      T -
      Parameters:
      srcObject -
      Returns:
    • of

      public static <T> PoolableWrapper<T> of(T srcObject, long liveTime, long maxIdleTime)
      Wrap the the source object with specified liveTime and maxIdleTime.
      Type Parameters:
      T -
      Parameters:
      srcObject -
      liveTime -
      maxIdleTime -
      Returns:
    • value

      public T value()
      Returns:
      T
    • destroy

      public void destroy()
      Destroy.
      Specified by:
      destroy in interface Poolable
    • hashCode

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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
      Parameters:
      obj -
      Returns:
      true, if successful
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns: