-
Notifications
You must be signed in to change notification settings - Fork 986
add "get" method to DeclarativeConfigProperties #7923
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
fae075d
d914d52
2f5876e
0eacadc
b7ebfeb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -201,6 +201,17 @@ default DeclarativeConfigProperties getStructured( | |
| return defaultIfNull(getStructured(name), defaultValue); | ||
| } | ||
|
|
||
| /** | ||
| * Returns a {@link DeclarativeConfigProperties} configuration property. | ||
| * | ||
| * @return a map-valued configuration property, or an empty {@link DeclarativeConfigProperties} | ||
| * instance if {@code name} has not been configured | ||
| * @throws DeclarativeConfigException if the property is not a mapping | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wdyt of not throwing exception for this (and other) methods which have default values?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we took this approach I think we'd want to go further and get rid of the the throws altogether. It would be strange if calling the non-default overload threw (rather than just returning null) while the default did not. Going in this direction means we remove the ability to detect / handle schema type mismatches. It seems like a version of the "fail fast" vs. "handle gracefully and trudge on". But hold on... the default I do wonder if we should provide abilities to detect schema type mismatches and fail fast. API could look like:
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Discussed in the 12/18 java SIG and decided that:
The work to strip out the |
||
| */ | ||
| default DeclarativeConfigProperties get(String name) { | ||
| return getStructured(name, empty()); | ||
| } | ||
|
|
||
| /** | ||
| * Returns a list of {@link DeclarativeConfigProperties} configuration property. | ||
| * | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.