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 class
Lazy.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 T
clear()
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()
T
get()
Returns the original subject referenced by this reference instance.boolean
isLoaded()
boolean
isStored()
long
lastTouched()
long
objectId()
T
peek()
Returns the wrapped reference without loading it on demand.String
toString()
-
-
-
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:
peek
in 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:
get
in interfaceLazyReferencing<T>
- Specified by:
get
in interfaceReferencing<T>
- Returns:
- the originally referenced subject, either already-known or lazy-loaded.
-
-