[Java] Interface LazyInitializable
public interface LazyInitializable
A 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-ordering
- Since:
- 3.0.0
Methods Summary
Type Params | Return Type | Name and description |
---|---|---|
public void |
doInit() do initialization | |
public boolean |
isInitialized() Check if the object is initialized. | |
public void |
lazyInit() | |
public void |
setInitialized(boolean initialized) Mark the object initialized. |
Method Detail
public void doInit()
do initialization
public boolean isInitialized()
Check if the object is initialized.
- Returns:
- the check result
public void lazyInit()
public void setInitialized(boolean initialized)
Mark the object initialized.
- Parameters:
-
initialized
- initialized
© 2003-2020 The Apache Software Foundation
Licensed under the Apache license.
https://docs.groovy-lang.org/3.0.7/html/gapi/org/apache/groovy/util/concurrent/LazyInitializable.html