micronaut-projects / micronaut-sourcegen

Compilation time source code generators
Apache License 2.0
7 stars 4 forks source link

Creating inner types inside classes #160

Closed elifKurtay closed 3 weeks ago

elifKurtay commented 1 month ago

Feature description

It would be nice to be able to create inner types inside classes. The current PropertyDef or FieldDef seems limited to creating variables and does not allow adding records, enums, or inner classes inside a class.

An example generation goal could be the following record:

public record LlamaRecord(
    @NotNull @Min(0) int age,
    Status status
) {
  enum Status {
    Single,
    Taken
  }
}