Core: Improve XContentBuilder API.
This commit is contained in:
parent
c7a9b3da5b
commit
ac40eae3e3
|
@ -1017,7 +1017,7 @@ public final class XContentBuilder implements BytesStream, Releasable {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public XContentBuilder map(Map<String, Object> map) throws IOException {
|
public XContentBuilder map(Map<String, ?> map) throws IOException {
|
||||||
if (map == null) {
|
if (map == null) {
|
||||||
return nullValue();
|
return nullValue();
|
||||||
}
|
}
|
||||||
|
@ -1103,10 +1103,10 @@ public final class XContentBuilder implements BytesStream, Releasable {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void writeMap(Map<String, Object> map) throws IOException {
|
private void writeMap(Map<String, ?> map) throws IOException {
|
||||||
generator.writeStartObject();
|
generator.writeStartObject();
|
||||||
|
|
||||||
for (Map.Entry<String, Object> entry : map.entrySet()) {
|
for (Map.Entry<String, ?> entry : map.entrySet()) {
|
||||||
field(entry.getKey());
|
field(entry.getKey());
|
||||||
Object value = entry.getValue();
|
Object value = entry.getValue();
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
|
|
Loading…
Reference in New Issue