Interface ObjectFactory

All Known Implementing Classes:
ObjenesisObjectFactory, RecordFactory

public interface ObjectFactory
Strategy interface for object creation.
Since:
4.0
Author:
Mahmoud Ben Hassine ([email protected])
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    Create a new instance of type in the given randomization context.
  • Method Details

    • createInstance

      <T> T createInstance(Class<T> type, RandomizerContext context) throws ObjectCreationException
      Create a new instance of type in the given randomization context.
      Type Parameters:
      T - generic type
      Parameters:
      type - to create
      context - current randomization context
      Returns:
      new instance of the given type
      Throws:
      ObjectCreationException - when unable to create an instance of the given type