本文整理了Java中org.elasticsearch.common.text.Text.bytes()
方法的一些代码示例,展示了Text.bytes()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Text.bytes()
方法的具体详情如下:
包路径:org.elasticsearch.common.text.Text
类名称:Text
方法名:bytes
[英]Returns a BytesReference view of the data.
[中]返回数据的字节引用视图。
代码示例来源:origin: org.elasticsearch/elasticsearch
@Override
public int compareTo(Text text) {
return bytes().compareTo(text.bytes());
}
代码示例来源:origin: org.elasticsearch/elasticsearch
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
return bytes().equals(((Text) obj).bytes());
}
代码示例来源:origin: org.elasticsearch/elasticsearch
@Override
public int hashCode() {
if (hash == 0) {
hash = bytes().hashCode();
}
return hash;
}
代码示例来源:origin: org.elasticsearch/elasticsearch
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
if (hasString()) {
return builder.value(this.string());
} else {
// TODO: TextBytesOptimization we can use a buffer here to convert it? maybe add a
// request to jackson to support InputStream as well?
BytesRef br = this.bytes().toBytesRef();
return builder.utf8Value(br.bytes, br.offset, br.length);
}
}
}
代码示例来源:origin: org.elasticsearch/elasticsearch
public void writeText(Text text) throws IOException {
if (!text.hasBytes()) {
final String string = text.string();
spare.copyChars(string);
writeInt(spare.length());
write(spare.bytes(), 0, spare.length());
} else {
BytesReference bytes = text.bytes();
writeInt(bytes.length());
bytes.writeTo(this);
}
}
代码示例来源:origin: harbby/presto-connectors
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
return bytes().equals(((Text) obj).bytes());
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch
@Override
public int compareTo(Text text) {
return bytes().compareTo(text.bytes());
}
代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch
@Override
public int compareTo(Text text) {
return bytes().compareTo(text.bytes());
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
return bytes().equals(((Text) obj).bytes());
}
代码示例来源:origin: apache/servicemix-bundles
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
return bytes().equals(((Text) obj).bytes());
}
代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
return bytes().equals(((Text) obj).bytes());
}
代码示例来源:origin: apache/servicemix-bundles
@Override
public int hashCode() {
if (hash == 0) {
hash = bytes().hashCode();
}
return hash;
}
代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch
@Override
public int hashCode() {
if (hash == 0) {
hash = bytes().hashCode();
}
return hash;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
if (hasString()) {
return builder.value(this.string());
} else {
// TODO: TextBytesOptimization we can use a buffer here to convert it? maybe add a
// request to jackson to support InputStream as well?
BytesRef br = this.bytes().toBytesRef();
return builder.utf8Value(br.bytes, br.offset, br.length);
}
}
}
代码示例来源:origin: apache/servicemix-bundles
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
if (hasString()) {
return builder.value(this.string());
} else {
// TODO: TextBytesOptimization we can use a buffer here to convert it? maybe add a
// request to jackson to support InputStream as well?
BytesRef br = this.bytes().toBytesRef();
return builder.utf8Value(br.bytes, br.offset, br.length);
}
}
}
代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch
public XContentBuilder value(Text value) throws IOException {
if (value == null) {
return nullValue();
} else if (value.hasString()) {
return value(value.string());
} else {
// TODO: TextBytesOptimization we can use a buffer here to convert it? maybe add a
// request to jackson to support InputStream as well?
return utf8Value(value.bytes().toBytesRef());
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch
public void writeText(Text text) throws IOException {
if (!text.hasBytes()) {
final String string = text.string();
spare.copyChars(string);
writeInt(spare.length());
write(spare.bytes(), 0, spare.length());
} else {
BytesReference bytes = text.bytes();
writeInt(bytes.length());
bytes.writeTo(this);
}
}
代码示例来源:origin: apache/servicemix-bundles
public void writeText(Text text) throws IOException {
if (!text.hasBytes()) {
final String string = text.string();
spare.copyChars(string);
writeInt(spare.length());
write(spare.bytes(), 0, spare.length());
} else {
BytesReference bytes = text.bytes();
writeInt(bytes.length());
bytes.writeTo(this);
}
}
代码示例来源:origin: harbby/presto-connectors
public void writeText(Text text) throws IOException {
if (!text.hasBytes()) {
final String string = text.string();
spare.copyChars(string);
writeInt(spare.length());
write(spare.bytes(), 0, spare.length());
} else {
BytesReference bytes = text.bytes();
writeInt(bytes.length());
bytes.writeTo(this);
}
}
代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch
public void writeText(Text text) throws IOException {
if (!text.hasBytes()) {
final String string = text.string();
spare.copyChars(string);
writeInt(spare.length());
write(spare.bytes(), 0, spare.length());
} else {
BytesReference bytes = text.bytes();
writeInt(bytes.length());
bytes.writeTo(this);
}
}
内容来源于网络,如有侵权,请联系作者删除!