Open volomas opened 3 months ago
As of now, generator doesn't take into account "const" keyword. The value of "const" is simply lost during generation.
In this PR, I've added ConstRule that generates java constant: public static final <Type> <snake_case_var_name> = <value>.
public static final <Type> <snake_case_var_name> = <value>
This allows to use this value in code like this:
var myClass = new GeneratedClass(); myClass.setMyProperty(GeneratedClass.MY_PROPERTY);
... or just when I need to refer to that constant somewhere in the code.
It doesn't set the generated field value to "const" value, because it would mimic "default", so I wasn't sure if that's a good idea.
As of now, generator doesn't take into account "const" keyword. The value of "const" is simply lost during generation.
In this PR, I've added ConstRule that generates java constant:
public static final <Type> <snake_case_var_name> = <value>
.This allows to use this value in code like this:
... or just when I need to refer to that constant somewhere in the code.
It doesn't set the generated field value to "const" value, because it would mimic "default", so I wasn't sure if that's a good idea.