CommandAPI 9.4.0
An API for the command UI introduced in Minecraft 1.13
dev.jorel.commandapi.BukkitStringTooltip Class Reference
+ Inheritance diagram for dev.jorel.commandapi.BukkitStringTooltip:

Public Member Functions

String getSuggestion ()
 Returns the current suggestion that this class holds. More...
 
Message getTooltip ()
 Returns the current tooltip text that this class holds. More...
 

Static Public Member Functions

static StringTooltip ofBaseComponents (String suggestion, BaseComponent... tooltip)
 Constructs a StringTooltip with a suggestion and a formatted bungee text component tooltip. More...
 
static StringTooltip ofAdventureComponent (String suggestion, Component tooltip)
 Constructs a StringTooltip with a suggestion and a formatted adventure text component tooltip. More...
 
static Collection< StringTooltipgenerateBaseComponents (Function< String, BaseComponent[]> tooltipGenerator, String... suggestions)
 Constructs a collection of StringTooltip objects from an array of suggestions, and a function which generates a formatted tooltip for each suggestion. More...
 
static Collection< StringTooltipgenerateBaseComponents (Function< String, BaseComponent[]> tooltipGenerator, Collection< String > suggestions)
 Constructs a collection of StringTooltip objects from a collection of suggestions, and a function which generates a formatted tooltip for each suggestion. More...
 
static Collection< StringTooltipgenerateAdventureComponents (Function< String, Component > tooltipGenerator, String... suggestions)
 Constructs a collection of StringTooltip objects from an array of suggestions, and a function which generates a tooltip formatted as an adventure Component for each suggestion. More...
 
static Collection< StringTooltipgenerateAdventureComponents (Function< String, Component > tooltipGenerator, Collection< String > suggestions)
 Constructs a collection of StringTooltip objects from a collection of suggestions, and a function which generates a tooltip formatted as an adventure Component for each suggestion. More...
 
static StringTooltip ofString (String suggestion, String tooltip)
 Constructs a StringTooltip with a suggestion and a string tooltip. More...
 
static StringTooltip ofMessage (String suggestion, Message tooltip)
 Constructs a StringTooltip with a suggestion and a formatted tooltip. More...
 
static StringTooltip none (String suggestion)
 Constructs a StringTooltip with a suggestion and no tooltip. More...
 
static Collection< StringTooltipnone (String... suggestions)
 Constructs a collection of StringTooltip objects from an array of suggestions, and no tooltips. More...
 
static Collection< StringTooltipnone (Collection< String > suggestions)
 Constructs a collection of StringTooltip objects from a collection of suggestions, and no tooltips. More...
 
static Collection< StringTooltipgenerateStrings (UnaryOperator< String > tooltipGenerator, String... suggestions)
 Constructs a collection of StringTooltip objects from an array of suggestions, and a function which generates a string tooltip for each suggestion. More...
 
static Collection< StringTooltipgenerateStrings (UnaryOperator< String > tooltipGenerator, Collection< String > suggestions)
 Constructs a collection of StringTooltip objects from a collection of suggestions, and a function which generates a string tooltip for each suggestion. More...
 
static Collection< StringTooltipgenerateMessages (Function< String, Message > tooltipGenerator, String... suggestions)
 Constructs a collection of StringTooltip objects from an array of suggestions, and a function which generates a formatted tooltip for each suggestion. More...
 
static Collection< StringTooltipgenerateMessages (Function< String, Message > tooltipGenerator, Collection< String > suggestions)
 Constructs a collection of StringTooltip objects from a collection of suggestions, and a function which generates a formatted tooltip for each suggestion. More...
 

Protected Member Functions

 BukkitStringTooltip (String suggestion, Message tooltip)
 

Static Protected Member Functions

static< T > Collection< StringTooltipgenerate (Function< String, T > tooltipGenerator, BiFunction< String, T, StringTooltip > tooltipWrapper, String... suggestions)
 Internal base method for the other generation types. More...
 
static< T > Collection< StringTooltipgenerate (Function< String, T > tooltipGenerator, BiFunction< String, T, StringTooltip > tooltipWrapper, Collection< String > suggestions)
 Internal base method for the other generation types. More...
 
static< T > Collection< StringTooltipgenerate (Function< String, T > tooltipGenerator, BiFunction< String, T, StringTooltip > tooltipWrapper, Stream< String > suggestions)
 Internal base method for the other generation types. More...
 

Member Function Documentation

◆ generate() [1/3]

static< T > Collection< StringTooltip > dev.jorel.commandapi.StringTooltip.generate ( Function< String, T >  tooltipGenerator,
BiFunction< String, T, StringTooltip tooltipWrapper,
Collection< String >  suggestions 
)
staticprotectedinherited

Internal base method for the other generation types.

Parameters
<T>the type of the tooltip
tooltipGeneratortooltip generation function
tooltipWrapperfunction which wraps suggestion and tooltip into a StringTooltip object
suggestionscollection of suggestions to provide to the user
Returns
a collection of StringTooltip objects from the provided suggestion, wrapped using the above functions

◆ generate() [2/3]

static< T > Collection< StringTooltip > dev.jorel.commandapi.StringTooltip.generate ( Function< String, T >  tooltipGenerator,
BiFunction< String, T, StringTooltip tooltipWrapper,
Stream< String >  suggestions 
)
staticprotectedinherited

Internal base method for the other generation types.

Parameters
<T>the type of the tooltip
tooltipGeneratortooltip generation function
tooltipWrapperfunction which wraps suggestion and tooltip into a StringTooltip object
suggestionsstream of suggestions to provide to the user
Returns
a collection of StringTooltip objects from the provided suggestion, wrapped using the above functions

◆ generate() [3/3]

static< T > Collection< StringTooltip > dev.jorel.commandapi.StringTooltip.generate ( Function< String, T >  tooltipGenerator,
BiFunction< String, T, StringTooltip tooltipWrapper,
String...  suggestions 
)
staticprotectedinherited

Internal base method for the other generation types.

Parameters
<T>the type of the tooltip
tooltipGeneratortooltip generation function
tooltipWrapperfunction which wraps suggestion and tooltip into a StringTooltip object
suggestionsarray of suggestions to provide to the user
Returns
a collection of StringTooltip objects from the provided suggestion, wrapped using the above functions

◆ generateAdventureComponents() [1/2]

static Collection< StringTooltip > dev.jorel.commandapi.BukkitStringTooltip.generateAdventureComponents ( Function< String, Component >  tooltipGenerator,
Collection< String >  suggestions 
)
static

Constructs a collection of StringTooltip objects from a collection of suggestions, and a function which generates a tooltip formatted as an adventure Component for each suggestion.

Parameters
tooltipGeneratorfunction which returns a formatted tooltip for the suggestion, an adventure Component
suggestionscollection of suggestions to provide to the user
Returns
a collection of StringTooltip objects from the provided suggestions, with the generated formatted tooltips

◆ generateAdventureComponents() [2/2]

static Collection< StringTooltip > dev.jorel.commandapi.BukkitStringTooltip.generateAdventureComponents ( Function< String, Component >  tooltipGenerator,
String...  suggestions 
)
static

Constructs a collection of StringTooltip objects from an array of suggestions, and a function which generates a tooltip formatted as an adventure Component for each suggestion.

Parameters
tooltipGeneratorfunction which returns a formatted tooltip for the suggestion, an adventure Component
suggestionsarray of suggestions to provide to the user
Returns
a collection of StringTooltip objects from the provided suggestions, with the generated formatted tooltips

◆ generateBaseComponents() [1/2]

static Collection< StringTooltip > dev.jorel.commandapi.BukkitStringTooltip.generateBaseComponents ( Function< String, BaseComponent[]>  tooltipGenerator,
Collection< String >  suggestions 
)
static

Constructs a collection of StringTooltip objects from a collection of suggestions, and a function which generates a formatted tooltip for each suggestion.

Parameters
tooltipGeneratorfunction which returns a formatted tooltip for the suggestion, an array of BaseComponents
suggestionscollection of suggestions to provide to the user
Returns
a collection of StringTooltip objects from the provided suggestions, with the generated formatted tooltips

◆ generateBaseComponents() [2/2]

static Collection< StringTooltip > dev.jorel.commandapi.BukkitStringTooltip.generateBaseComponents ( Function< String, BaseComponent[]>  tooltipGenerator,
String...  suggestions 
)
static

Constructs a collection of StringTooltip objects from an array of suggestions, and a function which generates a formatted tooltip for each suggestion.

Parameters
tooltipGeneratorfunction which returns a formatted tooltip for the suggestion, an array of BaseComponents
suggestionsarray of suggestions to provide to the user
Returns
a collection of StringTooltip objects from the provided suggestions, with the generated formatted tooltips

◆ generateMessages() [1/2]

static Collection< StringTooltip > dev.jorel.commandapi.StringTooltip.generateMessages ( Function< String, Message tooltipGenerator,
Collection< String >  suggestions 
)
staticinherited

Constructs a collection of StringTooltip objects from a collection of suggestions, and a function which generates a formatted tooltip for each suggestion.

Parameters
tooltipGeneratorfunction which returns a formatted tooltip for the suggestion
suggestionscollection of suggestions to provide to the user
Returns
a collection of StringTooltip objects from the provided suggestions, with the generated formatted tooltips

◆ generateMessages() [2/2]

static Collection< StringTooltip > dev.jorel.commandapi.StringTooltip.generateMessages ( Function< String, Message tooltipGenerator,
String...  suggestions 
)
staticinherited

Constructs a collection of StringTooltip objects from an array of suggestions, and a function which generates a formatted tooltip for each suggestion.

Parameters
tooltipGeneratorfunction which returns a formatted tooltip for the suggestion
suggestionsarray of suggestions to provide to the user
Returns
a collection of StringTooltip objects from the provided suggestions, with the generated formatted tooltips

◆ generateStrings() [1/2]

static Collection< StringTooltip > dev.jorel.commandapi.StringTooltip.generateStrings ( UnaryOperator< String >  tooltipGenerator,
Collection< String >  suggestions 
)
staticinherited

Constructs a collection of StringTooltip objects from a collection of suggestions, and a function which generates a string tooltip for each suggestion.

Parameters
tooltipGeneratorfunction which returns a string tooltip for the suggestion
suggestionscollection of suggestions to provide to the user
Returns
a collection of StringTooltip objects from the provided suggestions, with the generated string tooltips

◆ generateStrings() [2/2]

static Collection< StringTooltip > dev.jorel.commandapi.StringTooltip.generateStrings ( UnaryOperator< String >  tooltipGenerator,
String...  suggestions 
)
staticinherited

Constructs a collection of StringTooltip objects from an array of suggestions, and a function which generates a string tooltip for each suggestion.

Parameters
tooltipGeneratorfunction which returns a string tooltip for the suggestion
suggestionsarray of suggestions to provide to the user
Returns
a collection of StringTooltip objects from the provided suggestions, with the generated string tooltips

◆ getSuggestion()

String dev.jorel.commandapi.StringTooltip.getSuggestion ( )
inherited

Returns the current suggestion that this class holds.

Returns
the current suggestion that this class holds

Implements dev.jorel.commandapi.IStringTooltip.

◆ getTooltip()

Message dev.jorel.commandapi.StringTooltip.getTooltip ( )
inherited

Returns the current tooltip text that this class holds.

Returns
the current tooltip text that this class holds

Implements dev.jorel.commandapi.IStringTooltip.

◆ none() [1/3]

static Collection< StringTooltip > dev.jorel.commandapi.StringTooltip.none ( Collection< String >  suggestions)
staticinherited

Constructs a collection of StringTooltip objects from a collection of suggestions, and no tooltips.

Parameters
suggestionscollection of suggestions to provide to the user
Returns
a collection of StringTooltip objects from the suggestions, with no tooltips

◆ none() [2/3]

static StringTooltip dev.jorel.commandapi.StringTooltip.none ( String  suggestion)
staticinherited

Constructs a StringTooltip with a suggestion and no tooltip.

Parameters
suggestionthe suggestion to provide to the user
Returns
a StringTooltip representing this suggestion

◆ none() [3/3]

static Collection< StringTooltip > dev.jorel.commandapi.StringTooltip.none ( String...  suggestions)
staticinherited

Constructs a collection of StringTooltip objects from an array of suggestions, and no tooltips.

Parameters
suggestionsarray of suggestions to provide to the user
Returns
a collection of StringTooltip objects from the suggestions, with no tooltips

◆ ofAdventureComponent()

static StringTooltip dev.jorel.commandapi.BukkitStringTooltip.ofAdventureComponent ( String  suggestion,
Component  tooltip 
)
static

Constructs a StringTooltip with a suggestion and a formatted adventure text component tooltip.

Parameters
suggestionthe suggestion to provide to the user
tooltipthe formatted tooltip to show to the user when they hover over the suggestion
Returns
a StringTooltip representing this suggestion and tooltip

◆ ofBaseComponents()

static StringTooltip dev.jorel.commandapi.BukkitStringTooltip.ofBaseComponents ( String  suggestion,
BaseComponent...  tooltip 
)
static

Constructs a StringTooltip with a suggestion and a formatted bungee text component tooltip.

Parameters
suggestionthe suggestion to provide to the user
tooltipthe formatted tooltip to show to the user when they hover over the suggestion
Returns
a StringTooltip representing this suggestion and tooltip

◆ ofMessage()

static StringTooltip dev.jorel.commandapi.StringTooltip.ofMessage ( String  suggestion,
Message  tooltip 
)
staticinherited

Constructs a StringTooltip with a suggestion and a formatted tooltip.

Parameters
suggestionthe suggestion to provide to the user
tooltipthe formatted tooltip to show to the user when they hover over the suggestion
Returns
a StringTooltip representing this suggestion and tooltip

◆ ofString()

static StringTooltip dev.jorel.commandapi.StringTooltip.ofString ( String  suggestion,
String  tooltip 
)
staticinherited

Constructs a StringTooltip with a suggestion and a string tooltip.

Parameters
suggestionthe suggestion to provide to the user
tooltipthe string tooltip to show to the user when they hover over the suggestion
Returns
a StringTooltip representing this suggestion and tooltip