Package io.dropwizard.util
Enum SizeUnit
- java.lang.Object
-
- java.lang.Enum<SizeUnit>
-
- io.dropwizard.util.SizeUnit
-
- All Implemented Interfaces:
Serializable,Comparable<SizeUnit>
@Deprecated public enum SizeUnit extends Enum<SizeUnit>
Deprecated.UseDataSizeUnitfor correct SI and IEC prefixes.A unit of size.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description longconvert(long size, SizeUnit unit)Deprecated.Converts a size of the given unit into the current unit.longtoBytes(long l)Deprecated.Converts the given number of the current units into bytes.DataSizeUnittoDataSizeUnit()Deprecated.Convert this size unit into a data size unit with correct SI and IEC prefix.longtoGigabytes(long l)Deprecated.Converts the given number of the current units into gigabytes.longtoKilobytes(long l)Deprecated.Converts the given number of the current units into kilobytes.longtoMegabytes(long l)Deprecated.Converts the given number of the current units into megabytes.longtoTerabytes(long l)Deprecated.Converts the given number of the current units into terabytes.static SizeUnitvalueOf(String name)Deprecated.Returns the enum constant of this type with the specified name.static SizeUnit[]values()Deprecated.Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
BYTES
public static final SizeUnit BYTES
Deprecated.Bytes.
-
KILOBYTES
public static final SizeUnit KILOBYTES
Deprecated.Kilobytes.
-
MEGABYTES
public static final SizeUnit MEGABYTES
Deprecated.Megabytes.
-
GIGABYTES
public static final SizeUnit GIGABYTES
Deprecated.Gigabytes.
-
TERABYTES
public static final SizeUnit TERABYTES
Deprecated.Terabytes.
-
-
Method Detail
-
values
public static SizeUnit[] values()
Deprecated.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 (SizeUnit c : SizeUnit.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static SizeUnit valueOf(String name)
Deprecated.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
-
convert
public long convert(long size, SizeUnit unit)Deprecated.Converts a size of the given unit into the current unit.- Parameters:
size- the magnitude of the sizeunit- the unit of the size- Returns:
- the given size in the current unit.
-
toBytes
public long toBytes(long l)
Deprecated.Converts the given number of the current units into bytes.- Parameters:
l- the magnitude of the size in the current unit- Returns:
lof the current units in bytes
-
toKilobytes
public long toKilobytes(long l)
Deprecated.Converts the given number of the current units into kilobytes.- Parameters:
l- the magnitude of the size in the current unit- Returns:
lof the current units in kilobytes
-
toMegabytes
public long toMegabytes(long l)
Deprecated.Converts the given number of the current units into megabytes.- Parameters:
l- the magnitude of the size in the current unit- Returns:
lof the current units in megabytes
-
toGigabytes
public long toGigabytes(long l)
Deprecated.Converts the given number of the current units into gigabytes.- Parameters:
l- the magnitude of the size in the current unit- Returns:
lof the current units in bytes
-
toTerabytes
public long toTerabytes(long l)
Deprecated.Converts the given number of the current units into terabytes.- Parameters:
l- the magnitude of the size in the current unit- Returns:
lof the current units in terabytes
-
toDataSizeUnit
public DataSizeUnit toDataSizeUnit()
Deprecated.Convert this size unit into a data size unit with correct SI and IEC prefix.- Returns:
- the
DataSizeUnitcorresponding to this size unit - Since:
- 2.0
- See Also:
DataSizeUnit
-
-