public enum MemoryUnit extends Enum<MemoryUnit>
Enum Constant and Description |
---|
BYTES |
GIBIBYTES |
GIGABYTES |
KIBIBYTES |
KILOBYTES |
MEBIBYTES |
MEGABYTES |
TEBIBYTES |
TERABYTES |
Modifier and Type | Method and Description |
---|---|
long |
convert(long sourceSize,
MemoryUnit sourceUnit) |
String |
getSuffix() |
static long |
parseBytes(String s) |
long |
toBytes(long size) |
long |
toGibiBytes(long size) |
long |
toGigaBytes(long size) |
long |
toKibiBytes(long size) |
long |
toKiloBytes(long size) |
long |
toMebiBytes(long size) |
long |
toMegaBytes(long size) |
long |
toTebiBytes(long size) |
long |
toTeraBytes(long size) |
static MemoryUnit |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static MemoryUnit[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final MemoryUnit BYTES
public static final MemoryUnit KILOBYTES
public static final MemoryUnit KIBIBYTES
public static final MemoryUnit MEGABYTES
public static final MemoryUnit MEBIBYTES
public static final MemoryUnit GIGABYTES
public static final MemoryUnit GIBIBYTES
public static final MemoryUnit TERABYTES
public static final MemoryUnit TEBIBYTES
public static MemoryUnit[] values()
for (MemoryUnit c : MemoryUnit.values()) System.out.println(c);
public static MemoryUnit 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 String getSuffix()
public long convert(long sourceSize, MemoryUnit sourceUnit)
public long toBytes(long size)
public long toKiloBytes(long size)
public long toKibiBytes(long size)
public long toMegaBytes(long size)
public long toMebiBytes(long size)
public long toGigaBytes(long size)
public long toGibiBytes(long size)
public long toTeraBytes(long size)
public long toTebiBytes(long size)
public static long parseBytes(String s)
Copyright © 2018 JBoss, a division of Red Hat. All rights reserved.