Class StrongObject<T>

java.lang.Object
org.miaixz.bus.core.lang.ref.StrongObject<T>
Type Parameters:
T - 键类型
All Implemented Interfaces:
Ref<T>

public class StrongObject<T> extends Object implements Ref<T>
弱引用对象,在GC时发现弱引用会回收其对象
Since:
Java 17+
Author:
Kimi Liu
  • Constructor Details

    • StrongObject

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

    • get

      public T get()
      Description copied from interface: Ref
      获取引用的原始对象
      Specified by:
      get in interface Ref<T>
      Returns:
      原始对象
    • hashCode

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

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