CommandAPI 9.6.0
An API for the command UI introduced in Minecraft 1.13
dev.jorel.commandapi.arguments.SafeSuggestions< S, CommandSender > Interface Template Reference

This class represents safe suggestions. More...

Public Member Functions

ArgumentSuggestions< CommandSender > toSuggestions (Function< S, String > mapper)
 Convert this SafeSuggestions object into an ArgumentSuggestions by mapping the values with a string mapping function. More...
 
static< T, CommandSender > SafeSuggestions< T, CommandSender > empty ()
 Create an empty SafeSuggestions object. More...
 
static< T, CommandSender > SafeSuggestions< T, CommandSender > suggest (T... suggestions)
 Hardcode an array of values to suggest. More...
 
static< T, CommandSender > SafeSuggestions< T, CommandSender > suggest (Collection< T > suggestions)
 Hardcode a collection of values to suggest. More...
 
static< T, CommandSender > SafeSuggestions< T, CommandSender > suggest (Function< SuggestionInfo< CommandSender >, T[]> suggestions)
 Suggest an array of values as the result of a function. More...
 
static< T, CommandSender > SafeSuggestions< T, CommandSender > suggestCollection (Function< SuggestionInfo< CommandSender >, Collection< T > > suggestions)
 Suggest a collection of values as the result of a function. More...
 
static< T, CommandSender > SafeSuggestions< T, CommandSender > suggestAsync (Function< SuggestionInfo< CommandSender >, CompletableFuture< T[]> > suggestions)
 Suggest an array of values provided asynchronously. More...
 
static< T, CommandSender > SafeSuggestions< T, CommandSender > suggestCollectionAsync (Function< SuggestionInfo< CommandSender >, CompletableFuture< Collection< T > > > suggestions)
 Suggest a collection of values provided asynchronously. More...
 
static< T, CommandSender > SafeSuggestions< T, CommandSender > tooltips (Tooltip< T >... suggestions)
 Suggest an array of hardcoded values with tooltips. More...
 
static< T, CommandSender > SafeSuggestions< T, CommandSender > tooltips (Collection< Tooltip< T > > suggestions)
 Suggest a collection of hardcoded values with tooltips. More...
 
static< T, CommandSender > SafeSuggestions< T, CommandSender > tooltips (Function< SuggestionInfo< CommandSender >, Tooltip< T >[]> suggestions)
 Suggest an array of values with tooltips as the result of a function. More...
 
static< T, CommandSender > SafeSuggestions< T, CommandSender > tooltipCollection (Function< SuggestionInfo< CommandSender >, Collection< Tooltip< T > > > suggestions)
 Suggest a collection of values with tooltips as the result of a function. More...
 
static< T, CommandSender > SafeSuggestions< T, CommandSender > tooltipsAsync (Function< SuggestionInfo< CommandSender >, CompletableFuture< Tooltip< T >[]> > suggestions)
 Suggest an array of values with tooltips asynchronously. More...
 
static< T, CommandSender > SafeSuggestions< T, CommandSender > tooltipCollectionAsync (Function< SuggestionInfo< CommandSender >, CompletableFuture< Collection< Tooltip< T > > > > suggestions)
 Suggest a collection of values with tooltips asynchronously. More...
 

Detailed Description

This class represents safe suggestions.

These are parameterized suggestions which can be converted into a string under a mapping function. SafeSuggestions instances are best created using the static methods as opposed to functionally.

Parameters
<S>the type of the suggestions

Member Function Documentation

◆ empty()

static< T, CommandSender > SafeSuggestions< T, CommandSender > dev.jorel.commandapi.arguments.SafeSuggestions< S, CommandSender >.empty ( )

Create an empty SafeSuggestions object.

Parameters
<T>type parameter of the SafeSuggestions object
Returns
a SafeSuggestions object resulting in empty suggestions

◆ suggest() [1/3]

static< T, CommandSender > SafeSuggestions< T, CommandSender > dev.jorel.commandapi.arguments.SafeSuggestions< S, CommandSender >.suggest ( Collection< T >  suggestions)

Hardcode a collection of values to suggest.

Parameters
suggestionscollection of hardcoded values
<T>type of the values
Returns
a SafeSuggestions object suggesting the hardcoded suggestions

◆ suggest() [2/3]

static< T, CommandSender > SafeSuggestions< T, CommandSender > dev.jorel.commandapi.arguments.SafeSuggestions< S, CommandSender >.suggest ( Function< SuggestionInfo< CommandSender >, T[]>  suggestions)

Suggest an array of values as the result of a function.

Parameters
suggestionsfunction providing the array of values
<T>type of the values
Returns
a SafeSuggestion object suggesting the result of the function

◆ suggest() [3/3]

static< T, CommandSender > SafeSuggestions< T, CommandSender > dev.jorel.commandapi.arguments.SafeSuggestions< S, CommandSender >.suggest ( T...  suggestions)

Hardcode an array of values to suggest.

Parameters
suggestionsarray of hardcoded values
<T>type of the values
Returns
a SafeSuggestions object suggesting the hardcoded suggestions

◆ suggestAsync()

static< T, CommandSender > SafeSuggestions< T, CommandSender > dev.jorel.commandapi.arguments.SafeSuggestions< S, CommandSender >.suggestAsync ( Function< SuggestionInfo< CommandSender >, CompletableFuture< T[]> >  suggestions)

Suggest an array of values provided asynchronously.

Parameters
suggestionsfunction providing the array of values asynchronously
<T>type of the values
Returns
a SafeSuggestion object suggestion the result of the asynchronous function

◆ suggestCollection()

static< T, CommandSender > SafeSuggestions< T, CommandSender > dev.jorel.commandapi.arguments.SafeSuggestions< S, CommandSender >.suggestCollection ( Function< SuggestionInfo< CommandSender >, Collection< T > >  suggestions)

Suggest a collection of values as the result of a function.

Parameters
suggestionsfunction providing the collection of values
<T>type of the values
Returns
a SafeSuggestion object suggesting the result of the function

◆ suggestCollectionAsync()

static< T, CommandSender > SafeSuggestions< T, CommandSender > dev.jorel.commandapi.arguments.SafeSuggestions< S, CommandSender >.suggestCollectionAsync ( Function< SuggestionInfo< CommandSender >, CompletableFuture< Collection< T > > >  suggestions)

Suggest a collection of values provided asynchronously.

Parameters
suggestionsfunction providing the collection of values asynchronously
<T>type of the values
Returns
a SafeSuggestion object suggestion the result of the asynchronous function

◆ tooltipCollection()

static< T, CommandSender > SafeSuggestions< T, CommandSender > dev.jorel.commandapi.arguments.SafeSuggestions< S, CommandSender >.tooltipCollection ( Function< SuggestionInfo< CommandSender >, Collection< Tooltip< T > > >  suggestions)

Suggest a collection of values with tooltips as the result of a function.

Parameters
suggestionsfunction providing the collection of values with tooltips
<T>type of the values
Returns
a SafeSuggestion object suggesting the result of the function

◆ tooltipCollectionAsync()

static< T, CommandSender > SafeSuggestions< T, CommandSender > dev.jorel.commandapi.arguments.SafeSuggestions< S, CommandSender >.tooltipCollectionAsync ( Function< SuggestionInfo< CommandSender >, CompletableFuture< Collection< Tooltip< T > > > >  suggestions)

Suggest a collection of values with tooltips asynchronously.

Parameters
suggestionsfunction providing the array of values with tooltips asynchronously
<T>type of the values
Returns
a SafeSuggestion suggesting the result of the asynchronous function

◆ tooltips() [1/3]

static< T, CommandSender > SafeSuggestions< T, CommandSender > dev.jorel.commandapi.arguments.SafeSuggestions< S, CommandSender >.tooltips ( Collection< Tooltip< T > >  suggestions)

Suggest a collection of hardcoded values with tooltips.

Parameters
suggestionscollection of hardcoded values with their tooltips
<T>type of the values
Returns
a SafeSuggestion object suggesting the hardcoded values

◆ tooltips() [2/3]

static< T, CommandSender > SafeSuggestions< T, CommandSender > dev.jorel.commandapi.arguments.SafeSuggestions< S, CommandSender >.tooltips ( Function< SuggestionInfo< CommandSender >, Tooltip< T >[]>  suggestions)

Suggest an array of values with tooltips as the result of a function.

Parameters
suggestionsfunction providing the array of values with tooltips
<T>type of the values
Returns
a SafeSuggestion object suggesting the result of the function

◆ tooltips() [3/3]

static< T, CommandSender > SafeSuggestions< T, CommandSender > dev.jorel.commandapi.arguments.SafeSuggestions< S, CommandSender >.tooltips ( Tooltip< T >...  suggestions)

Suggest an array of hardcoded values with tooltips.

Parameters
suggestionsarray of hardcoded values with their tooltips
<T>type of the values
Returns
a SafeSuggestion object suggesting the hardcoded values

◆ tooltipsAsync()

static< T, CommandSender > SafeSuggestions< T, CommandSender > dev.jorel.commandapi.arguments.SafeSuggestions< S, CommandSender >.tooltipsAsync ( Function< SuggestionInfo< CommandSender >, CompletableFuture< Tooltip< T >[]> >  suggestions)

Suggest an array of values with tooltips asynchronously.

Parameters
suggestionsfunction providing the collection of values with tooltips asynchronously
<T>type of the values
Returns
a SafeSuggestion suggesting the result of the asynchronous function

◆ toSuggestions()

ArgumentSuggestions< CommandSender > dev.jorel.commandapi.arguments.SafeSuggestions< S, CommandSender >.toSuggestions ( Function< S, String >  mapper)

Convert this SafeSuggestions object into an ArgumentSuggestions by mapping the values with a string mapping function.

Parameters
mappera function which maps an instance of S to a string.
Returns
an ArgumentSuggestions object resulting from this mapping.