public abstract class LazyInitializer<T> extends Object
LazyInitializer, which doesn't throw any checked exception when get method is invoked.| Constructor and Description |
|---|
LazyInitializer() |
| Modifier and Type | Method and Description |
|---|---|
T |
get()
Returns the object wrapped by this instance.
|
protected abstract T |
initialize()
Creates and initializes the object managed by this
LazyInitializer. |
boolean |
isInitialized() |
public final T get()
LazyInitializer the objectpublic final boolean isInitialized()
protected abstract T initialize()
LazyInitializer. This method is called by get()
when the object is accessed for the first time. An implementation can focus on the creation of the object. No
synchronization is needed, as this is already handled by get().Copyright © 2008-2014. All Rights Reserved.