Package net.adoptopenjdk.icedteaweb
Class LazyLoaded<T>
java.lang.Object
net.adoptopenjdk.icedteaweb.LazyLoaded<T>
- Type Parameters:
T- the type of the object to lazy load.
- All Implemented Interfaces:
Supplier<T>
Generic wrapper for thread safe lazy loading.
For details see: https://en.wikipedia.org/wiki/Double-checked_locking#Usage_in_Java
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
supplier
-
instance
-
-
Constructor Details
-
LazyLoaded
- Parameters:
supplier- supplier to load the value lazy upon first request. Must not benulland should not returnnull.
-
-
Method Details