Package org.mcpjava.server.completion
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 Summary
Modifier and TypeMethodDescriptionAdds a value to the list of completion suggestions.addValues(Collection<String> values) Adds a collection of values to the list of completion suggestions.build()Builds the new completion result.setHasMore(Boolean hasMore) Sets whether there are more suggestions available than are added usingaddValue(String)oraddValues(Collection).setTotal(int total) Sets the total number of suggestions available.Methods inherited from interface org.mcpjava.server.MetaCarrier.Builder
putMetadata, setMetadata
-
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
Sets the total number of suggestions available. This may be greater than the number of suggestions added withaddValue(String)andaddValues(Collection)- Parameters:
total- the total number of suggestions available- Returns:
- this builder
-
setHasMore
Sets whether there are more suggestions available than are added usingaddValue(String)oraddValues(Collection).- Parameters:
hasMore-trueif there are more suggestions,falseif there are not- Returns:
- this builder
-
build
CompletionResult build()Builds the new completion result.- Returns:
- the new completion result
-