Package one.microstream.reference
Class Lazy.Default<T>
java.lang.Object
one.microstream.reference.Lazy.Default<T>
- All Implemented Interfaces:
Lazy<T>
,Referencing<T>
public static final class Lazy.Default<T> extends Object implements Lazy<T>
-
Nested Class Summary
Nested classes/interfaces inherited from interface one.microstream.reference.Lazy
Lazy.Check, Lazy.Checker, Lazy.ClearingEvaluator, Lazy.Default<T>
-
Method Summary
Modifier and Type Method Description void
$link(long objectId, ObjectSwizzling loader)
void
$setLoader(ObjectSwizzling loader)
T
clear()
Clears the reference, leaving the option to re-load it again intact, and returns the subject that was referenced prior to clearing.boolean
clear(Lazy.ClearingEvaluator clearingEvaluator)
static Class<Lazy.Default<?>>
genericType()
T
get()
Returns the original subject referenced by this reference instance.boolean
isLoaded()
boolean
isStored()
long
lastTouched()
Returns the timestamp (corresponding toSystem.currentTimeMillis()
) when this instance has last been "touched", meaning having its reference modified or queried.long
objectId()
T
peek()
Returns the wrapped reference without loading it on demand.String
toString()
-
Method Details
-
genericType
-
objectId
public final long objectId() -
lastTouched
public final long lastTouched()Description copied from interface:Lazy
Returns the timestamp (corresponding toSystem.currentTimeMillis()
) when this instance has last been "touched", meaning having its reference modified or queried.- Specified by:
lastTouched
in interfaceLazy<T>
- Returns:
- the time this instance has last been significantly used.
-
isStored
public final boolean isStored() -
isLoaded
public final boolean isLoaded() -
peek
Returns the wrapped reference without loading it on demand. -
clear
Clears the reference, leaving the option to re-load it again intact, and returns the subject that was referenced prior to clearing. -
clear
-
$link
-
$setLoader
-
get
Returns the original subject referenced by this reference instance. If the subject has (lazily) not been loaded, an attempt to do so now is made. Any exception occuring during the loading attempt will be passed along without currupting this reference instance's internal state. -
toString
-