Class StringTooltip

java.lang.Object
dev.jorel.commandapi.StringTooltip
All Implemented Interfaces:
IStringTooltip

public class StringTooltip extends Object implements IStringTooltip
Represents a suggestion for an argument with a hover tooltip text for that suggestion. This class is to be used with normal suggestion overrides, via the Argument.overrideSuggestionsT method.
  • Method Details

    • none

      public static StringTooltip none(String suggestion)
      Constructs a StringTooltip with a suggestion and no tooltip
      Parameters:
      suggestion - the suggestion to provide to the user
      Returns:
      a StringTooltip representing this suggestion
    • of

      public static StringTooltip of(String suggestion, String tooltip)
      Constructs a StringTooltip with a suggestion and a tooltip
      Parameters:
      suggestion - the suggestion to provide to the user
      tooltip - the tooltip to show to the user when they hover over the suggestion
      Returns:
      a StringTooltip representing this suggestion and tooltip
    • getSuggestion

      public String getSuggestion()
      Returns the current suggestion that this class holds
      Specified by:
      getSuggestion in interface IStringTooltip
      Returns:
      the current suggestion that this class holds
    • getTooltip

      public String getTooltip()
      Returns the current tooltip text that this class holds
      Specified by:
      getTooltip in interface IStringTooltip
      Returns:
      the current tooltip text that this class holds