
org.somda.sdc.biceps.model.participant.BatteryState Maven / Gradle / Ivy
package org.somda.sdc.biceps.model.participant;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlEnum;
import jakarta.xml.bind.annotation.XmlEnumValue;
import jakarta.xml.bind.annotation.XmlSchemaType;
import jakarta.xml.bind.annotation.XmlType;
import org.jetbrains.annotations.Nullable;
import org.jvnet.jaxb.lang.CopyStrategy;
import org.jvnet.jaxb.lang.CopyTo;
import org.jvnet.jaxb.lang.JAXBCopyStrategy;
import org.jvnet.jaxb.lang.JAXBToStringStrategy;
import org.jvnet.jaxb.lang.ToString;
import org.jvnet.jaxb.lang.ToStringStrategy;
import org.jvnet.jaxb.locator.ObjectLocator;
import org.jvnet.jaxb.locator.util.LocatorUtils;
/**
* State of a battery of an MDS.
*
* The current power source is designated by ./@ActivationState:
*
* - If ./@ActivationState equals "On", the device is running on battery
* - If ./@ActivationState equals "Off", the device is in mains operation and currently not able to be run on battery
* - If ./@ActivationState equals "StndBy", the device is in mains operation and can be switched to run on battery
* - If ./@ActivationState equals "Fail", the battery has a malfunction. Detailed error information SHOULD be communicated by using an ALERT SYSTEM.
*
* Enumerations "Shtdn" and "NotRdy" are undefined for BatteryState.
*
* Java class for BatteryState complex type
.
*
* The following schema fragment specifies the expected content contained within this class.
*
* {@code
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
* }
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "BatteryState", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/participant", propOrder = {
"capacityRemaining",
"voltage",
"current",
"temperature",
"remainingBatteryTime"
})
public class BatteryState
extends AbstractDeviceComponentState
implements Cloneable, CopyTo, ToString
{
/**
* Remaining capacity at current load.
*
*/
@XmlElement(name = "CapacityRemaining", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/participant")
protected Measurement capacityRemaining;
/**
* Voltage between the terminals of a cell or battery when being discharged. See also IEC 60050-482 International Electrotechnical Vocabulary, 482-03-28.
*
*/
@XmlElement(name = "Voltage", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/participant")
protected Measurement voltage;
/**
* Electric current delivered by a battery during its discharge; negative if battery is charge. See also IEC 60050-482 International Electrotechnical Vocabulary, 482-03-24.
*
*/
@XmlElement(name = "Current", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/participant")
protected Measurement current;
/**
* Current battery temperature.
*
*/
@XmlElement(name = "Temperature", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/participant")
protected Measurement temperature;
/**
* Current remaining time until battery is discharged.
*
*/
@XmlElement(name = "RemainingBatteryTime", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/participant")
protected Measurement remainingBatteryTime;
/**
* Current charge status of the battery.
*
*/
@XmlAttribute(name = "ChargeStatus")
protected BatteryState.ChargeStatus chargeStatus;
/**
* Number of charge/discharge cycles.
*
*/
@XmlAttribute(name = "ChargeCycles")
@XmlSchemaType(name = "unsignedInt")
protected Long chargeCycles;
/**
* Remaining capacity at current load.
*
* @return
* possible object is
* {@link Measurement }
*
*/
@Nullable
public Measurement getCapacityRemaining() {
return capacityRemaining;
}
/**
* Sets the value of the capacityRemaining property.
*
* @param value
* allowed object is
* {@link Measurement }
*
* @see #getCapacityRemaining()
*/
public void setCapacityRemaining(
@Nullable
Measurement value) {
this.capacityRemaining = value;
}
/**
* Voltage between the terminals of a cell or battery when being discharged. See also IEC 60050-482 International Electrotechnical Vocabulary, 482-03-28.
*
* @return
* possible object is
* {@link Measurement }
*
*/
@Nullable
public Measurement getVoltage() {
return voltage;
}
/**
* Sets the value of the voltage property.
*
* @param value
* allowed object is
* {@link Measurement }
*
* @see #getVoltage()
*/
public void setVoltage(
@Nullable
Measurement value) {
this.voltage = value;
}
/**
* Electric current delivered by a battery during its discharge; negative if battery is charge. See also IEC 60050-482 International Electrotechnical Vocabulary, 482-03-24.
*
* @return
* possible object is
* {@link Measurement }
*
*/
@Nullable
public Measurement getCurrent() {
return current;
}
/**
* Sets the value of the current property.
*
* @param value
* allowed object is
* {@link Measurement }
*
* @see #getCurrent()
*/
public void setCurrent(
@Nullable
Measurement value) {
this.current = value;
}
/**
* Current battery temperature.
*
* @return
* possible object is
* {@link Measurement }
*
*/
@Nullable
public Measurement getTemperature() {
return temperature;
}
/**
* Sets the value of the temperature property.
*
* @param value
* allowed object is
* {@link Measurement }
*
* @see #getTemperature()
*/
public void setTemperature(
@Nullable
Measurement value) {
this.temperature = value;
}
/**
* Current remaining time until battery is discharged.
*
* @return
* possible object is
* {@link Measurement }
*
*/
@Nullable
public Measurement getRemainingBatteryTime() {
return remainingBatteryTime;
}
/**
* Sets the value of the remainingBatteryTime property.
*
* @param value
* allowed object is
* {@link Measurement }
*
* @see #getRemainingBatteryTime()
*/
public void setRemainingBatteryTime(
@Nullable
Measurement value) {
this.remainingBatteryTime = value;
}
/**
* Current charge status of the battery.
*
* @return
* possible object is
* {@link BatteryState.ChargeStatus }
*
*/
@Nullable
public BatteryState.ChargeStatus getChargeStatus() {
return chargeStatus;
}
/**
* Sets the value of the chargeStatus property.
*
* @param value
* allowed object is
* {@link BatteryState.ChargeStatus }
*
* @see #getChargeStatus()
*/
public void setChargeStatus(
@Nullable
BatteryState.ChargeStatus value) {
this.chargeStatus = value;
}
/**
* Number of charge/discharge cycles.
*
* @return
* possible object is
* {@link Long }
*
*/
@Nullable
public Long getChargeCycles() {
return chargeCycles;
}
/**
* Sets the value of the chargeCycles property.
*
* @param value
* allowed object is
* {@link Long }
*
* @see #getChargeCycles()
*/
public void setChargeCycles(
@Nullable
Long value) {
this.chargeCycles = value;
}
@Override
public boolean equals(Object object) {
if ((object == null)||(this.getClass()!= object.getClass())) {
return false;
}
if (this == object) {
return true;
}
if (!super.equals(object)) {
return false;
}
final BatteryState that = ((BatteryState) object);
{
Measurement leftCapacityRemaining;
leftCapacityRemaining = this.getCapacityRemaining();
Measurement rightCapacityRemaining;
rightCapacityRemaining = that.getCapacityRemaining();
if (this.capacityRemaining!= null) {
if (that.capacityRemaining!= null) {
if (!leftCapacityRemaining.equals(rightCapacityRemaining)) {
return false;
}
} else {
return false;
}
} else {
if (that.capacityRemaining!= null) {
return false;
}
}
}
{
Measurement leftVoltage;
leftVoltage = this.getVoltage();
Measurement rightVoltage;
rightVoltage = that.getVoltage();
if (this.voltage!= null) {
if (that.voltage!= null) {
if (!leftVoltage.equals(rightVoltage)) {
return false;
}
} else {
return false;
}
} else {
if (that.voltage!= null) {
return false;
}
}
}
{
Measurement leftCurrent;
leftCurrent = this.getCurrent();
Measurement rightCurrent;
rightCurrent = that.getCurrent();
if (this.current!= null) {
if (that.current!= null) {
if (!leftCurrent.equals(rightCurrent)) {
return false;
}
} else {
return false;
}
} else {
if (that.current!= null) {
return false;
}
}
}
{
Measurement leftTemperature;
leftTemperature = this.getTemperature();
Measurement rightTemperature;
rightTemperature = that.getTemperature();
if (this.temperature!= null) {
if (that.temperature!= null) {
if (!leftTemperature.equals(rightTemperature)) {
return false;
}
} else {
return false;
}
} else {
if (that.temperature!= null) {
return false;
}
}
}
{
Measurement leftRemainingBatteryTime;
leftRemainingBatteryTime = this.getRemainingBatteryTime();
Measurement rightRemainingBatteryTime;
rightRemainingBatteryTime = that.getRemainingBatteryTime();
if (this.remainingBatteryTime!= null) {
if (that.remainingBatteryTime!= null) {
if (!leftRemainingBatteryTime.equals(rightRemainingBatteryTime)) {
return false;
}
} else {
return false;
}
} else {
if (that.remainingBatteryTime!= null) {
return false;
}
}
}
{
BatteryState.ChargeStatus leftChargeStatus;
leftChargeStatus = this.getChargeStatus();
BatteryState.ChargeStatus rightChargeStatus;
rightChargeStatus = that.getChargeStatus();
if (this.chargeStatus!= null) {
if (that.chargeStatus!= null) {
if (!leftChargeStatus.equals(rightChargeStatus)) {
return false;
}
} else {
return false;
}
} else {
if (that.chargeStatus!= null) {
return false;
}
}
}
{
Long leftChargeCycles;
leftChargeCycles = this.getChargeCycles();
Long rightChargeCycles;
rightChargeCycles = that.getChargeCycles();
if (this.chargeCycles!= null) {
if (that.chargeCycles!= null) {
if (!leftChargeCycles.equals(rightChargeCycles)) {
return false;
}
} else {
return false;
}
} else {
if (that.chargeCycles!= null) {
return false;
}
}
}
return true;
}
@Override
public int hashCode() {
int currentHashCode = 1;
currentHashCode = ((currentHashCode* 31)+ super.hashCode());
{
currentHashCode = (currentHashCode* 31);
Measurement theCapacityRemaining;
theCapacityRemaining = this.getCapacityRemaining();
if (this.capacityRemaining!= null) {
currentHashCode += theCapacityRemaining.hashCode();
}
}
{
currentHashCode = (currentHashCode* 31);
Measurement theVoltage;
theVoltage = this.getVoltage();
if (this.voltage!= null) {
currentHashCode += theVoltage.hashCode();
}
}
{
currentHashCode = (currentHashCode* 31);
Measurement theCurrent;
theCurrent = this.getCurrent();
if (this.current!= null) {
currentHashCode += theCurrent.hashCode();
}
}
{
currentHashCode = (currentHashCode* 31);
Measurement theTemperature;
theTemperature = this.getTemperature();
if (this.temperature!= null) {
currentHashCode += theTemperature.hashCode();
}
}
{
currentHashCode = (currentHashCode* 31);
Measurement theRemainingBatteryTime;
theRemainingBatteryTime = this.getRemainingBatteryTime();
if (this.remainingBatteryTime!= null) {
currentHashCode += theRemainingBatteryTime.hashCode();
}
}
{
currentHashCode = (currentHashCode* 31);
BatteryState.ChargeStatus theChargeStatus;
theChargeStatus = this.getChargeStatus();
if (this.chargeStatus!= null) {
currentHashCode += theChargeStatus.hashCode();
}
}
{
currentHashCode = (currentHashCode* 31);
Long theChargeCycles;
theChargeCycles = this.getChargeCycles();
if (this.chargeCycles!= null) {
currentHashCode += theChargeCycles.hashCode();
}
}
return currentHashCode;
}
@Override
public String toString() {
final ToStringStrategy strategy = JAXBToStringStrategy.getInstance();
final StringBuilder buffer = new StringBuilder();
append(null, buffer, strategy);
return buffer.toString();
}
@Override
public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
strategy.appendStart(locator, this, buffer);
appendFields(locator, buffer, strategy);
strategy.appendEnd(locator, this, buffer);
return buffer;
}
@Override
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
super.appendFields(locator, buffer, strategy);
{
Measurement theCapacityRemaining;
theCapacityRemaining = this.getCapacityRemaining();
strategy.appendField(locator, this, "capacityRemaining", buffer, theCapacityRemaining, (this.capacityRemaining!= null));
}
{
Measurement theVoltage;
theVoltage = this.getVoltage();
strategy.appendField(locator, this, "voltage", buffer, theVoltage, (this.voltage!= null));
}
{
Measurement theCurrent;
theCurrent = this.getCurrent();
strategy.appendField(locator, this, "current", buffer, theCurrent, (this.current!= null));
}
{
Measurement theTemperature;
theTemperature = this.getTemperature();
strategy.appendField(locator, this, "temperature", buffer, theTemperature, (this.temperature!= null));
}
{
Measurement theRemainingBatteryTime;
theRemainingBatteryTime = this.getRemainingBatteryTime();
strategy.appendField(locator, this, "remainingBatteryTime", buffer, theRemainingBatteryTime, (this.remainingBatteryTime!= null));
}
{
BatteryState.ChargeStatus theChargeStatus;
theChargeStatus = this.getChargeStatus();
strategy.appendField(locator, this, "chargeStatus", buffer, theChargeStatus, (this.chargeStatus!= null));
}
{
Long theChargeCycles;
theChargeCycles = this.getChargeCycles();
strategy.appendField(locator, this, "chargeCycles", buffer, theChargeCycles, (this.chargeCycles!= null));
}
return buffer;
}
@Override
public Object clone() {
return copyTo(createNewInstance());
}
@Override
public Object copyTo(Object target) {
final CopyStrategy strategy = JAXBCopyStrategy.getInstance();
return copyTo(null, target, strategy);
}
@Override
public Object copyTo(ObjectLocator locator, Object target, CopyStrategy strategy) {
final Object draftCopy = ((target == null)?createNewInstance():target);
super.copyTo(locator, draftCopy, strategy);
if (draftCopy instanceof BatteryState) {
final BatteryState copy = ((BatteryState) draftCopy);
{
Boolean capacityRemainingShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.capacityRemaining!= null));
if (capacityRemainingShouldBeCopiedAndSet == Boolean.TRUE) {
Measurement sourceCapacityRemaining;
sourceCapacityRemaining = this.getCapacityRemaining();
Measurement copyCapacityRemaining = ((Measurement) strategy.copy(LocatorUtils.property(locator, "capacityRemaining", sourceCapacityRemaining), sourceCapacityRemaining, (this.capacityRemaining!= null)));
copy.setCapacityRemaining(copyCapacityRemaining);
} else {
if (capacityRemainingShouldBeCopiedAndSet == Boolean.FALSE) {
copy.capacityRemaining = null;
}
}
}
{
Boolean voltageShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.voltage!= null));
if (voltageShouldBeCopiedAndSet == Boolean.TRUE) {
Measurement sourceVoltage;
sourceVoltage = this.getVoltage();
Measurement copyVoltage = ((Measurement) strategy.copy(LocatorUtils.property(locator, "voltage", sourceVoltage), sourceVoltage, (this.voltage!= null)));
copy.setVoltage(copyVoltage);
} else {
if (voltageShouldBeCopiedAndSet == Boolean.FALSE) {
copy.voltage = null;
}
}
}
{
Boolean currentShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.current!= null));
if (currentShouldBeCopiedAndSet == Boolean.TRUE) {
Measurement sourceCurrent;
sourceCurrent = this.getCurrent();
Measurement copyCurrent = ((Measurement) strategy.copy(LocatorUtils.property(locator, "current", sourceCurrent), sourceCurrent, (this.current!= null)));
copy.setCurrent(copyCurrent);
} else {
if (currentShouldBeCopiedAndSet == Boolean.FALSE) {
copy.current = null;
}
}
}
{
Boolean temperatureShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.temperature!= null));
if (temperatureShouldBeCopiedAndSet == Boolean.TRUE) {
Measurement sourceTemperature;
sourceTemperature = this.getTemperature();
Measurement copyTemperature = ((Measurement) strategy.copy(LocatorUtils.property(locator, "temperature", sourceTemperature), sourceTemperature, (this.temperature!= null)));
copy.setTemperature(copyTemperature);
} else {
if (temperatureShouldBeCopiedAndSet == Boolean.FALSE) {
copy.temperature = null;
}
}
}
{
Boolean remainingBatteryTimeShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.remainingBatteryTime!= null));
if (remainingBatteryTimeShouldBeCopiedAndSet == Boolean.TRUE) {
Measurement sourceRemainingBatteryTime;
sourceRemainingBatteryTime = this.getRemainingBatteryTime();
Measurement copyRemainingBatteryTime = ((Measurement) strategy.copy(LocatorUtils.property(locator, "remainingBatteryTime", sourceRemainingBatteryTime), sourceRemainingBatteryTime, (this.remainingBatteryTime!= null)));
copy.setRemainingBatteryTime(copyRemainingBatteryTime);
} else {
if (remainingBatteryTimeShouldBeCopiedAndSet == Boolean.FALSE) {
copy.remainingBatteryTime = null;
}
}
}
{
Boolean chargeStatusShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.chargeStatus!= null));
if (chargeStatusShouldBeCopiedAndSet == Boolean.TRUE) {
BatteryState.ChargeStatus sourceChargeStatus;
sourceChargeStatus = this.getChargeStatus();
BatteryState.ChargeStatus copyChargeStatus = ((BatteryState.ChargeStatus) strategy.copy(LocatorUtils.property(locator, "chargeStatus", sourceChargeStatus), sourceChargeStatus, (this.chargeStatus!= null)));
copy.setChargeStatus(copyChargeStatus);
} else {
if (chargeStatusShouldBeCopiedAndSet == Boolean.FALSE) {
copy.chargeStatus = null;
}
}
}
{
Boolean chargeCyclesShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.chargeCycles!= null));
if (chargeCyclesShouldBeCopiedAndSet == Boolean.TRUE) {
Long sourceChargeCycles;
sourceChargeCycles = this.getChargeCycles();
Long copyChargeCycles = ((Long) strategy.copy(LocatorUtils.property(locator, "chargeCycles", sourceChargeCycles), sourceChargeCycles, (this.chargeCycles!= null)));
copy.setChargeCycles(copyChargeCycles);
} else {
if (chargeCyclesShouldBeCopiedAndSet == Boolean.FALSE) {
copy.chargeCycles = null;
}
}
}
}
return draftCopy;
}
@Override
public Object createNewInstance() {
return new BatteryState();
}
/**
* Java class for null
.
*
* The following schema fragment specifies the expected content contained within this class.
* {@code
*
*
*
*
*
*
*
*
* }
*
*/
@XmlType(name = "")
@XmlEnum
public enum ChargeStatus {
/**
* Ful = Full. All available active material is in a state such that the charging under the selected conditions produces no significant increase of capacity. See also IEC 60050-482 International Electrotechnical Vocabulary, 482-05-42.
*
*/
@XmlEnumValue("Ful")
FUL("Ful"),
/**
* ChB = Charging Battery. Battery is currently supplied with electric energy from an external circuit. See also IEC 60050-482 International Electrotechnical Vocabulary, 482-05-27.
*
*/
@XmlEnumValue("ChB")
CH_B("ChB"),
/**
* DisChB = Discharging Battery. Battery delivers, to an external electric circuit and under specified conditions, electric energy produced in the cells. See also IEC 60050-482 International Electrotechnical Vocabulary, 482-03-23
*
*/
@XmlEnumValue("DisChB")
DIS_CH_B("DisChB"),
/**
* DEB = Discharged Empty Battery. Discharged secondary battery. See also IEC 60050-482 International Electrotechnical Vocabulary, 482-05-31.
*
*/
DEB("DEB");
private final String value;
ChargeStatus(String v) {
value = v;
}
/**
* Gets the value associated to the enum constant.
*
* @return
* The value linked to the enum.
*/
public String value() {
return value;
}
/**
* Gets the enum associated to the value passed as parameter.
*
* @param v
* The value to get the enum from.
* @return
* The enum which corresponds to the value, if it exists.
* @throws IllegalArgumentException
* If no value matches in the enum declaration.
*/
public static BatteryState.ChargeStatus fromValue(String v) {
for (BatteryState.ChargeStatus c: BatteryState.ChargeStatus.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy