Class StringUtil

java.lang.Object
com.hypixel.hytale.common.util.StringUtil

public class StringUtil extends Object
Since:
7/12/16.
Version:
1.0
  • Field Details

    • RAW_ARGS_PATTERN

      public static final Pattern RAW_ARGS_PATTERN
  • Constructor Details

    • StringUtil

      public StringUtil()
  • Method Details

    • isNumericString

      public static boolean isNumericString(@Nonnull String str)
    • isAlphaNumericHyphenString

      public static boolean isAlphaNumericHyphenString(@Nonnull String str)
    • isAlphaNumericHyphenUnderscoreString

      public static boolean isAlphaNumericHyphenUnderscoreString(@Nonnull String str)
    • isCapitalized

      public static boolean isCapitalized(@Nonnull String keyStr, char delim)
    • capitalize

      @Nonnull public static String capitalize(@Nonnull String keyStr, char delim)
    • parseEnum

      @Nullable public static <V extends Enum<V>> V parseEnum(@Nonnull V[] enumConstants, String str)
    • parseEnum

      @Nullable public static <V extends Enum<V>> V parseEnum(@Nonnull V[] enumConstants, String str, StringUtil.MatchType matchType)
    • stripQuotes

      @Nonnull public static String stripQuotes(@Nonnull String s)
      Strips matching leading and trailing quotation marks from a string.
    • sanitizeAsciiString

      @Nullable public static String sanitizeAsciiString(@Nullable String input)
    • isGlobMatching

      public static boolean isGlobMatching(@Nonnull String pattern, @Nonnull String text)
    • isGlobMatching

      public static boolean isGlobMatching(@Nonnull String pattern, int patternPos, @Nonnull String text, int textPos)
    • isGlobPattern

      public static boolean isGlobPattern(@Nonnull String text)
    • humanizeTime

      @Nonnull public static String humanizeTime(@Nonnull Duration duration, boolean useSeconds)
    • humanizeTime

      @Nonnull public static String humanizeTime(@Nonnull Duration length)
    • sortByFuzzyDistance

      @Nonnull public static <T> List<T> sortByFuzzyDistance(@Nonnull String str, @Nonnull Collection<T> collection, int length)
    • sortByFuzzyDistance

      @Nonnull public static <T> List<T> sortByFuzzyDistance(@Nonnull String str, @Nonnull Collection<T> collection)
    • sortByFuzzyDistance

      public static <T> void sortByFuzzyDistance(@Nonnull String str, @Nonnull List<T> list, @Nonnull Function<T,String> toString)
    • toPaddedBinaryString

      @Nonnull public static String toPaddedBinaryString(int val)
      An efficient implementation of Integer.toBinaryString(int) with '0' padding.
      Parameters:
      val - the integer value
      Returns:
      Binary string representing the integer
    • trimEnd

      @Nonnull public static String trimEnd(@Nonnull String str, @Nonnull String end)
    • formatColumns

      @Nonnull public static String formatColumns(@Nonnull List<String> entries, int width)
      Lays out entries in column-major order (down each column, then across) sized to width characters, the way a shell prints completion candidates. Each row begins on a new line indented by two spaces, and columns are left-aligned to the longest entry plus a two-space gutter. Returns an empty string for an empty list.
    • generateGraph

      public static void generateGraph(@Nonnull StringBuilder sb, int width, int height, long minX, long maxX, double minY, double maxY, @Nonnull DoubleFunction<String> labelFormatFunc, int historyLength, @Nonnull IntToLongFunction timestampFunc, @Nonnull IntToDoubleFunction valueFunc)