Class GeneratorDecorator
java.lang.Object
org.instancio.internal.generator.misc.GeneratorDecorator
- All Implemented Interfaces:
Generator<Object>,GeneratorSpec<Object>
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
GeneratorDecorator
-
-
Method Details
-
decorate
-
getDelegate
-
generate
Description copied from interface:GeneratorReturns a generated value.If this method produces random data, the data needs to be generated using the provided
Randominstance. This ensures generated values are reproducible for a given seed value. -
hints
Description copied from interface:GeneratorHints provided by the generator to the engine.The most important hint for custom generators is
AfterGenerate. This hint indicates whether the object created by this generator:- should be populated (for example, if it has
nullfields) - can be modified using selectors
For example, setting the hint to
AfterGenerate.POPULATE_NULLSwill cause Instancio to populatenullfields on the object returned by this generator:@Override public Hints hints() { return Hints.afterGenerate(AfterGenerate.POPULATE_NULLS); }If the action is not specified, default behaviour will be based on the
AfterGeneratevalue configured in theSettingsusing the keyKeys.AFTER_GENERATE_HINT.In addition, the following hints can be provided for populating data structures:
- should be populated (for example, if it has
-