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)Tclear()Clears the reference, leaving the option to re-load it again intact, and returns the subject that was referenced prior to clearing.booleanclear(Lazy.ClearingEvaluator clearingEvaluator)static Class<Lazy.Default<?>>genericType()Tget()Returns the original subject referenced by this reference instance.booleanisLoaded()booleanisStored()longlastTouched()Returns the timestamp (corresponding toSystem.currentTimeMillis()) when this instance has last been "touched", meaning having its reference modified or queried.longobjectId()Tpeek()Returns the wrapped reference without loading it on demand.StringtoString()
-
Method Details
-
genericType
-
objectId
public final long objectId() -
lastTouched
public final long lastTouched()Description copied from interface:LazyReturns the timestamp (corresponding toSystem.currentTimeMillis()) when this instance has last been "touched", meaning having its reference modified or queried.- Specified by:
lastTouchedin 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
-