Class MemorySizeParser


  • public class MemorySizeParser
    extends java.lang.Object
    Memory size parser using the letter k or K to indicate kilobytes, the letter m or M to indicate megabytes, the letter g or G to indicate gigabytes and the letter t or T to indicate terabytes.
    Author:
    Ludovic Orban
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static long parse​(java.lang.String configuredMemorySize)
      Parse a String containing a human-readable memory size.
      • Methods inherited from class java.lang.Object

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

      • MemorySizeParser

        public MemorySizeParser()
    • Method Detail

      • parse

        public static long parse​(java.lang.String configuredMemorySize)
                          throws java.lang.IllegalArgumentException
        Parse a String containing a human-readable memory size.
        Parameters:
        configuredMemorySize - the String containing a human-readable memory size.
        Returns:
        the memory size in bytes.
        Throws:
        java.lang.IllegalArgumentException - thrown when the configured memory size cannot be parsed.