public enum FileSizeUnit extends Enum<FileSizeUnit>
| Enum Constant and Description |
|---|
B
Byte file size unit.
|
GB
Gigabyte file size unit.
|
KB
Kilobyte file size unit.
|
MB
Megabyte file size unit.
|
| Modifier and Type | Method and Description |
|---|---|
abstract long |
convert(long sourceDuration,
FileSizeUnit sourceUnit)
Converts a value to a specified unit.
|
abstract long |
toB(long value)
Convert to B.
|
abstract long |
toGB(long value)
Convert to GB.
|
abstract long |
toKB(long value)
Convert to KB.
|
abstract long |
toMB(long value)
Convert to MB.
|
static FileSizeUnit |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static FileSizeUnit[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final FileSizeUnit GB
public static final FileSizeUnit MB
public static final FileSizeUnit KB
public static final FileSizeUnit B
public static FileSizeUnit[] values()
for (FileSizeUnit c : FileSizeUnit.values()) System.out.println(c);
public static FileSizeUnit valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic abstract long convert(long sourceDuration,
FileSizeUnit sourceUnit)
sourceDuration - the value.sourceUnit - the unit.public abstract long toB(long value)
value - the valuepublic abstract long toKB(long value)
value - the valuepublic abstract long toMB(long value)
value - the valuepublic abstract long toGB(long value)
value - the valueCopyright © 2010–2023 Open Identity Platform Community. All rights reserved.