We all secretly love lowercased hyphenated names, I know, I know.
From a single field
To set a custom name on a single field, you can annotate it with @Name and provide the new name, or @NamedPath to specify a path and name at once. Note that this does override any selected Naming scheme.
importcom.github.secretx33.sccfg.api.annotation.*;@ConfigurationpublicclassMyConfig {// annotate the field with @Name, and provide any name you'd like @Name("otherNameOnField")privatefinalint someInt =0;// or use the combo annotation, NamedPath @NamedPath(path ="the.path", name ="anotherName")publicString someString ="edisson";}
import com.github.secretx33.sccfg.api.annotation.*@ConfigurationclassMyConfig {// annotate the field with @Name, and provide any name you'd like@Name("otherNameOnField")privateval someInt =0// or use the combo annotation, NamedPath@NamedPath(path ="the.path", name ="anotherName")var someString ="edisson"}
Will generate the following file.
otherNameOnField:0the:path:anotherName:"edisson"
From all fields at once
Choose a different Naming scheme for your configuration fields by modifying your @Configuration annotation. This option will affect all field names, except those which have @Name annotation, which has a tighter scope.
These are the available Naming options.
NONE
LOWERCASE_HYPHENATED
LOWERCASE_UNDERLINED
UPPERCASE_HYPHENATED
UPPERCASE_UNDERLINED
As for the example, let's randomly pick LOWERCASE_HYPHENATED for demonstration purposes.