Class Util


  • public final class Util
    extends Object
    • Field Detail

      • PERCENT_FORMATTER

        public static final NumberFormat PERCENT_FORMATTER
      • INSTANCE

        public static final Util INSTANCE
    • Method Detail

      • formatDuration

        public static String formatDuration​(long duration)
      • formatAsPercentage

        public static String formatAsPercentage​(int value,
                                                int total)
        Returns value converted to percentage format.
        Parameters:
        value - value to convert
        total - sum of all values
        Returns:
        converted values including '%' character
      • formatAsDecimal

        public static String formatAsDecimal​(int value,
                                             int total)
      • toValidFileName

        public static String toValidFileName​(String fileName)
        Converts characters of passed string and replaces to hash which can be treated as valid file name.
        Parameters:
        fileName - sequence that should be converted
        Returns:
        converted string
      • eliminateEmptyHooks

        public static List<Hook> eliminateEmptyHooks​(Hook[] hooks)
        Helper method that removes empty hooks from passed array and packs it into new collection.
        Parameters:
        hooks - hooks to be reduced
        Returns:
        no empty hooks