public enum BatteryState extends java.lang.Enum<BatteryState>
| Enum Constant and Description |
|---|
charging |
fullCharged |
low |
normal |
unknown |
veryLow |
| Modifier and Type | Method and Description |
|---|---|
static BatteryState |
fromValue(byte value)
Returns the BatteryState enum corresponding to the given byte value.
|
byte |
getCode()
Returns the byte code of the battery state.
|
java.lang.String |
toString()
Returns the string representation of the battery state.
|
byte |
value()
Returns the byte value of the battery state.
|
static BatteryState |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static BatteryState[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final BatteryState charging
public static final BatteryState veryLow
public static final BatteryState low
public static final BatteryState normal
public static final BatteryState fullCharged
public static final BatteryState unknown
public static BatteryState[] values()
for (BatteryState c : BatteryState.values()) System.out.println(c);
public static BatteryState valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic byte value()
public byte getCode()
public java.lang.String toString()
toString in class java.lang.Enum<BatteryState>public static BatteryState fromValue(byte value) throws java.lang.IllegalArgumentException
value - The byte value to match against the BatteryState enum values.java.lang.IllegalArgumentException - If the given byte value does not match any BatteryState enum value.