Package org.refcodes.factory
Interface BeanFactory<ID>
-
- Type Parameters:
ID
- The type of the IDto be used when looking up an instance.
- All Superinterfaces:
BeanLookupFactory<ID>
,TypeLookupFactory
public interface BeanFactory<ID> extends TypeLookupFactory, BeanLookupFactory<ID>
A lookup factory supporting type and ID lookup.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> T
createInstance(ID aIdentifier)
This method creates / retrieves an instance of the given type identified with the given identifier (name).<T> java.util.Set<T>
createInstances(java.lang.Class<?> aType)
This method creates / retrieves an all instances of the given type.-
Methods inherited from interface org.refcodes.factory.BeanLookupFactory
createInstance
-
Methods inherited from interface org.refcodes.factory.TypeLookupFactory
toInstances
-
-
-
-
Method Detail
-
createInstance
<T> T createInstance(ID aIdentifier)
This method creates / retrieves an instance of the given type identified with the given identifier (name).- Specified by:
createInstance
in interfaceBeanLookupFactory<ID>
- Type Parameters:
T
- The type which is to be fabricated by the factory method.- Parameters:
aIdentifier
- The name identifying the instance to be created / retrieved.- Returns:
- The instance being fabricated by this factory of the required type for the given instance name (identifier).
-
createInstances
<T> java.util.Set<T> createInstances(java.lang.Class<?> aType)
This method creates / retrieves an all instances of the given type.- Specified by:
createInstances
in interfaceTypeLookupFactory
- Type Parameters:
T
- The type which is to be fabricated by the factory method.- Parameters:
aType
- The type identifying the instances to be created / retrieved.- Returns:
- A set with all instance of the required type for the given type.
-
-