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:
java.util.function.Supplier<T>
public class LazyLoaded<T> extends java.lang.Object implements java.util.function.Supplier<T>Generic wrapper for thread safe lazy loading. For details see: https://en.wikipedia.org/wiki/Double-checked_locking#Usage_in_Java
-
-
Constructor Summary
Constructors Constructor Description LazyLoaded(java.util.function.Supplier<T> supplier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tget()booleanisLoaded()
-
-
-
Constructor Detail
-
LazyLoaded
public LazyLoaded(java.util.function.Supplier<T> supplier)
- Parameters:
supplier- supplier to load the value lazy upon first request. Must not benulland should not returnnull.
-
-