Class CodegenParams
-
- All Implemented Interfaces:
public final class CodegenParamsCode generation parameters container.
Parameters should be passed in an object of any class. The param object should have a parameterless constructor. Only one param object of a given class can be set.
-
-
Field Summary
Fields Modifier and Type Field Description private BooleandryRunprivate BooleanallowDuplicateClasses
-
Constructor Summary
Constructors Constructor Description CodegenParams()
-
Method Summary
Modifier and Type Method Description final BooleangetDryRun()Determines that module files will not be generated. final UnitsetDryRun(Boolean dryRun)Determines that module files will not be generated. final BooleangetAllowDuplicateClasses()Specifies whether to allow duplicate classes. final UnitsetAllowDuplicateClasses(Boolean allowDuplicateClasses)Specifies whether to allow duplicate classes. final CodegenParamsdryRun(Boolean dryRun)final CodegenParamsallowDuplicateClasses(Boolean allowDuplicateClasses)final <T extends Any> Tget(Class<T> clazz)Retrieves an object with parameters of the given class. final <T extends Any> Tget(KClass<T> clazz)Retrieves an object with parameters of the given class. final <T extends Any> CodegenParamsset(T params)Set params object. final <T extends Any> CodegenParamsset(KClass<T> clazz, Function1<T, Unit> updater)Set or update params object. final <T extends Any> CodegenParamsset(Class<T> clazz, Consumer<T> updater)Set or update params object. final CodegenParamscopy()-
-
Method Detail
-
getAllowDuplicateClasses
final Boolean getAllowDuplicateClasses()
Specifies whether to allow duplicate classes. If not, the generation process will end with an error when a class with the same name and package is declared. Otherwise, the class reported first will be generated and a warning will be logged.
-
setAllowDuplicateClasses
final Unit setAllowDuplicateClasses(Boolean allowDuplicateClasses)
Specifies whether to allow duplicate classes. If not, the generation process will end with an error when a class with the same name and package is declared. Otherwise, the class reported first will be generated and a warning will be logged.
-
dryRun
final CodegenParams dryRun(Boolean dryRun)
-
allowDuplicateClasses
final CodegenParams allowDuplicateClasses(Boolean allowDuplicateClasses)
-
get
final <T extends Any> T get(Class<T> clazz)
Retrieves an object with parameters of the given class.
If the parameter of the given class has not been set before, then the object will be created (the class should have parameterless constructor).
-
get
final <T extends Any> T get(KClass<T> clazz)
Retrieves an object with parameters of the given class.
If the parameter of the given class has not been set before, then the object will be created (the class should have parameterless constructor).
-
set
final <T extends Any> CodegenParams set(T params)
Set params object. If an object of the same class was previously added, it will be overwritten.
-
set
final <T extends Any> CodegenParams set(KClass<T> clazz, Function1<T, Unit> updater)
Set or update params object.
If the parameter of the given class has not been set before, then the object will be created (the class should have parameterless constructor).
-
set
final <T extends Any> CodegenParams set(Class<T> clazz, Consumer<T> updater)
Set or update params object.
If the parameter of the given class has not been set before, then the object will be created (the class should have parameterless constructor).
-
copy
final CodegenParams copy()
-
-
-
-