org.apache.wicket.util
Class LazyInitializer<T>
java.lang.Object
org.apache.wicket.util.LazyInitializer<T>
- Type Parameters:
T
- type of value
- All Implemented Interfaces:
- Serializable, IClusterable, IProvider<T>
public abstract class LazyInitializer<T>
- extends Object
- implements IProvider<T>, IClusterable
An abstraction for lazy-initializing values. Guarantees only a single instance of the value is
created.
Initialized value WILL NOT be serialized, and will be recreated upon
de-serialization.
- Author:
- igor
- See Also:
- Serialized Form
Method Summary |
protected abstract T |
createInstance()
Creates the lazy value |
T |
get()
Provides an instance of type T |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LazyInitializer
public LazyInitializer()
get
public T get()
- Description copied from interface:
IProvider
- Provides an instance of type
T
- Specified by:
get
in interface IProvider<T>
- Returns:
- instance of type
T
createInstance
protected abstract T createInstance()
- Creates the lazy value
- Returns:
- new instance of the value
Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.