Generator for constructor in Java
현재 Java에서는 클래스내에 존재하는 필드를 생성하고 조합하여 객체를 만드는 Generator들만 지원하고 있다.
생성자를 사용하여 객체를 만드는 방법은 ConstructorPropertiesArbitraryGenerator 가 있지만,
생성자 위에 @ConstructorProperties를 명시해주어야 하고 필드에 없는 파라미터를 입력받을 경우 예외처리가 필요하다.
Kotlin에서는 PrimaryConstructorArbitraryGenerator가 생성자를 통해 객체를 생성할 수 있다.
생성자 기반으로 객체를 생성하는 경우를 지원하기 위해 새로운 Generator를 만든다.
Currently, Java only supports generators which create objects by creating and combining fields existing in the class. There is a 'ConstructorPropertiesArbitraryGenerator' to create an object using the constructor, '@ConstructorProperties' must be specified above the constructor, and exception processing is required if parameters that are not in the field are input.
In Kotlin, the 'PrimaryConstructorArbitraryGenerator' may generate an object through the generator.
A new generator is created to support the creation of objects based on the constructor.
Record 타입인 경우에는 RecordComponent를 활용 가능할 것 같다.
https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/reflect/RecordComponent.html