Package uk.co.jemos.podam.api
Class AbstractExternalFactory
- java.lang.Object
-
- uk.co.jemos.podam.api.AbstractExternalFactory
-
- All Implemented Interfaces:
PodamFactory
- Direct Known Subclasses:
NullExternalFactory
public abstract class AbstractExternalFactory extends Object implements PodamFactory
Adapter pattern for boilerplate code when creating an external factory- Since:
- 5.2.1
- Author:
- Marco Tedone
-
-
Constructor Summary
Constructors Constructor Description AbstractExternalFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ClassInfoStrategygetClassStrategy()It returns the class info strategy for this factory.PodamFactorygetExternalFactory()It returns the external factory assigned to this factory.DataProviderStrategygetStrategy()It returns the strategy for this factory.<T> TmanufacturePojoWithFullData(Class<T> pojoClass, Type... genericTypeArgs)Generic method which returns an instance of the given class filled with dummy values, using the default data provider strategy.PodamFactorysetClassStrategy(ClassInfoStrategy classInfoStrategy)Sets the class info strategy for this factoryPodamFactorysetExternalFactory(PodamFactory externalFactory)Sets an external factory for this factory to delegate requests it cannot processPodamFactorysetStrategy(DataProviderStrategy strategy)Sets the data provider strategy for this factory-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface uk.co.jemos.podam.api.PodamFactory
manufacturePojo, populatePojo
-
-
-
-
Method Detail
-
manufacturePojoWithFullData
public <T> T manufacturePojoWithFullData(Class<T> pojoClass, Type... genericTypeArgs)
Description copied from interface:PodamFactoryGeneric method which returns an instance of the given class filled with dummy values, using the default data provider strategy. In order to instantiate class, constructor with the most parameters is used.This method uses
RandomDataProviderStrategyImplas the default implementation.- Specified by:
manufacturePojoWithFullDatain interfacePodamFactory- Type Parameters:
T- The type for which a filled instance is required- Parameters:
pojoClass- The name of the class for which an instance filled with values is requiredgenericTypeArgs- The generic Type arguments for a generic class instance- Returns:
- An instance of <T> filled with dummy values
-
getStrategy
public DataProviderStrategy getStrategy()
Description copied from interface:PodamFactoryIt returns the strategy for this factory.- Specified by:
getStrategyin interfacePodamFactory- Returns:
- the strategy
-
setStrategy
public PodamFactory setStrategy(DataProviderStrategy strategy)
Description copied from interface:PodamFactorySets the data provider strategy for this factory- Specified by:
setStrategyin interfacePodamFactory- Parameters:
strategy- A data provider strategy to be used by this factory- Returns:
- instance of the factory for chaining
-
getClassStrategy
public ClassInfoStrategy getClassStrategy()
Description copied from interface:PodamFactoryIt returns the class info strategy for this factory.- Specified by:
getClassStrategyin interfacePodamFactory- Returns:
- the class info strategy for this factory
-
setClassStrategy
public PodamFactory setClassStrategy(ClassInfoStrategy classInfoStrategy)
Description copied from interface:PodamFactorySets the class info strategy for this factory- Specified by:
setClassStrategyin interfacePodamFactory- Parameters:
classInfoStrategy- A class info strategy to be used by this factory- Returns:
- instance of the factory for chaining
-
getExternalFactory
public PodamFactory getExternalFactory()
Description copied from interface:PodamFactoryIt returns the external factory assigned to this factory.- Specified by:
getExternalFactoryin interfacePodamFactory- Returns:
- the strategy
-
setExternalFactory
public PodamFactory setExternalFactory(PodamFactory externalFactory)
Description copied from interface:PodamFactorySets an external factory for this factory to delegate requests it cannot process- Specified by:
setExternalFactoryin interfacePodamFactory- Parameters:
externalFactory- An external factory to be used by this factory- Returns:
- instance of this factory for chaining
-
-