Class Suggest.Suggestion<T extends Suggest.Suggestion.Entry>

    • Constructor Detail

      • Suggestion

        public Suggestion​(java.lang.String name,
                          int size)
      • Suggestion

        public Suggestion​(StreamInput in)
                   throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • addTerm

        public void addTerm​(T entry)
      • getWriteableType

        @Deprecated
        public int getWriteableType()
        Deprecated.
        Returns a integer representing the type of the suggestion. This is used for internal serialization over the network. This class is now serialized as a NamedWriteable and this method only remains for backwards compatibility
      • iterator

        public java.util.Iterator<T> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<T extends Suggest.Suggestion.Entry>
      • getEntries

        public java.util.List<T> getEntries()
        Returns:
        The entries for this suggestion.
      • getName

        public java.lang.String getName()
        Returns:
        The name of the suggestion as is defined in the request.
      • getSize

        public int getSize()
        Returns:
        The number of requested suggestion option size
      • trim

        public void trim()
        Trims the number of options per suggest text term to the requested size. For internal usage.
      • newEntry

        protected abstract T newEntry​(StreamInput in)
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • getWriteableName

        public abstract java.lang.String getWriteableName()
        Description copied from interface: NamedWriteable
        Returns the name of the writeable object
        Specified by:
        getWriteableName in interface NamedWriteable
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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