Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Implemented
-
0.2-incubating
-
None
Description
Provide a unified builder API, hereby removing the existing builder module. The "new" builder should provide the following functionality:
- Managing propery sources (existing)
- Managing property filters (existing)
- Managing property converters (existing)
- Managing the combination policy (existing)
The differentceis that the builder should not implicitly define any ordering of the property sources added. Basically the priorities of property sources is similar to the order in which they are added. This makes defining your own property source hierarchies simpley and transparent.
To ensure a defined order, if wanted, corresponding sort}XXX(Comparator(X); methods should be available, which allow to define the sort order via the Comparator passed.
Similary constructing a Configuration based on a ConfigurationContext should also not implicitly change the ordering as defined by the context.
Finally adding or removing artifacts mentioned sometimes take an ellipse operator T...}, sometimes a {{Collection<T>. Ensure with this change that in all cases both variants are present symmetrically.
Summary:
- ConfigurationContextBuilder:
- Add methods sortPropertySources(Comparator<PropertySource>), sortPropertyFilters(Comparator<PropertyFilter>)
- Remove implicit sorting of property sources done as of now
- Expose the current existing SPI factory method ConfigurationProviderSPI.create(Configuration); as a static method on ConfigurationProvider.
- Add missing {{ add/removeXXX(Collection<XXX>), add/removeXXX(XXX...) }}, where missing.
NOTE: This change is not 100% behavior compatible. But since {{ ConfigurationProvider.create(Configuration); }} is not exposed with the current release, we do not expect client code is affected.