Class Suggestion.Builder<T>

java.lang.Object
co.elastic.clients.elasticsearch.core.search.Suggestion.Builder<T>
All Implemented Interfaces:
ObjectBuilder<Suggestion<T>>
Enclosing class:
Suggestion<T>

public static class Suggestion.Builder<T>
extends java.lang.Object
implements ObjectBuilder<Suggestion<T>>
Builder for Suggestion.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • length

      public Suggestion.Builder<T> length​(int value)
      Required - API name: length
    • offset

      public Suggestion.Builder<T> offset​(int value)
      Required - API name: offset
    • options

      public Suggestion.Builder<T> options​(java.util.List<jakarta.json.JsonValue> value)
      Required - API name: options
    • options

      public Suggestion.Builder<T> options​(jakarta.json.JsonValue... value)
      Required - API name: options
    • addOptions

      public Suggestion.Builder<T> addOptions​(jakarta.json.JsonValue value)
      Add a value to options(List), creating the list if needed.
    • text

      public Suggestion.Builder<T> text​(java.lang.String value)
      Required - API name: text
    • tSerializer

      public Suggestion.Builder<T> tSerializer​(@Nullable JsonpSerializer<T> value)
      Serializer for T. If not set, an attempt will be made to find a serializer from the JSON context.
    • build

      public Suggestion<T> build()
      Builds a Suggestion.
      Specified by:
      build in interface ObjectBuilder<T>
      Throws:
      java.lang.NullPointerException - if some of the required fields are null.