Class PartitionPoolable<T>

java.lang.Object
org.miaixz.bus.core.lang.pool.partition.PartitionPoolable<T>
Type Parameters:
T - 对象类型
All Implemented Interfaces:
Poolable<T>, Wrapper<T>, Provider

public class PartitionPoolable<T> extends Object implements Poolable<T>
分区可池化对象,此对象会同时持有原始对象和所在的分区
Since:
Java 17+
Author:
Kimi Liu
  • Constructor Details

    • PartitionPoolable

      public PartitionPoolable(T raw, PoolPartition<T> partition)
      构造
      Parameters:
      raw - 原始对象
      partition - 对象所在分区
  • Method Details

    • getRaw

      public T getRaw()
      Description copied from interface: Wrapper
      获取原始对象
      Specified by:
      getRaw in interface Wrapper<T>
      Returns:
      原始对象
    • returnObject

      public void returnObject()
      归还对象
    • getLastBorrow

      public long getLastBorrow()
      Description copied from interface: Poolable
      获取最后借出时间
      Specified by:
      getLastBorrow in interface Poolable<T>
      Returns:
      最后借出时间
    • setLastBorrow

      public void setLastBorrow(long lastBorrow)
      Description copied from interface: Poolable
      设置最后借出时间,在成功借出此对象时更新时间
      Specified by:
      setLastBorrow in interface Poolable<T>
      Parameters:
      lastBorrow - 最后借出时间