Interface Lazy<T>
-
- Type Parameters:
T
-
- All Superinterfaces:
LazyReferencing<T>
,Referencing<T>
- All Known Implementing Classes:
Lazy.Default
public interface Lazy<T> extends LazyReferencing<T>
A reference providing generic lazy-loading functionality.Note that the shortened name has been chosen intentionally to optimize readability in class design.
Also note that a type like this is strongly required to implement lazy loading behavior in an architectural clean and proper way. I.e. the design has to define that a certain reference is meant be capable of lazy-loading. If such a definition is not done, a loading logic is strictly required to always load the encountered reference, as it is defined by the normal reference. Any "tricks" of whatever framework to "sneak in" lazy loading behavior where it hasn't actually been defined are nothing more than dirty hacks and mess up if not destroy the program's consistency of state (e.g. antipatterns like secretly replacing a well-defined collection instance with a framework-proprietary proxy instance of a "similar" collection implementation). In proper architectured sofware, if a reference does not define lazy loading capacity, it is not wanted to have that capacity on the business logical level by design in the first place. Any attempts of saying "but I want it anyway in a sneaky 'transparent' way" indicate ambivalent conflicting design errors and thus in the end poor design.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Lazy.Default<T>
-
Method Summary
Modifier and Type Method Description static LazyReferenceManager.Checker
Checker(long millisecondTimeout)
T
clear()
static void
clear(Lazy<?> reference)
static <T> T
get(Lazy<T> reference)
boolean
isLoaded()
static boolean
isLoaded(Lazy<?> reference)
boolean
isStored()
static boolean
isStored(Lazy<?> reference)
static <T> Lazy<T>
New(long objectId)
static <T> Lazy<T>
New(long objectId, PersistenceObjectRetriever loader)
static <T> Lazy<T>
New(T subject, long objectId, PersistenceObjectRetriever loader)
static <T> T
peek(Lazy<T> reference)
static <T> Lazy<T>
Reference(T subject)
static <T,L extends Lazy<T>>
Lregister(L lazyReference)
-
Methods inherited from interface one.microstream.reference.LazyReferencing
get, peek
-
-
-
-
Method Detail
-
clear
T clear()
-
isStored
boolean isStored()
-
isLoaded
boolean isLoaded()
-
get
static <T> T get(Lazy<T> reference)
-
peek
static <T> T peek(Lazy<T> reference)
-
clear
static void clear(Lazy<?> reference)
-
isStored
static boolean isStored(Lazy<?> reference)
-
isLoaded
static boolean isLoaded(Lazy<?> reference)
-
Reference
static <T> Lazy<T> Reference(T subject)
-
New
static <T> Lazy<T> New(long objectId)
-
New
static <T> Lazy<T> New(long objectId, PersistenceObjectRetriever loader)
-
New
static <T> Lazy<T> New(T subject, long objectId, PersistenceObjectRetriever loader)
-
Checker
static LazyReferenceManager.Checker Checker(long millisecondTimeout)
-
register
static <T,L extends Lazy<T>> L register(L lazyReference)
-
-