Enum Class Size.Unit

java.lang.Object
java.lang.Enum<Size.Unit>
io.helidon.common.Size.Unit
All Implemented Interfaces:
Serializable, Comparable<Size.Unit>, Constable
Enclosing interface:
Size

public static enum Size.Unit extends Enum<Size.Unit>
Units that can be used.
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Bytes.
    Exabytes (represented as eB): i.e.
    Exbi-bytes (represented as either EB or EiB), where we use binary approach, i.e.
    Gigabytes (represented as gB): i.e.
    Gibi-bytes (represented as either GB or GiB), where we use binary approach, i.e.
    Kilobytes (represented as kB), where kilo is used in its original meaning as a thousand, i.e.
    Kibi-bytes (represented as either KB or KiB), where we use binary approach, i.e.
    Megabytes (represented as mB), where mega is used in its original meaning as a million, i.e.
    Mebi-bytes (represented as either MB or MiB), where we use binary approach, i.e.
    Petabytes (represented as pB): i.e.
    Pebi-bytes (represented as either PB or PiB), where we use binary approach, i.e.
    Terabytes (represented as tB): i.e.
    Tebi-bytes (represented as either TB or TiB), where we use binary approach, i.e.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Number of bytes this unit represents.
    Number of bytes in this unit (exact integer).
    static Size.Unit
    parse(String unitString)
    Parse the size string to appropriate unit.
    static Size.Unit
    Returns the enum constant of this class with the specified name.
    static Size.Unit[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • BYTE

      public static final Size.Unit BYTE
      Bytes.
    • KB

      public static final Size.Unit KB
      Kilobytes (represented as kB), where kilo is used in its original meaning as a thousand, i.e. 1 kB is 1000 bytes.
    • KIB

      public static final Size.Unit KIB
      Kibi-bytes (represented as either KB or KiB), where we use binary approach, i.e. 1 KB or KiB is 1024 bytes.
    • MB

      public static final Size.Unit MB
      Megabytes (represented as mB), where mega is used in its original meaning as a million, i.e. 1 mB is 1000^2 bytes (1000 to the power of 2), or 1000 kB.
    • MIB

      public static final Size.Unit MIB
      Mebi-bytes (represented as either MB or MiB), where we use binary approach, i.e. 1 MB or MiB is 1024^2 bytes (1024 to the power 2), or 1024 KiB.
    • GB

      public static final Size.Unit GB
      Gigabytes (represented as gB): i.e. 1 gB is 1000^3 bytes (1000 to the power of 3), or 1000 mB.
    • GIB

      public static final Size.Unit GIB
      Gibi-bytes (represented as either GB or GiB), where we use binary approach, i.e. 1 GB or GiB is 1024^3 bytes (1024 to the power 3), or 1024 MiB.
    • TB

      public static final Size.Unit TB
      Terabytes (represented as tB): i.e. 1 gB is 1000^4 bytes (1000 to the power of 4), or 1000 gB.
    • TIB

      public static final Size.Unit TIB
      Tebi-bytes (represented as either TB or TiB), where we use binary approach, i.e. 1 TB or TiB is 1024^4 bytes (1024 to the power 4), or 1024 GiB.
    • PB

      public static final Size.Unit PB
      Petabytes (represented as pB): i.e. 1 pB is 1000^5 bytes (1000 to the power of 5), or 1000 tB.
    • PIB

      public static final Size.Unit PIB
      Pebi-bytes (represented as either PB or PiB), where we use binary approach, i.e. 1 PB or PiB is 1024^5 bytes (1024 to the power 5), or 1024 TiB.
    • EB

      public static final Size.Unit EB
      Exabytes (represented as eB): i.e. 1 eB is 1000^6 bytes (1000 to the power of 6), or 1000 pB.
    • EIB

      public static final Size.Unit EIB
      Exbi-bytes (represented as either EB or EiB), where we use binary approach, i.e. 1 EB or EiB is 1024^6 bytes (1024 to the power 6), or 1024 PiB.
  • Method Details

    • values

      public static Size.Unit[] 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 Size.Unit 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
    • parse

      public static Size.Unit parse(String unitString)
      Parse the size string to appropriate unit.
      Parameters:
      unitString - defines the unit, such as KB, MiB, pB etc.; empty string parses to BYTE
      Returns:
      a parsed unit
      Throws:
      IllegalArgumentException - if the unit cannot be parsed
    • bytes

      public long bytes()
      Number of bytes this unit represents.
      Returns:
      number of bytes of this unit
    • bytesInteger

      public BigInteger bytesInteger()
      Number of bytes in this unit (exact integer).
      Returns:
      number of bytes this unit contains