Package mondrian.util
Interface LockBox.Entry
-
- Enclosing class:
- LockBox
public static interface LockBox.Entry
Entry in aLockBox
.Entries are created using
LockBox.register(Object)
.The object can be retrieved using
getValue()
if you have the entry, orLockBox.get(String)
if you only have the string key.Holding onto an Entry will prevent the entry, and the associated value from being garbage collected. Holding onto the moniker will not prevent garbage collection.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
getMoniker()
String key by which to identify this object.Object
getValue()
Returns the value in this lock box entry.boolean
isRegistered()
Returns whether the entry is still valid.
-
-
-
Method Detail
-
getValue
Object getValue()
Returns the value in this lock box entry.- Returns:
- Value in this lock box entry.
-
getMoniker
String getMoniker()
String key by which to identify this object. Not null, not easily forged, and unique within the lock box.Given this moniker, you retrieve the Entry using
LockBox.get(String)
. The retrieved Entry will will have the same moniker, and will be able to access the same value.- Returns:
- String key
-
isRegistered
boolean isRegistered()
Returns whether the entry is still valid. Returns false ifLockBox.deregister(mondrian.util.LockBox.Entry)
has been called on this Entry or any entry with the same moniker.- Returns:
- whether entry is registered
-
-