|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.elasticsearch.common.text.StringAndBytesText
public class StringAndBytesText
Both 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.
Field Summary | |
---|---|
static Text[] |
EMPTY_ARRAY
|
Constructor Summary | |
---|---|
StringAndBytesText(BytesReference bytes)
|
|
StringAndBytesText(String text)
|
Method Summary | |
---|---|
BytesReference |
bytes()
The UTF8 bytes representing the the text, might be converted on the fly, see Text.hasBytes() |
static Text[] |
convertFromStringArray(String[] strings)
|
boolean |
hasBytes()
Are bytes available without the need to be converted into bytes when calling Text.bytes() . |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Text[] EMPTY_ARRAY
Constructor Detail |
---|
public StringAndBytesText(BytesReference bytes)
public StringAndBytesText(String text)
Method Detail |
---|
public static Text[] convertFromStringArray(String[] strings)
public boolean hasBytes()
Text
Text.bytes()
.
hasBytes
in interface Text
public BytesReference bytes()
Text
Text.hasBytes()
bytes
in interface Text
public boolean hasString()
Text
String
representation of the text. If not, then it Text.hasBytes()
.
hasString
in interface Text
public String string()
Text
string
in interface Text
public String toString()
Text
toString
in interface Text
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |