Class DataSizeFormatter

java.lang.Object
se.datadosen.util.DataSizeFormatter

public class DataSizeFormatter
extends java.lang.Object
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Class Description
    static class  DataSizeFormatter.DataSize  
    static class  DataSizeFormatter.Unit  
  • Constructor Summary

    Constructors 
    Constructor Description
    DataSizeFormatter()  
  • Method Summary

    Modifier and Type Method Description
    static DataSizeFormatter.DataSize formatBytes​(long value)  
    static java.lang.String formatXofY​(java.lang.String textKey, long current, long total)
    Generate strings "like X of Y MB free".
    static java.lang.String groupByThousands​(long value)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • formatBytes

      public static DataSizeFormatter.DataSize formatBytes​(long value)
    • formatXofY

      public static java.lang.String formatXofY​(java.lang.String textKey, long current, long total)
      Generate strings "like X of Y MB free". Avoids repeating unit if unit is the same
      Parameters:
      textKey -
      current -
      total -
      Returns:
    • groupByThousands

      public static java.lang.String groupByThousands​(long value)