Package uk.co.jemos.podam.api
Interface PodamFactory
-
- All Known Implementing Classes:
AbstractExternalFactory,NullExternalFactory,PodamFactoryImpl
public interface PodamFactoryContract for PODAM factory- Since:
- 2.0.0
- Author:
- mtedone
-
-
Method Summary
All Methods Instance Methods Abstract 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> TmanufacturePojo(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.<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.<T> TpopulatePojo(T pojo, Type... genericTypeArgs)Generic method which populates an instance of the given class 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
-
-
-
Method Detail
-
manufacturePojo
<T> T manufacturePojo(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.This method uses
RandomDataProviderStrategyImplas the default implementation.- 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
- Throws:
PodamMockeryException- if a problem occurred while creating a POJO instance or while setting its state
-
manufacturePojoWithFullData
<T> T manufacturePojoWithFullData(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. In order to instantiate class, constructor with the most parameters is used.This method uses
RandomDataProviderStrategyImplas the default implementation.- 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
- Throws:
PodamMockeryException- if a problem occurred while creating a POJO instance or while setting its state
-
populatePojo
<T> T populatePojo(T pojo, Type... genericTypeArgs)Generic method which populates an instance of the given class with dummy values, using the default data provider strategy.This method uses
RandomDataProviderStrategyImplas the default implementation.- Type Parameters:
T- The type for which a filled instance is required- Parameters:
pojo- The instance to be filled with valuesgenericTypeArgs- The generic Type arguments for a generic class instance- Returns:
- The same instance of object for chaining
- Throws:
PodamMockeryException- if a problem occurred while creating a POJO instance or while setting its state- Since:
- 5.4.0
-
getStrategy
DataProviderStrategy getStrategy()
It returns the strategy for this factory.- Returns:
- the strategy
-
setStrategy
PodamFactory setStrategy(DataProviderStrategy strategy)
Sets the data provider strategy for this factory- Parameters:
strategy- A data provider strategy to be used by this factory- Returns:
- instance of the factory for chaining
-
getExternalFactory
PodamFactory getExternalFactory()
It returns the external factory assigned to this factory.- Returns:
- the strategy
-
setExternalFactory
PodamFactory setExternalFactory(PodamFactory externalFactory)
Sets an external factory for this factory to delegate requests it cannot process- Parameters:
externalFactory- An external factory to be used by this factory- Returns:
- instance of this factory for chaining
-
getClassStrategy
ClassInfoStrategy getClassStrategy()
It returns the class info strategy for this factory.- Returns:
- the class info strategy for this factory
-
setClassStrategy
PodamFactory setClassStrategy(ClassInfoStrategy classInfoStrategy)
Sets the class info strategy for this factory- Parameters:
classInfoStrategy- A class info strategy to be used by this factory- Returns:
- instance of the factory for chaining
-
-