Class 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 Detail

      • AbstractExternalFactory

        public AbstractExternalFactory()
    • Method Detail

      • manufacturePojoWithFullData

        public <T> T manufacturePojoWithFullData​(Class<T> pojoClass,
                                                 Type... genericTypeArgs)
        Description copied from interface: PodamFactory
        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 RandomDataProviderStrategyImpl as the default implementation.

        Specified by:
        manufacturePojoWithFullData in interface PodamFactory
        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 required
        genericTypeArgs - The generic Type arguments for a generic class instance
        Returns:
        An instance of <T> filled with dummy values
      • setStrategy

        public PodamFactory setStrategy​(DataProviderStrategy strategy)
        Description copied from interface: PodamFactory
        Sets the data provider strategy for this factory
        Specified by:
        setStrategy in interface PodamFactory
        Parameters:
        strategy - A data provider strategy to be used by this factory
        Returns:
        instance of the factory for chaining
      • setClassStrategy

        public PodamFactory setClassStrategy​(ClassInfoStrategy classInfoStrategy)
        Description copied from interface: PodamFactory
        Sets the class info strategy for this factory
        Specified by:
        setClassStrategy in interface PodamFactory
        Parameters:
        classInfoStrategy - A class info strategy to be used by this factory
        Returns:
        instance of the factory for chaining
      • setExternalFactory

        public PodamFactory setExternalFactory​(PodamFactory externalFactory)
        Description copied from interface: PodamFactory
        Sets an external factory for this factory to delegate requests it cannot process
        Specified by:
        setExternalFactory in interface PodamFactory
        Parameters:
        externalFactory - An external factory to be used by this factory
        Returns:
        instance of this factory for chaining