java.lang.Comparable<Text>
, ToXContent
, ToXContentFragment
public final class Text extends java.lang.Object implements java.lang.Comparable<Text>, ToXContentFragment
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.ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Modifier and Type | Field | Description |
---|---|---|
static Text[] |
EMPTY_ARRAY |
EMPTY_PARAMS
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() |
|
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
isFragment
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
public int compareTo(Text text)
compareTo
in interface java.lang.Comparable<Text>
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
toXContent
in interface ToXContent
java.io.IOException