Record Class ChargingMetrics

java.lang.Object
java.lang.Record
dev.digiried.wattpilot.dto.ChargingMetrics
Record Components:
power - total power in watts (W)
voltage1 - phase 1 voltage in volts (V)
voltage2 - phase 2 voltage in volts (V)
voltage3 - phase 3 voltage in volts (V)
amperage1 - phase 1 amperage in amperes (A)
amperage2 - phase 2 amperage in amperes (A)
amperage3 - phase 3 amperage in amperes (A)
power1 - power of phase 1 in watts (W)
power2 - power of phase 2 in watts (W)
power3 - power of phase 3 in watts (W)

public record ChargingMetrics(float power, int voltage1, int voltage2, int voltage3, int amperage1, int amperage2, int amperage3, float power1, float power2, float power3) extends Record
Record for charging metrics.
Author:
Florian Hotze - Initial contribution
  • Constructor Summary

    Constructors
    Constructor
    Description
    ChargingMetrics(float power, int voltage1, int voltage2, int voltage3, int amperage1, int amperage2, int amperage3, float power1, float power2, float power3)
    Creates an instance of a ChargingMetrics record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the amperage1 record component.
    int
    Returns the value of the amperage2 record component.
    int
    Returns the value of the amperage3 record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    float
    Returns the value of the power record component.
    float
    Returns the value of the power1 record component.
    float
    Returns the value of the power2 record component.
    float
    Returns the value of the power3 record component.
    Returns a string representation of this record class.
    int
    Returns the value of the voltage1 record component.
    int
    Returns the value of the voltage2 record component.
    int
    Returns the value of the voltage3 record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ChargingMetrics

      public ChargingMetrics(float power, int voltage1, int voltage2, int voltage3, int amperage1, int amperage2, int amperage3, float power1, float power2, float power3)
      Creates an instance of a ChargingMetrics record class.
      Parameters:
      power - the value for the power record component
      voltage1 - the value for the voltage1 record component
      voltage2 - the value for the voltage2 record component
      voltage3 - the value for the voltage3 record component
      amperage1 - the value for the amperage1 record component
      amperage2 - the value for the amperage2 record component
      amperage3 - the value for the amperage3 record component
      power1 - the value for the power1 record component
      power2 - the value for the power2 record component
      power3 - the value for the power3 record component
  • Method Details

    • toString

      public String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • power

      public float power()
      Returns the value of the power record component.
      Returns:
      the value of the power record component
    • voltage1

      public int voltage1()
      Returns the value of the voltage1 record component.
      Returns:
      the value of the voltage1 record component
    • voltage2

      public int voltage2()
      Returns the value of the voltage2 record component.
      Returns:
      the value of the voltage2 record component
    • voltage3

      public int voltage3()
      Returns the value of the voltage3 record component.
      Returns:
      the value of the voltage3 record component
    • amperage1

      public int amperage1()
      Returns the value of the amperage1 record component.
      Returns:
      the value of the amperage1 record component
    • amperage2

      public int amperage2()
      Returns the value of the amperage2 record component.
      Returns:
      the value of the amperage2 record component
    • amperage3

      public int amperage3()
      Returns the value of the amperage3 record component.
      Returns:
      the value of the amperage3 record component
    • power1

      public float power1()
      Returns the value of the power1 record component.
      Returns:
      the value of the power1 record component
    • power2

      public float power2()
      Returns the value of the power2 record component.
      Returns:
      the value of the power2 record component
    • power3

      public float power3()
      Returns the value of the power3 record component.
      Returns:
      the value of the power3 record component