Interface PodamFactory

    • 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 RandomDataProviderStrategyImpl as 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 required
        genericTypeArgs - 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 RandomDataProviderStrategyImpl as 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 required
        genericTypeArgs - 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 RandomDataProviderStrategyImpl as the default implementation.

        Type Parameters:
        T - The type for which a filled instance is required
        Parameters:
        pojo - The instance to be filled with values
        genericTypeArgs - 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