CommandAPI 12.1.0
An API for the command UI introduced in Minecraft 1.13
Loading...
Searching...
No Matches
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.
Message getTooltip ()
 Returns the current tooltip text that this class holds.

Static Public Member Functions

static StringTooltip ofBaseComponents (String suggestion, BaseComponent... tooltip)
 Constructs a StringTooltip with a suggestion and a formatted bungee text component tooltip.
static StringTooltip ofAdventureComponent (String suggestion, ComponentLike tooltip)
 Constructs a StringTooltip with a suggestion and a formatted adventure text component tooltip.
static Collection< StringTooltip > generateBaseComponents (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.
static Collection< StringTooltip > generateBaseComponents (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.
static Collection< StringTooltip > generateAdventureComponents (Function< String, ComponentLike > 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 ComponentLike for each suggestion.
static Collection< StringTooltip > generateAdventureComponents (Function< String, ComponentLike > 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 ComponentLike for each suggestion.
static StringTooltip ofString (String suggestion, String tooltip)
 Constructs a StringTooltip with a suggestion and a string tooltip.
static StringTooltip ofMessage (String suggestion, Message tooltip)
 Constructs a StringTooltip with a suggestion and a formatted tooltip.
static StringTooltip none (String suggestion)
 Constructs a StringTooltip with a suggestion and no tooltip.
static Collection< StringTooltip > none (String... suggestions)
 Constructs a collection of StringTooltip objects from an array of suggestions, and no tooltips.
static Collection< StringTooltip > none (Collection< String > suggestions)
 Constructs a collection of StringTooltip objects from a collection of suggestions, and no tooltips.
static Collection< StringTooltip > generateStrings (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.
static Collection< StringTooltip > generateStrings (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.
static Collection< StringTooltip > generateMessages (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.
static Collection< StringTooltip > generateMessages (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.

Protected Member Functions

 BukkitStringTooltip (String suggestion, Message tooltip)

Static Protected Member Functions

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

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]

Collection< StringTooltip > dev.jorel.commandapi.BukkitStringTooltip.generateAdventureComponents ( Function< String, ComponentLike > 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 ComponentLike for each suggestion.

Parameters
tooltipGeneratorfunction which returns a formatted tooltip for the suggestion, an adventure ComponentLike
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]

Collection< StringTooltip > dev.jorel.commandapi.BukkitStringTooltip.generateAdventureComponents ( Function< String, ComponentLike > 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 ComponentLike for each suggestion.

Parameters
tooltipGeneratorfunction which returns a formatted tooltip for the suggestion, an adventure ComponentLike
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]

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]

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]

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]

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]

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]

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]

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]

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]

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()

StringTooltip dev.jorel.commandapi.BukkitStringTooltip.ofAdventureComponent ( String suggestion,
ComponentLike 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()

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()

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()

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