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

commented Aug 8, 2014

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

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor Author

commented Aug 11, 2014

I just signed it.

@jpountz

This comment has been minimized.

Copy link
Contributor

commented Aug 11, 2014

@obourgain Merged, thanks!

@jpountz jpountz closed this Aug 11, 2014
@jpountz jpountz added v1.4.0 labels 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 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
3 participants
You can’t perform that action at this time.