org.elasticsearch.common.text
Interface Text

All Known Implementing Classes:
BytesText, StringAndBytesText, StringText

public interface Text

Text represents a (usually) long text data. We use this abstraction instead of String so we can represent it in a more optimized manner in memory as well as serializing it over the network as well as converting it to json format.


Method Summary
 BytesReference bytes()
          The UTF8 bytes representing the the text, might be converted on the fly, see hasBytes()
 boolean hasBytes()
          Are bytes available without the need to be converted into bytes when calling 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.
 

Method Detail

hasBytes

boolean hasBytes()
Are bytes available without the need to be converted into bytes when calling bytes().


bytes

BytesReference bytes()
The UTF8 bytes representing the the text, might be converted on the fly, see hasBytes()


hasString

boolean hasString()
Is there a String representation of the text. If not, then it hasBytes().


string

String string()
Returns the string representation of the text, might be converted to a string on the fly.


toString

String toString()
Returns the string representation of the text, might be converted to a string on the fly.

Overrides:
toString in class Object


Copyright © 2009-2012. All Rights Reserved.