Enum ByteUnit

    • Enum Constant Detail

      • BYTES

        public static final ByteUnit BYTES
        Bytes
      • KILOBYTES

        public static final ByteUnit KILOBYTES
        Kilobytes
      • MEGABYTES

        public static final ByteUnit MEGABYTES
        Megabytes
      • GIGABYTES

        public static final ByteUnit GIGABYTES
        Gigabytes
      • TERABYTES

        public static final ByteUnit TERABYTES
        Terabytes
    • Method Detail

      • values

        public static ByteUnit[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (ByteUnit c : ByteUnit.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ByteUnit valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
        NullPointerException - if the argument is null
      • getHigherUnit

        public ByteUnit getHigherUnit()
        Returns:
        Higher unit.
      • getLowerUnit

        public ByteUnit getLowerUnit()
        Returns:
        Lower unit.
      • getSuffix

        public String getSuffix()
        Returns:
        Suffix.
      • getHigherSize

        public long getHigherSize​(long currentValue)
        Parameters:
        currentValue - Size in current unit.
        Returns:
        Size in higher unit.
      • getLowerSize

        public long getLowerSize​(long currentValue)
        Parameters:
        currentValue - Size in current unit.
        Returns:
        Size in lower unit.
      • toByteUnit

        public static ByteUnit toByteUnit​(String suffix)
        Parameters:
        suffix - Suffix of unit.
        Returns:
        Unit representing this suffix.