java.lang.Object
org.omnifaces.util.Lazy<T>
- Type Parameters:
T- Type of object.
- All Implemented Interfaces:
Serializable
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
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Lazy
-
-
Method Details
-
get
- Returns:
- Underlying object, initialize when necessary.
-