public final class Text extends Object implements Comparable<Text>
String
and BytesReference
representation of the text. Starts with one of those, and if
the other is requests, caches the other one in a local reference so no additional conversion will be needed.Modifier and Type | Field and Description |
---|---|
static Text[] |
EMPTY_ARRAY |
Constructor and Description |
---|
Text(BytesReference bytes) |
Text(String text) |
Modifier and Type | Method and Description |
---|---|
BytesReference |
bytes()
Returns a
BytesReference view of the data. |
int |
compareTo(Text text) |
static Text[] |
convertFromStringArray(String[] strings) |
boolean |
equals(Object obj) |
boolean |
hasBytes()
Whether a
BytesReference view of the data is already materialized. |
int |
hashCode() |
boolean |
hasString()
Whether a
String view of the data is already materialized. |
String |
string()
Returns a
String view of the data. |
String |
toString() |
public static final Text[] EMPTY_ARRAY
public Text(BytesReference bytes)
public Text(String text)
public boolean hasBytes()
BytesReference
view of the data is already materialized.public BytesReference bytes()
BytesReference
view of the data.public boolean hasString()
String
view of the data is already materialized.public int compareTo(Text text)
compareTo
in interface Comparable<Text>
Copyright © 2009–2016. All rights reserved.