Class StaticSuggestionsCompleter

java.lang.Object
com.ultikits.ultitools.commands.tabcomplete.StaticSuggestionsCompleter
All Implemented Interfaces:
TabCompleter

public class StaticSuggestionsCompleter extends Object implements TabCompleter
Completer that provides static suggestions from a predefined list.

从预定义列表提供静态建议的补全器。

Since:
6.2.0
Version:
1.0.0
Author:
wisdomme
  • Field Details

    • suggestions

      private final List<String> suggestions
    • caseSensitive

      private final boolean caseSensitive
  • Constructor Details

    • StaticSuggestionsCompleter

      public StaticSuggestionsCompleter(String... suggestions)
      Creates a completer with static suggestions (case-insensitive matching). 使用静态建议创建补全器(不区分大小写匹配)。
      Parameters:
      suggestions - the suggestions to provide
    • StaticSuggestionsCompleter

      public StaticSuggestionsCompleter(List<String> suggestions)
      Creates a completer with static suggestions (case-insensitive matching). 使用静态建议创建补全器(不区分大小写匹配)。
      Parameters:
      suggestions - the suggestions to provide
    • StaticSuggestionsCompleter

      public StaticSuggestionsCompleter(List<String> suggestions, boolean caseSensitive)
      Creates a completer with static suggestions. 使用静态建议创建补全器。
      Parameters:
      suggestions - the suggestions to provide
      caseSensitive - whether matching should be case-sensitive
  • Method Details

    • complete

      public List<String> complete(TabCompletionContext context)
      Description copied from interface: TabCompleter
      Generates completion suggestions based on the given context. 根据给定的上下文生成补全建议。
      Specified by:
      complete in interface TabCompleter
      Parameters:
      context - the tab completion context containing command state
      Returns:
      list of suggestions, never null
    • forBoolean

      public static StaticSuggestionsCompleter forBoolean()
      Creates a completer for boolean values. 创建布尔值的补全器。
      Returns:
      a completer suggesting "true" and "false"
    • forToggle

      public static StaticSuggestionsCompleter forToggle()
      Creates a completer for common toggle values. 创建常用开关值的补全器。
      Returns:
      a completer suggesting common toggle options