Package org.omnifaces.util
Class Lazy<T>
- java.lang.Object
-
- org.omnifaces.util.Lazy<T>
-
- Type Parameters:
T
- Type of object.
public final class Lazy<T> extends Object
Implements lazy-initialized object primarily for final and transient fields. Utilizes double-checked locking for optimization.Example:
private final Lazy<Object> lazy = new Lazy<>(Object::new); Object lazyInstance = lazy.get();
- Since:
- 3.9
- Author:
- Lenny Primak