Skip to content
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

XContentBuilder.map(Map) method modified to use a wildcard for value's type. #7212

Closed
wants to merge 1 commit into from

Conversation

obourgain
Copy link
Contributor

The XContentBuilder.map(Map<String, Object>) method could be modified to use a wildcard for value's type.

This could make the API slightly more convenient.
For exemple, when I got a org.elasticsearch.common.settings.Settings and call getAsMap(), it returns a Map<String, String> that can not be passed to map(Map<String, Object>).

Users of the current API are forced to pass a Map<String, Object>, but any reference with such type can be passed to Map<String, ?>, so they will require no changes.
Consumers of a Map<String, ?> get Object as type for the entry.getValue(), as in XContentBuilder.writeMap(), so it will require no changes here.

This could be backported easily to other branches.

@jpountz
Copy link
Contributor

jpountz commented Aug 11, 2014

@obourgain The change looks good to me. Could I ask you to sign the CLA so that I can get it merged in?
http://www.elasticsearch.org/contributor-agreement/

@jpountz jpountz removed the review label Aug 11, 2014
@jpountz jpountz self-assigned this Aug 11, 2014
@obourgain
Copy link
Contributor Author

I just signed it.

@jpountz
Copy link
Contributor

jpountz commented Aug 11, 2014

@obourgain Merged, thanks!

@jpountz jpountz closed this Aug 11, 2014
@clintongormley clintongormley changed the title Small improvment of the XContentBuilder API Java API: XContentBuilder.map(Map) method modified to use a wildcard for value's type. Sep 8, 2014
@clintongormley clintongormley added the :Core/Infra/Transport API Transport client API label Jun 7, 2015
@clintongormley clintongormley changed the title Java API: XContentBuilder.map(Map) method modified to use a wildcard for value's type. XContentBuilder.map(Map) method modified to use a wildcard for value's type. Jun 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants