co.aikar.commands

## Class ACFUtil

- java.lang.Object
- - co.aikar.commands.ACFUtil

    public final class ACFUtil
    extends Object

### Field Summary

Fields
`static Random` `RANDOM`

### Method Summary

All Methods Static Methods Concrete Methods Deprecated Methods
`static String` `capitalize(String str, char[] delimiters)`
`static String` `capitalizeFirst(String name)`
`static String` `capitalizeFirst(String name, char separator)`
`static String` `combine(String[] args)`
`static String` `combine(String[] args, int start)`
`static List<String>` `enumNames(Class<? extends Enum<?>> cls)`
`static List<String>` `enumNames(Enum<?>[] values)`
`static String` `formatNumber(Integer balance)`
`static <T extends Enum> T` `getEnumFromName(T[] types, String name)`
`static <T extends Enum> T` `getEnumFromName(T[] types, String name, T def)`
`static <T extends Enum> T` `getEnumFromOrdinal(T[] types, int ordinal)`
`static <T> T` `getFirstElement(Iterable<T> iterable)`
`static <T> boolean` `hasIntersection(Collection<T> list1, Collection<T> list2)`
`static int` `indexOf(String arg, String[] split)`
`static <T> Collection<T>` `intersection(Collection<T> list1, Collection<T> list2)`
`static String` `intToRoman(int integer)`
`static boolean` `isBetween(float num, double min, double max)`
`static boolean` `isDouble(String string)`
`static boolean` `isFloat(String string)`
`static boolean` `isInteger(String string)`
`static boolean` `isNumber(String str)`
`static boolean` `isTruthy(String test)`
`static String` `join(Collection<String> args)`
`static String` `join(Collection<String> args, String sep)`
`static String` `join(String[] args)`
`static String` `join(String[] args, char sep)`
`static String` `join(String[] args, int index)`
`static String` `join(String[] args, int index, char sep)`
`static String` `join(String[] args, String sep)`
`static String` `limit(String str, int limit)`
`static String` `ltrim(String s)`
`static String` `normalize(String s)`
`static <T> T` `nullDefault(Object val, Object def)`
`static String` `padLeft(String s, int n)`
`static String` `padRight(String s, int n)`
`static BigDecimal` `parseBigNumber(String num, boolean suffixes)`
`static Double` `parseDouble(String var)`
`static Double` `parseDouble(String var, Double def)`
`static Float` `parseFloat(String var)`
`static Float` `parseFloat(String var, Float def)`
`static Integer` `parseInt(String var)`
`static Integer` `parseInt(String var, Integer def)`
`static Long` `parseLong(String var)`
`static Long` `parseLong(String var, Long def)`
`static Number` `parseNumber(String num, boolean suffixes)`
`static double` `precision(double x, int p)`
`static <T> List<T>` `preformOnImmutable(List<T> list, Consumer<List<T>> action)`
`static double` `rand(double min, double max)`
`static int` `rand(int min, int max)`
`static int` `rand(int min1, int max1, int min2, int max2)` Calculate random between 2 points, excluding a center ex: Util.rand(-12, -6, 6, 12) would not return -5 to 5
`static boolean` `randBool()`
`static <T extends Enum<?>> T` `random(Class<? extends T> enm)` Deprecated.
`static <T> T` `random(List<T> arr)`
`static <T> T` `random(T[] arr)`
`static String` `replace(String string, Pattern pattern, String repl)` Plain string replacement, escapes replace value.
`static String` `replace(String string, String pattern, String repl)` Plain String replacement.
`static String` `replacePattern(String string, Pattern pattern, String repl)` Regex version of `replace(String, Pattern, String)`
`static String` `replacePattern(String string, String pattern, String repl)` Regex version of `replace(String, String, String)`
`static String` `replacePatternMatch(String string, Pattern pattern, String repl)` Pure Regex Pattern matching and replacement, no escaping
`static String` `replacePatternMatch(String string, String pattern, String repl)` Pure Regex Pattern matching and replacement, no escaping
`static String` `replacePatterns(String string, String... replacements)`
`static String` `replaceStrings(String string, String... replacements)`
`static double` `round(double x, int scale)`
`static int` `roundUp(int num, int multiple)`
`static String` `rtrim(String s)`
`static <E extends Enum<E>> E` `simpleMatch(Class<? extends Enum<?>> list, String item)`
`static String` `simplifyString(String str)`
`static void` `sneaky(Throwable t)`
`static String` `ucfirst(String str)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### RANDOM

    public static final Random RANDOM

### Method Detail

#### padRight

    public static String padRight(String s,
                                  int n)

#### padLeft

    public static String padLeft(String s,
                                 int n)

#### formatNumber

    public static String formatNumber(Integer balance)

#### getEnumFromName

    public static <T extends Enum> T getEnumFromName(T[] types,
                                                     String name)

#### getEnumFromName

    public static <T extends Enum> T getEnumFromName(T[] types,
                                                     String name,
                                                     T def)

#### getEnumFromOrdinal

    public static <T extends Enum> T getEnumFromOrdinal(T[] types,
                                                        int ordinal)

#### ucfirst

    public static String ucfirst(String str)

#### parseDouble

    public static Double parseDouble(String var)

#### parseDouble

    public static Double parseDouble(String var,
                                     Double def)

#### parseFloat

    public static Float parseFloat(String var)

#### parseFloat

    public static Float parseFloat(String var,
                                   Float def)

#### parseLong

    public static Long parseLong(String var)

#### parseLong

    public static Long parseLong(String var,
                                 Long def)

#### parseInt

    public static Integer parseInt(String var)

#### parseInt

    public static Integer parseInt(String var,
                                   Integer def)

#### randBool

    public static boolean randBool()

#### nullDefault

    public static <T> T nullDefault(Object val,
                                    Object def)

#### join

    public static String join(Collection<String> args)

#### join

    public static String join(Collection<String> args,
                              String sep)

#### join

    public static String join(String[] args)

#### join

    public static String join(String[] args,
                              String sep)

#### join

    public static String join(String[] args,
                              char sep)

#### join

    public static String join(String[] args,
                              int index)

#### join

    public static String join(String[] args,
                              int index,
                              char sep)

#### simplifyString

    public static String simplifyString(String str)

#### round

    public static double round(double x,
                               int scale)

#### roundUp

    public static int roundUp(int num,
                              int multiple)

#### limit

    public static String limit(String str,
                               int limit)

#### replace

    public static String replace(String string,
                                 Pattern pattern,
                                 String repl)

Plain string replacement, escapes replace value.

Parameters:
  `string` -
  `pattern` -
  `repl` -
Returns:

#### replacePattern

    public static String replacePattern(String string,
                                        Pattern pattern,
                                        String repl)

Regex version of `replace(String, Pattern, String)`

Parameters:
  `string` -
  `pattern` -
  `repl` -
Returns:

#### replace

    public static String replace(String string,
                                 String pattern,
                                 String repl)

Plain String replacement. If you need regex patterns, see `replacePattern(String, String, String)`

Parameters:
  `string` -
  `pattern` -
  `repl` -
Returns:

#### replacePattern

    public static String replacePattern(String string,
                                        String pattern,
                                        String repl)

Regex version of `replace(String, String, String)`

Parameters:
  `string` -
  `pattern` -
  `repl` -
Returns:

#### replacePatternMatch

    public static String replacePatternMatch(String string,
                                             Pattern pattern,
                                             String repl)

Pure Regex Pattern matching and replacement, no escaping

Parameters:
  `string` -
  `pattern` -
  `repl` -
Returns:

#### replacePatternMatch

    public static String replacePatternMatch(String string,
                                             String pattern,
                                             String repl)

Pure Regex Pattern matching and replacement, no escaping

Parameters:
  `string` -
  `pattern` -
  `repl` -
Returns:

#### replaceStrings

    public static String replaceStrings(String string,
                                        String... replacements)

#### replacePatterns

    public static String replacePatterns(String string,
                                         String... replacements)

#### capitalize

    public static String capitalize(String str,
                                    char[] delimiters)

#### random

    public static <T> T random(List<T> arr)

#### random

    public static <T> T random(T[] arr)

#### random

    @Deprecated
    public static <T extends Enum<?>> T random(Class<? extends T> enm)

Deprecated.
Added as im sure we will try to "Find this" again. This is no different than Enum.values() passed to above method logically but the array version is slightly faster.

Type Parameters:
  `T` -
Parameters:
  `enm` -
Returns:

#### normalize

    public static String normalize(String s)

#### indexOf

    public static int indexOf(String arg,
                              String[] split)

#### capitalizeFirst

    public static String capitalizeFirst(String name)

#### capitalizeFirst

    public static String capitalizeFirst(String name,
                                         char separator)

#### ltrim

    public static String ltrim(String s)

#### rtrim

    public static String rtrim(String s)

#### enumNames

    public static List<String> enumNames(Enum<?>[] values)

#### enumNames

    public static List<String> enumNames(Class<? extends Enum<?>> cls)

#### combine

    public static String combine(String[] args)

#### combine

    public static String combine(String[] args,
                                 int start)

#### simpleMatch

    @Nullable
    public static <E extends Enum<E>> E simpleMatch(Class<? extends Enum<?>> list,
                                                              String item)

#### isTruthy

    public static boolean isTruthy(String test)

#### parseNumber

    public static Number parseNumber(String num,
                                     boolean suffixes)

#### parseBigNumber

    public static BigDecimal parseBigNumber(String num,
                                            boolean suffixes)

#### hasIntersection

    public static <T> boolean hasIntersection(Collection<T> list1,
                                              Collection<T> list2)

#### intersection

    public static <T> Collection<T> intersection(Collection<T> list1,
                                                 Collection<T> list2)

#### rand

    public static int rand(int min,
                           int max)

#### rand

    public static int rand(int min1,
                           int max1,
                           int min2,
                           int max2)

Calculate random between 2 points, excluding a center ex: Util.rand(-12, -6, 6, 12) would not return -5 to 5

Parameters:
  `min1` -
  `max1` -
  `min2` -
  `max2` -
Returns:

#### rand

    public static double rand(double min,
                              double max)

#### isNumber

    public static boolean isNumber(String str)

#### intToRoman

    public static String intToRoman(int integer)

#### isInteger

    public static boolean isInteger(String string)

#### isFloat

    public static boolean isFloat(String string)

#### isDouble

    public static boolean isDouble(String string)

#### isBetween

    public static boolean isBetween(float num,
                                    double min,
                                    double max)

#### precision

    public static double precision(double x,
                                   int p)

#### sneaky

    public static void sneaky(Throwable t)

#### preformOnImmutable

    public static <T> List<T> preformOnImmutable(List<T> list,
                                                 Consumer<List<T>> action)

#### getFirstElement

    public static <T> T getFirstElement(Iterable<T> iterable)