Class Text

org.elasticsearch.common.text.Text
All Implemented Interfaces:
<Text>, org.elasticsearch.common.xcontent.ToXContent, org.elasticsearch.common.xcontent.ToXContentFragment

public final class Text extends implements <Text>, org.elasticsearch.common.xcontent.ToXContentFragment
Both 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
    Modifier and Type
    Field
    Description
    static Text[]
     

    Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent

    EMPTY_PARAMS
  • Constructor Summary

    Constructors
    Constructor
    Description
     text)
     
    Text​(BytesReference bytes)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a BytesReference view of the data.
    int
    compareTo​(Text text)
     
    static Text[]
    [] strings)
     
    boolean
     obj)
     
    boolean
    Whether a BytesReference view of the data is already materialized.
    int
     
    boolean
    Whether a view of the data is already materialized.
    Returns a view of the data.
     
    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.

    , , , , , , ,

    Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment

    isFragment
  • Field Details

    • EMPTY_ARRAY

      public static final Text[] EMPTY_ARRAY
  • Constructor Details

    • Text

      public Text(BytesReference bytes)
    • Text

      public Text( text)
  • Method Details

    • convertFromStringArray

      public static [] strings)
    • hasBytes

      public boolean hasBytes()
      Whether a BytesReference view of the data is already materialized.
    • bytes

      public BytesReference bytes()
      Returns a BytesReference view of the data.
    • hasString

      public boolean hasString()
      Whether a view of the data is already materialized.
    • string

      public  string()
      Returns a view of the data.
    • toString

      public  toString()
      Overrides:
       in class 
    • hashCode

      public int hashCode()
      Overrides:
       in class 
    • equals

      public boolean equals( obj)
      Overrides:
       in class 
    • compareTo

      public int compareTo(Text text)
      Specified by:
       in interface <Text>
    • toXContent

      public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws
      Specified by:
      toXContent in interface org.elasticsearch.common.xcontent.ToXContent
      Throws: