org.elasticsearch.common.text
Class StringText

java.lang.Object
  extended by org.elasticsearch.common.text.StringText
All Implemented Interfaces:
Text

public class StringText
extends Object
implements Text

A String only representation of the text. Will always convert to bytes on the fly.


Field Summary
static Text[] EMPTY_ARRAY
           
 
Constructor Summary
StringText(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

EMPTY_ARRAY

public static final Text[] EMPTY_ARRAY
Constructor Detail

StringText

public StringText(String text)
Method Detail

convertFromStringArray

public static Text[] convertFromStringArray(String[] strings)

hasBytes

public boolean hasBytes()
Description copied from interface: Text
Are bytes available without the need to be converted into bytes when calling Text.bytes().

Specified by:
hasBytes in interface Text

bytes

public BytesReference bytes()
Description copied from interface: Text
The UTF8 bytes representing the the text, might be converted on the fly, see Text.hasBytes()

Specified by:
bytes in interface Text

hasString

public boolean hasString()
Description copied from interface: Text
Is there a String representation of the text. If not, then it Text.hasBytes().

Specified by:
hasString in interface Text

string

public String string()
Description copied from interface: Text
Returns the string representation of the text, might be converted to a string on the fly.

Specified by:
string in interface Text

toString

public String toString()
Description copied from interface: Text
Returns the string representation of the text, might be converted to a string on the fly.

Specified by:
toString in interface Text
Overrides:
toString in class Object


Copyright © 2009-2012. All Rights Reserved.