T - The referent type.public class CollectableReference<T> extends PhantomReference<T>
CollectableReference<String> collectableReference = new CollectableReference<>(new String("Hello world"));
System.out.println(collectableReference.get());
assertThat(collectableReference, is(eventually(collectedByGc())));
| Constructor and Description |
|---|
CollectableReference(T referent) |
| Modifier and Type | Method and Description |
|---|---|
static org.hamcrest.Matcher<CollectableReference> |
collectedByGc() |
T |
get() |
clear, enqueue, isEnqueuedpublic CollectableReference(T referent)
public T get()
get in class PhantomReference<T>public static org.hamcrest.Matcher<CollectableReference> collectedByGc()
Copyright © 2003–2021 MuleSoft, Inc.. All rights reserved.