config
config copied to clipboard
Add support for all-args constructors in order to support immutable/value objects
As loaded configurations tend to be designed to be read, not changed, it makes sense to use immutable value objects ('beans' without setters and only an all-args-constructor) for them. Unfortunately, that doesn't seem to be possible with Config at the moment.
Adding support for this should be relatively trivial - when a bean without a no-args-constructor is detected, see if there is a constructor with a parameter for every field, and if there is, use that instead.
There is ready PR for this feature: https://github.com/lightbend/config/pull/643