public interface LazyInitializable
LazyInitializable
is an object that can be initialized lazily.
Note: the instance field initialized
of sub-class should be volatile
to avoid JVM instructions re-orderingModifier and Type | Method and Description |
---|---|
void |
doInit()
do initialization
|
boolean |
isInitialized()
Check if the object is initialized.
|
default void |
lazyInit() |
void |
setInitialized(boolean initialized)
Mark the object initialized.
|
default void lazyInit()
void doInit()
boolean isInitialized()
void setInitialized(boolean initialized)
initialized
- initialized