Class StringReplacerApplier


  • public final class StringReplacerApplier
    extends Object
    A utility class to apply StringReplacer
    • Field Detail

      • COLORIZE

        public static final StringReplacer COLORIZE
        A replacer to colorize the string
    • Method Detail

      • getStringReplacers

        public static List<StringReplacer> getStringReplacers()
        Get the mutable list of string replacers
        Returns:
        the mutable list of string replacers
      • apply

        public static <T> ItemBuilder<T> apply​(ItemBuilder<T> itemBuilder,
                                               boolean useGlobalVariableManager)
        Apply the string replacers to the item builder
        Parameters:
        itemBuilder - the item builder
        useGlobalVariableManager - whether to use the global variable manager
        Returns:
        the item builder
      • apply

        public static <T> ItemBuilder<T> apply​(ItemBuilder<T> itemBuilder,
                                               Menu menu)
        Apply the string replacers to the item builder
        Parameters:
        itemBuilder - the item builder
        menu - the menu
        Returns:
        the item builder
      • apply

        public static <T> ItemBuilder<T> apply​(ItemBuilder<T> itemBuilder,
                                               MenuElement menuElement)
        Apply the string replacers to the item builder
        Parameters:
        itemBuilder - the item builder
        menuElement - the menu element
        Returns:
        the item builder
      • replace

        public static String replace​(String string,
                                     UUID uuid,
                                     boolean useGlobalVariableManager)
        Apply the string replacers to the string
        Parameters:
        string - the string
        uuid - the unique id
        useGlobalVariableManager - whether to use the global variable manager
        Returns:
        the replaced string
      • replace

        public static String replace​(String string,
                                     UUID uuid,
                                     Menu menu)
        Apply the string replacers to the string
        Parameters:
        string - the string
        uuid - the unique id
        menu - the menu
        Returns:
        the replaced string
      • replace

        public static String replace​(String string,
                                     UUID uuid,
                                     MenuElement menuElement)
        Apply the string replacers to the string
        Parameters:
        string - the string
        uuid - the unique id
        menuElement - the menu element
        Returns:
        the replaced string
      • normalizeQuery

        public static String normalizeQuery​(String query)
        Normalize the query to a variable
        Parameters:
        query - the query
        Returns:
        the normalized variable