org.sonatype.sisu.goodies.common
Enum ByteSize.ByteUnit
java.lang.Object
java.lang.Enum<ByteSize.ByteUnit>
org.sonatype.sisu.goodies.common.ByteSize.ByteUnit
- All Implemented Interfaces:
- Serializable, Comparable<ByteSize.ByteUnit>
- Enclosing class:
- ByteSize
public static enum ByteSize.ByteUnit
- extends Enum<ByteSize.ByteUnit>
BYTES
public static final ByteSize.ByteUnit BYTES
KILOBYTES
public static final ByteSize.ByteUnit KILOBYTES
MEGABYTES
public static final ByteSize.ByteUnit MEGABYTES
GIGABYTES
public static final ByteSize.ByteUnit GIGABYTES
TERABYTES
public static final ByteSize.ByteUnit TERABYTES
values
public static ByteSize.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 (ByteSize.ByteUnit c : ByteSize.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 ByteSize.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 name
NullPointerException
- if the argument is null
asBytes
public long asBytes(long value)
asKiloBytes
public long asKiloBytes(long value)
asMegaBytes
public long asMegaBytes(long value)
asGigaBytes
public long asGigaBytes(long value)
asTeraBytes
public long asTeraBytes(long value)
Copyright © 2008-2012 Sonatype, Inc.. All Rights Reserved.