public enum CapacityUnit extends Enum<CapacityUnit>
| Enum Constant and Description |
|---|
KILOGRAMS |
KILOWATTHOURS |
LITERS |
| Modifier and Type | Method and Description |
|---|---|
static CapacityUnit |
valueForString(String value)
Convert String to CapacityUnit
|
static CapacityUnit |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static CapacityUnit[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final CapacityUnit LITERS
public static final CapacityUnit KILOWATTHOURS
public static final CapacityUnit KILOGRAMS
public static CapacityUnit[] values()
for (CapacityUnit c : CapacityUnit.values()) System.out.println(c);
public static CapacityUnit valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static CapacityUnit valueForString(String value)
value - String