Interface LazyInitializable
-
public interface LazyInitializable
ALazyInitializable
is an object that can be initialized lazily. Note: the instance fieldinitialized
of sub-class should bevolatile
to avoid JVM instructions re-ordering- Since:
- 3.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
doInit()
do initializationboolean
isInitialized()
Check if the object is initialized.default void
lazyInit()
void
setInitialized(boolean initialized)
Mark the object initialized.
-
-
-
Method Detail
-
lazyInit
default void lazyInit()
-
doInit
void doInit()
do initialization
-
isInitialized
boolean isInitialized()
Check if the object is initialized.- Returns:
- the check result
-
setInitialized
void setInitialized(boolean initialized)
Mark the object initialized.- Parameters:
initialized
- initialized
-
-