public enum DataUnit extends Enum<DataUnit>
此类来自于:Spring-framework
BYTES 1B 2^0 1 KILOBYTES 1KB 2^10 1,024 MEGABYTES 1MB 2^20 1,048,576 GIGABYTES 1GB 2^30 1,073,741,824 TERABYTES 1TB 2^40 1,099,511,627,776
Enum Constant and Description |
---|
BYTES
Bytes, 后缀表示为:
B . |
GIGABYTES
Gigabytes, 后缀表示为:
GB . |
KILOBYTES
Kilobytes, 后缀表示为:
KB . |
MEGABYTES
Megabytes, 后缀表示为:
MB . |
TERABYTES
Terabytes, 后缀表示为:
TB . |
Modifier and Type | Field and Description |
---|---|
static String[] |
UNIT_NAMES |
Modifier and Type | Method and Description |
---|---|
static DataUnit |
fromSuffix(String suffix)
通过后缀返回对应的 DataUnit
|
static DataUnit |
valueOf(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
B
.public static final DataUnit KILOBYTES
KB
.public static final DataUnit MEGABYTES
MB
.public static final DataUnit GIGABYTES
GB
.public static final DataUnit TERABYTES
TB
.public static final String[] UNIT_NAMES
public static DataUnit[] values()
for (DataUnit c : DataUnit.values()) System.out.println(c);
public static DataUnit 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 static DataUnit fromSuffix(String suffix)
suffix
- 单位后缀DataUnit
IllegalArgumentException
- 后缀无法识别报错Copyright © 2024. All rights reserved.