-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Adding settings to data streams #126947
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
Adding settings to data streams #126947
Changes from 17 commits
e93ea67
cf2b2c2
bec18b3
9cb64f2
781f9c6
7432824
73ff2a1
925f01b
c7ffd3e
083a437
c6398d6
0fda41e
9d09df7
b98d4a8
39e41c0
a39ffbc
3cf1def
d85b4d7
ad9238e
5df3d4f
a9998f5
641c645
8d7875d
b1d5944
3521f8e
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 |
|---|---|---|
|
|
@@ -876,6 +876,24 @@ public Set<String> keySet() { | |
| return newKeySet; | ||
| } | ||
|
|
||
| /* | ||
| * This method merges the given newSettings into this Settings, returning either a new Settings object or | ||
| * this if the newSettings are null or empty. If any values are null in newSettings, those keys are removed | ||
| * from the returned object. | ||
| */ | ||
| public Settings merge(Settings newSettings) { | ||
| if (newSettings == null || Settings.EMPTY.equals(newSettings)) { | ||
|
||
| return this; | ||
| } | ||
| Settings.Builder settingsBuilder = Settings.builder().put(this).put(newSettings); | ||
|
||
| for (String settingName : new HashSet<>(settingsBuilder.keys())) { | ||
| if (settingsBuilder.get(settingName) == null) { | ||
| settingsBuilder.remove(settingName); | ||
| } | ||
| } | ||
| return settingsBuilder.build(); | ||
| } | ||
|
|
||
| /** | ||
| * A builder allowing to put different settings and then {@link #build()} an immutable | ||
| * settings implementation. Use {@link Settings#builder()} in order to | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: null could also be removed here?