Interface Ref<T>

  • Type Parameters:
    T - referent class.
    All Known Implementing Classes:
    StrongRef, WeakRef

    public interface Ref<T>
    An abstraction for (weak or strong) references.

    This class allows for treating normal ("strong") references the same way as WeakReferences.

    • Method Detail

      • get

        @Nullable T get()
        Retrieves the referent. In case of WeakRefs, the return value may become null.
        Returns:
        the referent.