org.schmant.arg
Class ExistingObjectProducer<T>
java.lang.Object
org.schmant.arg.ExistingObjectProducer<T>
- All Implemented Interfaces:
- Producer<T>
public class ExistingObjectProducer<T>
- extends Object
- implements Producer<T>
This Producer
returns an object that already exists when this
object is created.
- Since:
- 0.9
- Author:
- Karl Gustafsson
Method Summary |
T |
get()
Returns the produced object, or null if nothing is produced
yet. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ExistingObjectProducer
public ExistingObjectProducer(T obj)
get
public T get()
- Description copied from interface:
Producer
- Returns the produced object, or
null
if nothing is produced
yet.
This method should be implemented thread-safe.
- Specified by:
get
in interface Producer<T>
- Returns:
- The produced object.