Package cdc.args
Class Singleton<T>
java.lang.Object
cdc.args.Singleton<T>
- Type Parameters:
T- Type of created objects.
- All Implemented Interfaces:
Factory<T>
Implementation of Factory dedicated to singletons.
- Author:
- Damien Carbonne
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates aTinstance.Returns a list of supported creation arguments.getMeta()
-
Constructor Details
-
Singleton
Creates a Singleton factory.- Parameters:
objectClass- Class of created objects.object- The singleton object to use. It is this instance that will be returned each time a creation is asked.meta- The meta data associated to this factory.
-
Singleton
Creates a Singleton factory.Class of created objects is the class of
object.- Parameters:
object- The singleton object to use. It is this instance that will be returned each time a creation is asked.meta- The meta data associated to this factory.
-
-
Method Details
-
getObjectClass
- Specified by:
getObjectClassin interfaceFactory<T>- Returns:
- The class of built objects.
-
getMeta
-
getCreationFormalArgsList
Description copied from interface:FactoryReturns a list of supported creation arguments.This list must not be empty.
If creation does not need any arguments, a list containing FormalArgs.NO_FARGS should be returned.- Specified by:
getCreationFormalArgsListin interfaceFactory<T>- Returns:
- A list of supported creation arguments.
-
create
Description copied from interface:FactoryCreates aTinstance.
-