Interface Reference<T,A>

Type Parameters:
T - the reference value type
A - the attachment type
All Known Implementing Classes:
CleanerReference, PhantomReference, SoftReference, StrongReference, WeakReference

@Deprecated(forRemoval=true) public interface Reference<T,A>
Deprecated, for removal: This API element is subject to removal in a future version.
Use Reference instead.
An enhanced reference type with a type-safe attachment.
Author:
David M. Lloyd
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
    Deprecated, for removal: This API element is subject to removal in a future version.
    A reference type.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Clear the reference.
    get()
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the value, or null if the reference has been cleared.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the attachment, if any.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the type of the reference.
  • Method Details

    • get

      T get()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the value, or null if the reference has been cleared.
      Returns:
      the value
    • getAttachment

      A getAttachment()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the attachment, if any.
      Returns:
      the attachment
    • clear

      void clear()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Clear the reference.
    • getType

      Reference.Type getType()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the type of the reference.
      Returns:
      the type