Package net.solarnetwork.domain
Enum Class AcPhase
- All Implemented Interfaces:
Serializable,Comparable<AcPhase>,Constable
Enumeration of AC phase values.
- Version:
- 1.1
- Author:
- matt
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionforKey(char key) Get an AcPhase for a given key.forNumber(int n) Get an AcPhase for a given number.chargetKey()Get the key value of the phase.Get a key value for a line phase, with this phase as the leading phase.intGet the integer based value of the phase.static AcPhaseReturns the enum constant of this class with the specified name.static AcPhase[]values()Returns an array containing the constants of this enum class, in the order they are declared.Get a string with a key suffix added.withLineKey(String value) Get a string with a line key suffix added.
-
Enum Constant Details
-
PhaseA
The first phase. -
PhaseB
The second phase. -
PhaseC
The third phase. -
Total
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException- if the argument is null
-
getNumber
public int getNumber()Get the integer based value of the phase.The
PhaseA,PhaseB, andPhaseCphases are numbered 1, 2, and 3. The {Totalphase is numbered 0.- Returns:
- the phase number
-
getKey
public char getKey()Get the key value of the phase.The keys are a, b, c, and t.
- Returns:
- the key value
- Since:
- 1.1
-
withKey
Get a string with a key suffix added.This will take
valueand append _P, where P is the key.- Parameters:
value- the value to append the key to- Returns:
- the value with a key suffix added
- Since:
- 1.1
-
getLineKey
Get a key value for a line phase, with this phase as the leading phase.The keys are ab, bc, ca, and t.
- Returns:
- the line key
- Since:
- 1.1
-
withLineKey
Get a string with a line key suffix added.This will take
valueand append _P, where P is the line key.- Parameters:
value- the value to append the line key to- Returns:
- the value with a line key suffix added
- Since:
- 1.1
-
forNumber
Get an AcPhase for a given number.- Parameters:
n- the number- Returns:
- the AcPhase
- Throws:
IllegalArgumentException- if the number is not a valid phase value- See Also:
-
forKey
Get an AcPhase for a given key.- Parameters:
key- the key- Returns:
- the AcPhase
- Throws:
IllegalArgumentException- if the key is not a valid phase value- See Also:
-