Package mocka.generator.orm.mybatis
Class MyBatisFieldValueGenerator
java.lang.Object
mocka.generator.orm.mybatis.MyBatisFieldValueGenerator
- All Implemented Interfaces:
FieldValueGenerator
Implementation of
FieldValueGenerator specialized for MyBatis.
This component is responsible for generating random or mock values for fields of entities managed by MyBatis. It supports:
- Primitive and wrapper types (int, long, float, double, boolean, char, etc.)
EnumtypesBigDecimal,BigInteger- Date/time classes from
java.util,java.time, andjava.sql - Primitive arrays (
byte[],char[])
If the given field type is unsupported, an UnsupportedOperationException
will be thrown.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
MyBatisFieldValueGenerator
public MyBatisFieldValueGenerator()
-
-
Method Details
-
get
Generates a random value for the given field based on its type and annotations.- Specified by:
getin interfaceFieldValueGenerator- Parameters:
field- the field to generate a value for- Returns:
- a randomly generated value appropriate for the field type, or null if the field should not be generated
- Throws:
RuntimeException- if@Emailis used on a non-String fieldUnsupportedOperationException- if the field type is not supported
-