public static final class MemoryUtils.Tracked
extends java.util.concurrent.atomic.AtomicBoolean
released
.
This is simply an AtomicBoolean
that gets switched when released.
Use safeRelease(Object)
in generic object hooks to release a hook-provided object
if it is an instance of MemoryUtils.Tracked
.
Note that AssertionsUtils.installAssertJTestRepresentation()
's AssertJ Representation
recognizes this class.
限定符和类型 | 字段和说明 |
---|---|
java.lang.String |
identifier
An identifier for the tracked object, which can help debugging when tests fail.
|
static MemoryUtils.Tracked |
RELEASED
A pre-released
MemoryUtils.Tracked instance for convenience in some tests. |
构造器和说明 |
---|
Tracked(java.lang.String identifier) |
Tracked(java.lang.String identifier,
boolean preReleased) |
限定符和类型 | 方法和说明 |
---|---|
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
boolean |
isReleased()
Check if this
MemoryUtils.Tracked object has been released. |
void |
release()
Release this
MemoryUtils.Tracked object. |
static void |
safeRelease(java.lang.Object t)
Check if an arbitrary object is a
MemoryUtils.Tracked , and if so release it. |
java.lang.String |
toString() |
public static final MemoryUtils.Tracked RELEASED
MemoryUtils.Tracked
instance for convenience in some tests.public final java.lang.String identifier
public Tracked(java.lang.String identifier)
public Tracked(java.lang.String identifier, boolean preReleased)
public static void safeRelease(java.lang.Object t)
MemoryUtils.Tracked
, and if so release it.t
- the arbitrary objectpublic void release()
MemoryUtils.Tracked
object.public boolean isReleased()
MemoryUtils.Tracked
object has been released.public boolean equals(java.lang.Object o)
equals
在类中 java.lang.Object
public int hashCode()
hashCode
在类中 java.lang.Object
public java.lang.String toString()
toString
在类中 java.util.concurrent.atomic.AtomicBoolean