Package org.wildfly.common.ref
Class References
java.lang.Object
org.wildfly.common.ref.References
Deprecated, for removal: This API element is subject to removal in a future version.
A set of utility methods for reference types.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <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.
-
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 isReference.Type.STRONGorReference.Type.NULLthen the reaper argument is ignored. If the reference type isReference.Type.NULLthen the value and attachment arguments are ignored.- Type Parameters:
T- the reference value typeA- the reference attachment type- Parameters:
type- the reference typevalue- the reference valueattachment- the attachment valuereaper- 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 isReference.Type.STRONGorReference.Type.NULLthen the reference queue argument is ignored. If the reference type isReference.Type.NULLthen the value and attachment arguments are ignored.- Type Parameters:
T- the reference value typeA- the reference attachment type- Parameters:
type- the reference typevalue- the reference valueattachment- the attachment valuereferenceQueue- the reference queue to use, if any- Returns:
- the reference
-
create
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 isReference.Type.PHANTOMthen this method will return anullreference because such references are not constructable without a queue or reaper. If the reference type isReference.Type.NULLthen the value and attachment arguments are ignored.- Type Parameters:
T- the reference value typeA- the reference attachment type- Parameters:
type- the reference typevalue- the reference valueattachment- the attachment value- Returns:
- the reference
-
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 typeA- the attachment value type- Returns:
- the null reference
-
Referencesinstead.