Class StringReplacerApplier


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

      Fields 
      Modifier and Type Field Description
      static me.hsgamer.hscore.common.StringReplacer COLORIZE
      A replacer to colorize the string
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> me.hsgamer.hscore.minecraft.item.ItemBuilder<T> apply​(me.hsgamer.hscore.minecraft.item.ItemBuilder<T> itemBuilder, boolean useGlobalVariableManager)
      Apply the string replacers to the item builder
      static <T> me.hsgamer.hscore.minecraft.item.ItemBuilder<T> apply​(me.hsgamer.hscore.minecraft.item.ItemBuilder<T> itemBuilder, Menu menu)
      Apply the string replacers to the item builder
      static <T> me.hsgamer.hscore.minecraft.item.ItemBuilder<T> apply​(me.hsgamer.hscore.minecraft.item.ItemBuilder<T> itemBuilder, MenuElement menuElement)
      Apply the string replacers to the item builder
      static List<me.hsgamer.hscore.common.StringReplacer> getStringReplacers()
      Get the mutable list of string replacers
      static String normalizeQuery​(String query)
      Normalize the query to a variable
      static String replace​(String string, UUID uuid, boolean useGlobalVariableManager)
      Apply the string replacers to the string
      static String replace​(String string, UUID uuid, Menu menu)
      Apply the string replacers to the string
      static String replace​(String string, UUID uuid, MenuElement menuElement)
      Apply the string replacers to the string
    • Field Detail

      • COLORIZE

        public static final me.hsgamer.hscore.common.StringReplacer COLORIZE
        A replacer to colorize the string
    • Method Detail

      • getStringReplacers

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

        public static <T> me.hsgamer.hscore.minecraft.item.ItemBuilder<T> apply​(me.hsgamer.hscore.minecraft.item.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> me.hsgamer.hscore.minecraft.item.ItemBuilder<T> apply​(me.hsgamer.hscore.minecraft.item.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> me.hsgamer.hscore.minecraft.item.ItemBuilder<T> apply​(me.hsgamer.hscore.minecraft.item.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