org.elasticsearch.common.text
Class BytesText

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

public class BytesText
extends Object
implements Text

A BytesReference representation of the text, will always convert on the fly to a String.


Constructor Summary
BytesText(BytesReference bytes)
           
 
Method Summary
 BytesReference bytes()
          The UTF8 bytes representing the the text, might be converted on the fly, see Text.hasBytes()
 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
 

Constructor Detail

BytesText

public BytesText(BytesReference bytes)
Method Detail

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.