Package me.hsgamer.bettergui.util
Class StringReplacerApplier
- java.lang.Object
-
- me.hsgamer.bettergui.util.StringReplacerApplier
-
public final class StringReplacerApplier extends Object
A utility class to apply StringReplacer
-
-
Field Summary
Fields Modifier and Type Field Description static StringReplacer
COLORIZE
A replacer to colorize the string
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> ItemBuilder<T>
apply(ItemBuilder<T> itemBuilder, boolean useGlobalVariableManager)
Apply the string replacers to the item builderstatic <T> ItemBuilder<T>
apply(ItemBuilder<T> itemBuilder, Menu menu)
Apply the string replacers to the item builderstatic <T> ItemBuilder<T>
apply(ItemBuilder<T> itemBuilder, MenuElement menuElement)
Apply the string replacers to the item builderstatic List<StringReplacer>
getStringReplacers()
Get the mutable list of string replacersstatic String
normalizeQuery(String query)
Normalize the query to a variablestatic String
replace(String string, UUID uuid, boolean useGlobalVariableManager)
Apply the string replacers to the stringstatic String
replace(String string, UUID uuid, Menu menu)
Apply the string replacers to the stringstatic String
replace(String string, UUID uuid, MenuElement menuElement)
Apply the string replacers to the string
-
-
-
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 builderuseGlobalVariableManager
- 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 buildermenu
- 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 buildermenuElement
- 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 stringuuid
- the unique iduseGlobalVariableManager
- 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 stringuuid
- the unique idmenu
- 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 stringuuid
- the unique idmenuElement
- the menu element- Returns:
- the replaced string
-
-