Package org.elasticsearch.common.text
Class Text
java.lang.Object
org.elasticsearch.common.text.Text
- All Implemented Interfaces:
Comparable<Text>
,org.elasticsearch.common.xcontent.ToXContent
,org.elasticsearch.common.xcontent.ToXContentFragment
public final class Text
extends Object
implements Comparable<Text>, org.elasticsearch.common.xcontent.ToXContentFragment
Both
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.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.Params
-
Field Summary
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbytes()
Returns aBytesReference
view of the data.int
static Text[]
convertFromStringArray(String[] strings)
boolean
boolean
hasBytes()
Whether aBytesReference
view of the data is already materialized.int
hashCode()
boolean
Whether aString
view of the data is already materialized.string()
Returns aString
view of the data.toString()
org.elasticsearch.common.xcontent.XContentBuilder
toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
Field Details
-
EMPTY_ARRAY
-
-
Constructor Details
-
Text
-
Text
-
-
Method Details
-
convertFromStringArray
-
hasBytes
public boolean hasBytes()Whether aBytesReference
view of the data is already materialized. -
bytes
Returns aBytesReference
view of the data. -
hasString
public boolean hasString()Whether aString
view of the data is already materialized. -
string
Returns aString
view of the data. -
toString
-
hashCode
public int hashCode() -
equals
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Text>
-
toXContent
public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws IOException- Specified by:
toXContent
in interfaceorg.elasticsearch.common.xcontent.ToXContent
- Throws:
IOException
-