Interface CompletionResult.Builder

All Superinterfaces:
MetaCarrier.Builder<CompletionResult.Builder>
Enclosing interface:
CompletionResult

public static interface CompletionResult.Builder extends MetaCarrier.Builder<CompletionResult.Builder>
Builder for creation completion responses.
  • Method Details

    • addValue

      Adds a value to the list of completion suggestions.

      The number of suggestions added should not be greater than 100

      Parameters:
      value - the value to add
      Returns:
      this builder
    • addValues

      Adds a collection of values to the list of completion suggestions.

      The number of suggestions added should be greater than 100

      Parameters:
      values - the values to add
      Returns:
      this builder
    • setTotal

      CompletionResult.Builder setTotal(int total)
      Sets the total number of suggestions available. This may be greater than the number of suggestions added with addValue(String) and addValues(Collection)
      Parameters:
      total - the total number of suggestions available
      Returns:
      this builder
    • setHasMore

      CompletionResult.Builder setHasMore(Boolean hasMore)
      Sets whether there are more suggestions available than are added using addValue(String) or addValues(Collection).
      Parameters:
      hasMore - true if there are more suggestions, false if there are not
      Returns:
      this builder
    • build

      Builds the new completion result.
      Returns:
      the new completion result