Enum Constant and Description |
---|
BYTES
Bytes.
|
GIGABYTES
Gigabytes.
|
KILOBYTES
Kilobytes.
|
MEGABYTES
Megabytes.
|
TERABYTES
Terabytes.
|
Modifier and Type | Field and Description |
---|---|
private DataSize |
size |
private java.lang.String |
suffix |
Modifier and Type | Method and Description |
---|---|
static DataUnit |
fromSuffix(java.lang.String suffix)
Return the
DataUnit matching the specified suffix . |
(package private) DataSize |
size() |
static DataUnit |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static DataUnit[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final DataUnit BYTES
public static final DataUnit KILOBYTES
public static final DataUnit MEGABYTES
public static final DataUnit GIGABYTES
public static final DataUnit TERABYTES
private final java.lang.String suffix
private final DataSize size
public static DataUnit[] values()
for (DataUnit c : DataUnit.values()) System.out.println(c);
public static DataUnit valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullDataSize size()
public static DataUnit fromSuffix(java.lang.String suffix)
DataUnit
matching the specified suffix
.suffix
- one of the standard suffixDataUnit
matching the specified suffix
java.lang.IllegalArgumentException
- if the suffix does not match any
of this enum's constants