Customize Generators
The generated values can be adjusted using the following annotations.
If an annotation is written above the constructor, it is usually applied to all parameters within the constructor, should the parameter not have its own annotation.
@Use
With the Use Annotation a specific generator can be selected.
When @Use
is applied to an array, the specified generator is applied to the individual values within the array.
(String) Name Generator
EEEE has a generator for (human) names: NameGenerator
@Range
Limits the size of the generated value.
@Range({min, max, step})
Steps
For generators, a third argument can be used: the step. This specifies the steps in which the number is to be generated. This is very helpful with doubles, for example, to limit the precision.
@Transform
Transforms a generated string. Same as the @Transform
-annotation in the Validation section.