Interface References.InternalReference<E>

    • Method Detail

      • get

        @CheckForNull
        E get()
        Returns this reference object's referent. If this reference object has been cleared, either by the program or by the garbage collector, then this method returns null.
        Returns:
        The object to which this reference refers, or null if this reference object has been cleared
      • getKeyReference

        @Nonnull
        java.lang.Object getKeyReference()
        Returns the key that is associated to the cache entry holding this reference. If the cache holds keys strongly, this is that key instance. Otherwise the cache holds keys weakly and the References.WeakKeyReference is returned.
        Returns:
        the key that is associated to the cached entry
      • referenceEquals

        default boolean referenceEquals​(@Nullable
                                        java.lang.Object object)
        Returns true if the arguments is an References.InternalReference that holds the same element. A weakly or softly held element is compared using identity equality.
        Parameters:
        object - the reference object with which to compare
        Returns:
        true if this object is the same as the argument; false otherwise