Package one.microstream.persistence.lazy
Class Lazy.Default<T>
- java.lang.Object
-
- one.microstream.persistence.lazy.Lazy.Default<T>
-
- All Implemented Interfaces:
Lazy<T>,LazyReferencing<T>,Referencing<T>
public static final class Lazy.Default<T> extends Object implements Lazy<T>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLazy.Default.Checker-
Nested classes/interfaces inherited from interface one.microstream.persistence.lazy.Lazy
Lazy.Default<T>
-
-
Constructor Summary
Constructors Constructor Description Default()
-
Method Summary
Modifier and Type Method Description Tclear()Clears the reference, leaving the option to re-load it again intact, and returns the subject that was referenced prior to clearing.static Class<Lazy.Default<?>>genericType()Tget()Returns the original subject referenced by this reference instance.booleanisLoaded()booleanisStored()longlastTouched()longobjectId()Tpeek()Returns the wrapped reference without loading it on demand.StringtoString()
-
-
-
Method Detail
-
genericType
public static final Class<Lazy.Default<?>> genericType()
-
objectId
public final long objectId()
-
lastTouched
public final long lastTouched()
-
peek
public final T peek()
Returns the wrapped reference without loading it on demand.- Specified by:
peekin interfaceLazyReferencing<T>- Returns:
- the current reference withouth on-demand loading.
-
clear
public final T clear()
Clears the reference, leaving the option to re-load it again intact, and returns the subject that was referenced prior to clearing.
-
get
public final T 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.- Specified by:
getin interfaceLazyReferencing<T>- Specified by:
getin interfaceReferencing<T>- Returns:
- the originally referenced subject, either already-known or lazy-loaded.
-
-