Enum Class AcPhase

java.lang.Object
java.lang.Enum<AcPhase>
net.solarnetwork.domain.AcPhase
All Implemented Interfaces:
Serializable, Comparable<AcPhase>, Constable

public enum AcPhase extends Enum<AcPhase>
Enumeration of AC phase values.
Version:
1.1
Author:
matt
  • Enum Constant Details

    • PhaseA

      public static final AcPhase PhaseA
      The first phase.
    • PhaseB

      public static final AcPhase PhaseB
      The second phase.
    • PhaseC

      public static final AcPhase PhaseC
      The third phase.
    • Total

      public static final AcPhase Total
  • Method Details

    • values

      public static AcPhase[] 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

      public static AcPhase valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • getNumber

      public int getNumber()
      Get the integer based value of the phase.

      The PhaseA, PhaseB, and PhaseC phases are numbered 1, 2, and 3. The {Total phase 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

      public String withKey(String value)
      Get a string with a key suffix added.

      This will take value and 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

      public String 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

      public String withLineKey(String value)
      Get a string with a line key suffix added.

      This will take value and 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

      public AcPhase forNumber(int n)
      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

      public AcPhase forKey(char key)
      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: