@Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.field(name); if (fragments == null) { builder.nullValue(); } else { builder.startArray(); for (Text fragment : fragments) { builder.value(fragment); } builder.endArray(); } return builder; }
for (StatusOrException slice : sliceStatuses) { if (slice == null) { builder.nullValue(); } else { slice.toXContent(builder, params);
public XContentBuilder value(byte[] value, int offset, int length) throws IOException { if (value == null) { return nullValue(); } generator.writeBinary(value, offset, length); return this; }
XContentBuilder value(Calendar value) throws IOException { if (value == null) { return nullValue(); } return value(DEFAULT_DATE_PRINTER, value.getTimeInMillis()); }
public XContentBuilder value(Path value) throws IOException { if (value == null) { return nullValue(); } return value(value.toString()); }
/** * Writes the binary content of the given BytesRef * Use {@link org.elasticsearch.common.xcontent.XContentParser#binaryValue()} to read the value back */ public XContentBuilder value(BytesRef value) throws IOException { if (value == null) { return nullValue(); } generator.writeBinary(value.bytes, value.offset, value.length); return this; }
public XContentBuilder value(ReadableInstant value, DateTimeFormatter formatter) throws IOException { if (value == null) { return nullValue(); } ensureFormatterNotNull(formatter); return value(formatter.print(value)); }
public XContentBuilder value(ReadableInstant value, DateTimeFormatter formatter) throws IOException { if (value == null) { return nullValue(); } ensureFormatterNotNull(formatter); return value(formatter.print(value)); }
private XContentBuilder values(float[] values) throws IOException { if (values == null) { return nullValue(); } startArray(); for (float f : values) { value(f); } endArray(); return this; }
private XContentBuilder values(short[] values) throws IOException { if (values == null) { return nullValue(); } startArray(); for (short s : values) { value(s); } endArray(); return this; }
private XContentBuilder values(float[] values) throws IOException { if (values == null) { return nullValue(); } startArray(); for (float f : values) { value(f); } endArray(); return this; }
private XContentBuilder values(boolean[] values) throws IOException { if (values == null) { return nullValue(); } startArray(); for (boolean b : values) { value(b); } endArray(); return this; }
private XContentBuilder values(double[] values) throws IOException { if (values == null) { return nullValue(); } startArray(); for (double b : values) { value(b); } endArray(); return this; }
private XContentBuilder values(long[] values) throws IOException { if (values == null) { return nullValue(); } startArray(); for (long l : values) { value(l); } endArray(); return this; }
private XContentBuilder values(String[] values) throws IOException { if (values == null) { return nullValue(); } startArray(); for (String s : values) { value(s); } endArray(); return this; }
private XContentBuilder values(boolean[] values) throws IOException { if (values == null) { return nullValue(); } startArray(); for (boolean b : values) { value(b); } endArray(); return this; }
private XContentBuilder values(long[] values) throws IOException { if (values == null) { return nullValue(); } startArray(); for (long l : values) { value(l); } endArray(); return this; }
private XContentBuilder values(short[] values) throws IOException { if (values == null) { return nullValue(); } startArray(); for (short s : values) { value(s); } endArray(); return this; }
private XContentBuilder values(int[] values) throws IOException { if (values == null) { return nullValue(); } startArray(); for (int i : values) { value(i); } endArray(); return this; }