Class Text

  • All Implemented Interfaces:
    java.lang.Comparable<Text>, ToXContent, ToXContentFragment

    public final class Text
    extends java.lang.Object
    implements java.lang.Comparable<Text>, 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.
    • Field Detail

      • EMPTY_ARRAY

        public static final Text[] EMPTY_ARRAY
    • Constructor Detail

      • Text

        public Text​(java.lang.String text)
    • Method Detail

      • convertFromStringArray

        public static Text[] convertFromStringArray​(java.lang.String[] strings)
      • hasBytes

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

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

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • compareTo

        public int compareTo​(Text text)
        Specified by:
        compareTo in interface java.lang.Comparable<Text>