Package no.digipost.io
Enum DataSizeUnit
- java.lang.Object
-
- java.lang.Enum<DataSizeUnit>
-
- no.digipost.io.DataSizeUnit
-
- All Implemented Interfaces:
Serializable,Comparable<DataSizeUnit>
public enum DataSizeUnit extends Enum<DataSizeUnit>
-
-
Field Summary
Fields Modifier and Type Field Description static DataSizeUnitBAlias forBYTES.static DataSizeUnitGBAlias forGIGABYTESstatic DataSizeUnitkBAlias forKILOBYTES.static DataSizeUnitMBAlias forMEGABYTES
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringtoString()static DataSizeUnitvalueOf(String name)Returns the enum constant of this type with the specified name.static DataSizeUnit[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
BYTES
public static final DataSizeUnit BYTES
The byte unit.
-
KILOBYTES
public static final DataSizeUnit KILOBYTES
The kilobyte unit, i.e. 1024BYTES.
-
MEGABYTES
public static final DataSizeUnit MEGABYTES
The Megabyte unit, i.e. 1024KILOBYTES, i.e. 1 048 576 bytes.
-
GIGABYTES
public static final DataSizeUnit GIGABYTES
The Gigabyte unit, i.e. 1024MEGABYTES, i.e. 1 048 576 kilobytes.
-
-
Field Detail
-
B
public static final DataSizeUnit B
Alias forBYTES.
-
kB
public static final DataSizeUnit kB
Alias forKILOBYTES.
-
MB
public static final DataSizeUnit MB
Alias forMEGABYTES
-
GB
public static final DataSizeUnit GB
Alias forGIGABYTES
-
-
Method Detail
-
values
public static DataSizeUnit[] 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 (DataSizeUnit c : DataSizeUnit.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DataSizeUnit 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 nameNullPointerException- if the argument is null
-
toString
public String toString()
- Overrides:
toStringin classEnum<DataSizeUnit>
-
-