org.omnaest.utils.structure.element.factory.adapter
Class FactoryToFactoryTypeAwareAdapter<E>

java.lang.Object
  extended by org.omnaest.utils.structure.element.factory.adapter.FactoryToFactoryTypeAwareAdapter<E>
All Implemented Interfaces:
Factory<E>, FactoryTypeAware<E>

public class FactoryToFactoryTypeAwareAdapter<E>
extends Object
implements FactoryTypeAware<E>

Adapter which allows to use a Factory in combination with a given type as FactoryTypeAware instance

Author:
Omnaest
See Also:
Factory, FactoryTypeAware

Constructor Summary
FactoryToFactoryTypeAwareAdapter(Factory<E> factory, Class<E> instanceType)
           
 
Method Summary
 Class<?> getInstanceType()
          Returns the Class type the Factory.newInstance() method produces
 E newInstance()
          Factory method for an element
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FactoryToFactoryTypeAwareAdapter

public FactoryToFactoryTypeAwareAdapter(Factory<E> factory,
                                        Class<E> instanceType)
Parameters:
factory -
instanceType -
See Also:
FactoryToFactoryTypeAwareAdapter
Method Detail

newInstance

public E newInstance()
Description copied from interface: Factory
Factory method for an element

Specified by:
newInstance in interface Factory<E>
Returns:

getInstanceType

public Class<?> getInstanceType()
Description copied from interface: FactoryTypeAware
Returns the Class type the Factory.newInstance() method produces

Specified by:
getInstanceType in interface FactoryTypeAware<E>
Returns:


Copyright © 2013. All Rights Reserved.