Package com.marslib.power
Record Class PowerConfig
java.lang.Object
java.lang.Record
com.marslib.power.PowerConfig
- Record Components:
nominalVoltage- The voltage at which load shedding begins (e.g., 10.0V).warningVoltage- The threshold for a low-voltage warning alert (e.g., 8.0V).criticalVoltage- The threshold for a critical-voltage alert and floor of shedding (e.g., 7.0V).
public record PowerConfig(double nominalVoltage, double warningVoltage, double criticalVoltage)
extends Record
Configuration record for the MARSPowerManager.
-
Constructor Summary
ConstructorsConstructorDescriptionPowerConfig(double nominalVoltage, double warningVoltage, double criticalVoltage) Creates an instance of aPowerConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of thecriticalVoltagerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.doubleReturns the value of thenominalVoltagerecord component.final StringtoString()Returns a string representation of this record class.doubleReturns the value of thewarningVoltagerecord component.
-
Constructor Details
-
PowerConfig
public PowerConfig(double nominalVoltage, double warningVoltage, double criticalVoltage) Creates an instance of aPowerConfigrecord class.- Parameters:
nominalVoltage- the value for thenominalVoltagerecord componentwarningVoltage- the value for thewarningVoltagerecord componentcriticalVoltage- the value for thecriticalVoltagerecord component
-
-
Method Details
-
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. -
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. -
equals
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 '=='. -
nominalVoltage
public double nominalVoltage()Returns the value of thenominalVoltagerecord component.- Returns:
- the value of the
nominalVoltagerecord component
-
warningVoltage
public double warningVoltage()Returns the value of thewarningVoltagerecord component.- Returns:
- the value of the
warningVoltagerecord component
-
criticalVoltage
public double criticalVoltage()Returns the value of thecriticalVoltagerecord component.- Returns:
- the value of the
criticalVoltagerecord component
-