Enum Class MemorySize.MemoryUnit

java.lang.Object
java.lang.Enum<MemorySize.MemoryUnit>
ai.dat.core.configuration.MemorySize.MemoryUnit
All Implemented Interfaces:
Serializable, Comparable<MemorySize.MemoryUnit>, Constable
Enclosing class:
MemorySize

public static enum MemorySize.MemoryUnit extends Enum<MemorySize.MemoryUnit>
Enum which defines memory unit, mostly used to parse value from configuration file.

To make larger values more compact, the common size suffixes are supported:

  • 1b or 1bytes (bytes)
  • 1k or 1kb or 1kibibytes (interpreted as kibibytes = 1024 bytes)
  • 1m or 1mb or 1mebibytes (interpreted as mebibytes = 1024 kibibytes)
  • 1g or 1gb or 1gibibytes (interpreted as gibibytes = 1024 mebibytes)
  • 1t or 1tb or 1tebibytes (interpreted as tebibytes = 1024 gibibytes)
  • Enum Constant Details

  • Method Details

    • values

      public static MemorySize.MemoryUnit[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static MemorySize.MemoryUnit valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getAllUnits

      public static String getAllUnits()
    • hasUnit

      public static boolean hasUnit(String text)