Class SuggestOption<TDocument>

java.lang.Object
co.elastic.clients.elasticsearch.core.search.SuggestOption<TDocument>
All Implemented Interfaces:
JsonpSerializable, TaggedUnion<SuggestOption.Kind,​java.lang.Object>

public class SuggestOption<TDocument>
extends java.lang.Object
implements TaggedUnion<SuggestOption.Kind,​java.lang.Object>, JsonpSerializable
See Also:
API specification
  • Method Details

    • _kind

      public final SuggestOption.Kind _kind()
      Description copied from interface: TaggedUnion
      Get the of the kind of variant held by this object.
      Specified by:
      _kind in interface TaggedUnion<SuggestOption.Kind,​java.lang.Object>
      Returns:
      the variant kind
    • _get

      public final java.lang.Object _get()
      Specified by:
      _get in interface TaggedUnion<SuggestOption.Kind,​java.lang.Object>
    • of

      public static <TDocument> SuggestOption<TDocument> of​(java.util.function.Function<SuggestOption.Builder<TDocument>,​ObjectBuilder<SuggestOption<TDocument>>> fn)
    • isCompletion

      public boolean isCompletion()
      Is this variant instance of kind completion?
    • completion

      public CompletionSuggestOption<TDocument> completion()
      Get the completion variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the completion kind.
    • isPhrase

      public boolean isPhrase()
      Is this variant instance of kind phrase?
    • phrase

      public PhraseSuggestOption phrase()
      Get the phrase variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the phrase kind.
    • isTerm

      public boolean isTerm()
      Is this variant instance of kind term?
    • term

      public TermSuggestOption term()
      Get the term variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the term kind.
    • serialize

      public void serialize​(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
      Specified by:
      serialize in interface JsonpSerializable
    • createSuggestOptionDeserializer

      public static <TDocument> JsonpDeserializer<SuggestOption<TDocument>> createSuggestOptionDeserializer​(JsonpDeserializer<TDocument> tDocumentDeserializer)