LazyInitializable (Groovy 5.0.0)
Description: declaration: package: org.apache.groovy.util.concurrent, interface: LazyInitializable

Package org.apache.groovy.util.concurrent

# Interface LazyInitializable

public interface LazyInitializable
A `LazyInitializable` is an object that can be initialized lazily. Note: the instance field `initialized` of subclass should be `volatile` to avoid JVM instructions re-ordering

Since:
  3.0.0

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `doInit()`
  do initialization
  `boolean`
  `isInitialized()`
  Check if the object is initialized.
  `default void`
  `lazyInit()`
  `void`
  `setInitialized(boolean initialized)`
  Mark the object initialized.

- ## Method Details

  - ### 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