Class FormattingUtils


  • public class FormattingUtils
    extends java.lang.Object
    Static helper methods for string processing etc.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String formatBytes​(long bytes)
      Formats the given number of bytes as B, KiB, MiB, GiB, etc.
      static java.lang.String formatDecimalNumber​(long decimalNumber)
      Formats the given decimal number with a comma as thousands separator.
      static java.lang.String formatMillis​(long millis)
      Formats the given number of milliseconds using the format "${minutes}:${seconds}.{milliseconds} minutes".
      static java.lang.String replaceValidUtf​(java.lang.String text)
      De-escape only valid UTF and leave anything else escaped.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • formatMillis

        public static java.lang.String formatMillis​(long millis)
        Formats the given number of milliseconds using the format "${minutes}:${seconds}.{milliseconds} minutes".
      • formatBytes

        public static java.lang.String formatBytes​(long bytes)
        Formats the given number of bytes as B, KiB, MiB, GiB, etc.
      • formatDecimalNumber

        public static java.lang.String formatDecimalNumber​(long decimalNumber)
        Formats the given decimal number with a comma as thousands separator.
      • replaceValidUtf

        public static java.lang.String replaceValidUtf​(java.lang.String text)
        De-escape only valid UTF and leave anything else escaped.