Package org.mcpjava.server.completion
Interface CompletionResult
- All Superinterfaces:
MetaCarrier
The result of a completion request, listing the possible completion values for a variable.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceBuilder for creation completion responses. -
Method Summary
Modifier and TypeMethodDescriptionstatic CompletionResult.Builderbuilder()Create a new builder for aCompletionResult.hasMore()Returns whether or not there are more suggestions than are included invalues(), if known.static CompletionResultnewCompleteResult(List<String> values) Creates a newCompletionResultwith a list of suggestions that is the complete set of available suggestions.static CompletionResultnewIncompleteResult(List<String> values) Creates a newCompletionResultwith a list of suggestions that is not the complete set of available suggestions.static CompletionResultCreates a newCompletionResultwhich includes a list of suggestions and the total number of available suggestions.total()Returns the total number of suggestions available, if known.values()Returns the list of suggestions (max 100).Methods inherited from interface org.mcpjava.server.MetaCarrier
metadata
-
Method Details
-
values
Returns the list of suggestions (max 100).- Returns:
- the list of suggestions
-
total
OptionalInt total()Returns the total number of suggestions available, if known.This may exceed the size of
values().- Returns:
- the total number of suggestions available, or an empty optional if not known
-
hasMore
Returns whether or not there are more suggestions than are included invalues(), if known.- Returns:
- An
Optionalcontainingtrueif there are more suggestions,falseif there are not, or an emptyOptionalif it is not known
-
builder
Create a new builder for aCompletionResult.- Returns:
- the new
CompletionResultbuilder
-
newCompleteResult
Creates a newCompletionResultwith a list of suggestions that is the complete set of available suggestions.- Parameters:
values- the list of suggestions- Returns:
- the new completion result
-
newIncompleteResult
Creates a newCompletionResultwith a list of suggestions that is not the complete set of available suggestions.- Parameters:
values- the list of suggestions- Returns:
- the new completion result
-
newResult
Creates a newCompletionResultwhich includes a list of suggestions and the total number of available suggestions.- Parameters:
values- the list of suggestionstotal- the total number of available suggestions- Returns:
- the new completion result
- Throws:
IllegalArgumentException- iftotalis less thanvalues.size()
-