Enum ByteUnit
- java.lang.Object
-
- java.lang.Enum<ByteUnit>
-
- org.codehaus.cargo.container.websphere.util.ByteUnit
-
- All Implemented Interfaces:
Serializable
,Comparable<ByteUnit>
public enum ByteUnit extends Enum<ByteUnit>
Represents byte size.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getHigherSize(long currentValue)
ByteUnit
getHigherUnit()
long
getLowerSize(long currentValue)
ByteUnit
getLowerUnit()
String
getSuffix()
static ByteUnit
toByteUnit(String suffix)
static ByteUnit
valueOf(String name)
Returns the enum constant of this type with the specified name.static ByteUnit[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
BYTES
public static final ByteUnit BYTES
Bytes
-
KILOBYTES
public static final ByteUnit KILOBYTES
Kilobytes
-
MEGABYTES
public static final ByteUnit MEGABYTES
Megabytes
-
GIGABYTES
public static final ByteUnit GIGABYTES
Gigabytes
-
TERABYTES
public static final ByteUnit TERABYTES
Terabytes
-
-
Method Detail
-
values
public static ByteUnit[] 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 (ByteUnit c : ByteUnit.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ByteUnit 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
-
getHigherUnit
public ByteUnit getHigherUnit()
- Returns:
- Higher unit.
-
getLowerUnit
public ByteUnit getLowerUnit()
- Returns:
- Lower unit.
-
getSuffix
public String getSuffix()
- Returns:
- Suffix.
-
getHigherSize
public long getHigherSize(long currentValue)
- Parameters:
currentValue
- Size in current unit.- Returns:
- Size in higher unit.
-
getLowerSize
public long getLowerSize(long currentValue)
- Parameters:
currentValue
- Size in current unit.- Returns:
- Size in lower unit.
-
-