Class GeneratorContext

java.lang.Object
org.instancio.generator.GeneratorContext

public final class GeneratorContext extends Object
Provides additional information, such as settings and a random instance to generators that require it.
Since:
1.0.3
See Also:
  • Constructor Details

    • GeneratorContext

      public GeneratorContext(Settings settings, Random random)
  • Method Details

    • getSettings

      public Settings getSettings()
      Returns a read-only instance of the settings used by Instancio.

      The returned settings includes overrides specified using

      Returns:
      the settings
      Since:
      1.0.3
    • random

      public Random random()
      Returns the random instance used by Instancio to generate data.

      Using this instance ensures that data will be reproducible.

      Returns:
      the random instance
      Since:
      1.0.3