java.lang.Comparable<Text>
public final class Text extends java.lang.Object implements java.lang.Comparable<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 | Description |
---|---|---|
static Text[] |
EMPTY_ARRAY |
Constructor | Description |
---|---|
Text(java.lang.String text) |
|
Text(BytesReference bytes) |
Modifier and Type | Method | Description |
---|---|---|
BytesReference |
bytes() |
Returns a
BytesReference view of the data. |
int |
compareTo(Text text) |
|
static Text[] |
convertFromStringArray(java.lang.String[] strings) |
|
boolean |
equals(java.lang.Object obj) |
|
boolean |
hasBytes() |
Whether a
BytesReference view of the data is already materialized. |
int |
hashCode() |
|
boolean |
hasString() |
Whether a
String view of the data is already materialized. |
java.lang.String |
string() |
Returns a
String view of the data. |
java.lang.String |
toString() |
public static final Text[] EMPTY_ARRAY
public Text(BytesReference bytes)
public Text(java.lang.String text)
public static Text[] convertFromStringArray(java.lang.String[] strings)
public boolean hasBytes()
BytesReference
view of the data is already materialized.public BytesReference bytes()
BytesReference
view of the data.public boolean hasString()
String
view of the data is already materialized.public java.lang.String string()
String
view of the data.public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object