initialValueProvider should be marked "incomplete" or something. For the rest, not so sure I like it. I think I would prefer something more composite-like, but not sure yet.
On Sun, Jun 4, 2017 at 7:01 PM, Paul Merlin <[email protected]> wrote: > Maybe a silly idea, don't know, totally different, but ... > > > interface MyConfig { > > @UseDefaults( value = "user.home", source = > DefaultsSource.SYSTEM_PROPERTIES ) > Property<String> homeDirectoryPath(); > > @UseDefaults( value = "SOME_PORT", source = DefaultsSource.ENVIRONMENT ) > Property<Integer> thePortWeWantToUse(); > > Property<List<String>> somethingElse(); > > } > > Too much annotations, erk ... > > > > Looking at it this way the goal could be seen as providing default values > per property. > > We already have the assembly time initial value provider that can do just > that, or could be enhanced to (couldn't find tests for it ...). We could > then provide some helpers for system properties / environment variables > mapping. > > BTW, shouldn't InitialValueProvider be named DefaultValueProvider instead, > for consistency? > > -- Niclas Hedhman, Software Developer http://polygene.apache.org - New Energy for Java
