Class References

java.lang.Object
org.wildfly.common.ref.References

@Deprecated(forRemoval=true) public final class References extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
Use References instead.
A set of utility methods for reference types.
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T, A> Reference<T,A>
    create(Reference.Type type, T value, A attachment)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Create a reference of a given type with the provided value and attachment.
    static <T, A> Reference<T,A>
    create(Reference.Type type, T value, A attachment, ReferenceQueue<? super T> referenceQueue)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Create a reference of a given type with the provided value and attachment.
    static <T, A> Reference<T,A>
    create(Reference.Type type, T value, A attachment, Reaper<T,A> reaper)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Create a reference of a given type with the provided value and attachment.
    static <T, A> Reference<T,A>
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get a null reference.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • create

      public static <T, A> Reference<T,A> create(Reference.Type type, T value, A attachment, Reaper<T,A> reaper)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Create a reference of a given type with the provided value and attachment. If the reference type is Reference.Type.STRONG or Reference.Type.NULL then the reaper argument is ignored. If the reference type is Reference.Type.NULL then the value and attachment arguments are ignored.
      Type Parameters:
      T - the reference value type
      A - the reference attachment type
      Parameters:
      type - the reference type
      value - the reference value
      attachment - the attachment value
      reaper - the reaper to use, if any
      Returns:
      the reference
    • create

      public static <T, A> Reference<T,A> create(Reference.Type type, T value, A attachment, ReferenceQueue<? super T> referenceQueue)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Create a reference of a given type with the provided value and attachment. If the reference type is Reference.Type.STRONG or Reference.Type.NULL then the reference queue argument is ignored. If the reference type is Reference.Type.NULL then the value and attachment arguments are ignored.
      Type Parameters:
      T - the reference value type
      A - the reference attachment type
      Parameters:
      type - the reference type
      value - the reference value
      attachment - the attachment value
      referenceQueue - the reference queue to use, if any
      Returns:
      the reference
    • create

      public static <T, A> Reference<T,A> create(Reference.Type type, T value, A attachment)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Create a reference of a given type with the provided value and attachment. If the reference type is Reference.Type.PHANTOM then this method will return a null reference because such references are not constructable without a queue or reaper. If the reference type is Reference.Type.NULL then the value and attachment arguments are ignored.
      Type Parameters:
      T - the reference value type
      A - the reference attachment type
      Parameters:
      type - the reference type
      value - the reference value
      attachment - the attachment value
      Returns:
      the reference
    • getNullReference

      public static <T, A> Reference<T,A> getNullReference()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get a null reference. This reference type is always cleared and does not retain an attachment; as such there is only one single instance of it.
      Type Parameters:
      T - the reference value type
      A - the attachment value type
      Returns:
      the null reference