org.elasticsearch.common.xcontent.XContentBuilder.nullValue()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(4.8k)|赞(0)|评价(0)|浏览(79)

本文整理了Java中org.elasticsearch.common.xcontent.XContentBuilder.nullValue()方法的一些代码示例,展示了XContentBuilder.nullValue()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XContentBuilder.nullValue()方法的具体详情如下:
包路径:org.elasticsearch.common.xcontent.XContentBuilder
类名称:XContentBuilder
方法名:nullValue

XContentBuilder.nullValue介绍

暂无

代码示例

代码示例来源:origin: org.elasticsearch/elasticsearch

b.nullValue();
} else {
  BytesRef bytes = ((BytesReference) v).toBytesRef();
  b.nullValue();
} else {
  BytesRef bytes = (BytesRef) v;

代码示例来源:origin: org.elasticsearch/elasticsearch

@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;
}

代码示例来源:origin: org.elasticsearch/elasticsearch

for (StatusOrException slice : sliceStatuses) {
  if (slice == null) {
    builder.nullValue();
  } else {
    slice.toXContent(builder, params);

代码示例来源:origin: org.elasticsearch/elasticsearch-x-content

public XContentBuilder value(byte[] value, int offset, int length) throws IOException {
  if (value == null) {
    return nullValue();
  }
  generator.writeBinary(value, offset, length);
  return this;
}

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

XContentBuilder value(Calendar value) throws IOException {
  if (value == null) {
    return nullValue();
  }
  return value(DEFAULT_DATE_PRINTER, value.getTimeInMillis());
}

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

public XContentBuilder value(Path value) throws IOException {
  if (value == null) {
    return nullValue();
  }
  return value(value.toString());
}

代码示例来源:origin: harbby/presto-connectors

/**
 * 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;
}

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

public XContentBuilder value(ReadableInstant value, DateTimeFormatter formatter) throws IOException {
  if (value == null) {
    return nullValue();
  }
  ensureFormatterNotNull(formatter);
  return value(formatter.print(value));
}

代码示例来源:origin: apache/servicemix-bundles

public XContentBuilder value(ReadableInstant value, DateTimeFormatter formatter) throws IOException {
  if (value == null) {
    return nullValue();
  }
  ensureFormatterNotNull(formatter);
  return value(formatter.print(value));
}

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

private XContentBuilder values(float[] values) throws IOException {
  if (values == null) {
    return nullValue();
  }
  startArray();
  for (float f : values) {
    value(f);
  }
  endArray();
  return this;
}

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

private XContentBuilder values(short[] values) throws IOException {
  if (values == null) {
    return nullValue();
  }
  startArray();
  for (short s : values) {
    value(s);
  }
  endArray();
  return this;
}

代码示例来源:origin: org.elasticsearch/elasticsearch-x-content

private XContentBuilder values(float[] values) throws IOException {
  if (values == null) {
    return nullValue();
  }
  startArray();
  for (float f : values) {
    value(f);
  }
  endArray();
  return this;
}

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

private XContentBuilder values(boolean[] values) throws IOException {
  if (values == null) {
    return nullValue();
  }
  startArray();
  for (boolean b : values) {
    value(b);
  }
  endArray();
  return this;
}

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

private XContentBuilder values(double[] values) throws IOException {
  if (values == null) {
    return nullValue();
  }
  startArray();
  for (double b : values) {
    value(b);
  }
  endArray();
  return this;
}

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

private XContentBuilder values(long[] values) throws IOException {
  if (values == null) {
    return nullValue();
  }
  startArray();
  for (long l : values) {
    value(l);
  }
  endArray();
  return this;
}

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

private XContentBuilder values(String[] values) throws IOException {
  if (values == null) {
    return nullValue();
  }
  startArray();
  for (String s : values) {
    value(s);
  }
  endArray();
  return this;
}

代码示例来源:origin: org.elasticsearch/elasticsearch-x-content

private XContentBuilder values(boolean[] values) throws IOException {
  if (values == null) {
    return nullValue();
  }
  startArray();
  for (boolean b : values) {
    value(b);
  }
  endArray();
  return this;
}

代码示例来源:origin: org.elasticsearch/elasticsearch-x-content

private XContentBuilder values(long[] values) throws IOException {
  if (values == null) {
    return nullValue();
  }
  startArray();
  for (long l : values) {
    value(l);
  }
  endArray();
  return this;
}

代码示例来源:origin: org.elasticsearch/elasticsearch-x-content

private XContentBuilder values(short[] values) throws IOException {
  if (values == null) {
    return nullValue();
  }
  startArray();
  for (short s : values) {
    value(s);
  }
  endArray();
  return this;
}

代码示例来源:origin: apache/servicemix-bundles

private XContentBuilder values(int[] values) throws IOException {
  if (values == null) {
    return nullValue();
  }
  startArray();
  for (int i : values) {
    value(i);
  }
  endArray();
  return this;
}

相关文章

微信公众号

最新文章

更多