org.sonatype.sisu.goodies.common
Enum ByteSize.ByteUnit

java.lang.Object
  extended by java.lang.Enum<ByteSize.ByteUnit>
      extended by 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>


Enum Constant Summary
BYTES
           
GIGABYTES
           
KILOBYTES
           
MEGABYTES
           
TERABYTES
           
 
Method Summary
 long asBytes(long value)
           
 long asGigaBytes(long value)
           
 long asKiloBytes(long value)
           
 long asMegaBytes(long value)
           
 long asTeraBytes(long value)
           
static ByteSize.ByteUnit valueOf(String name)
          Returns the enum constant of this type with the specified name.
static ByteSize.ByteUnit[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

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
Method Detail

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.