We've started having FooProperties, with string members to define the names of properties we care about. For instance
Which is great, but also difficult to keep up with default values, document, and more importantly, be able to display something helpful when a command-line user does --help.
It might be nice, particularly now that we have CDI heartily in the mix, but possibly on the wrong side of the fence, to do something like:
CDI could then gather up all ConfigurationSpec to know what properties are actually active in a given combination of fractions. It could provide this information if someone does --help or perhaps through other tooling (project-stages.yml IDE auto-completion).
The existing @ConfigurationValue could be modified to take, in addition to a String name as it current does, a ConfigurationSpec object when performing the lookup.
That being said, I dunno if @Produces works on fields, or static fields, or whatnot. But some way to formalize the keys and default values (if any) that we actually support, instead of magic strings.
It could also be beneficial if we could chain them, to avoid typos and repetition.
Where ConfigurationSpec is akin to:
Bonus points if somehow we can @Inject a sub-type of Optional<T> when doing our normal @ConfigurationValue injection, that automatically can accomodate the default value, enhancing on George Gastaldi's work.