public class StringAndBytesText extends Object implements 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 |
|---|
StringAndBytesText(BytesReference bytes) |
StringAndBytesText(String text) |
| Modifier and Type | Method and Description |
|---|---|
BytesReference |
bytes()
The UTF8 bytes representing the the text, might be converted on the fly, see
Text.hasBytes() |
int |
compareTo(Text text) |
static Text[] |
convertFromStringArray(String[] strings) |
boolean |
equals(Object obj) |
boolean |
hasBytes()
Are bytes available without the need to be converted into bytes when calling
Text.bytes(). |
int |
hashCode() |
boolean |
hasString()
Is there a
String representation of the text. |
String |
string()
Returns the string representation of the text, might be converted to a string on the fly.
|
String |
toString()
Returns the string representation of the text, might be converted to a string on the fly.
|
public static final Text[] EMPTY_ARRAY
public StringAndBytesText(BytesReference bytes)
public StringAndBytesText(String text)
public boolean hasBytes()
TextText.bytes().public BytesReference bytes()
TextText.hasBytes()public boolean hasString()
TextString representation of the text. If not, then it Text.hasBytes().public String string()
Textpublic String toString()
Textpublic int compareTo(Text text)
compareTo in interface Comparable<Text>Copyright © 2009–2016. All rights reserved.