Module bus.core

Class SimplePoolable<T>

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

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

    • SimplePoolable

      public SimplePoolable(T raw)
      构造
      Parameters:
      raw - 原始对象
  • Method Details

    • getRaw

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

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

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