org.somda.sdc.biceps.model.participant.AbstractDeviceComponentState Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of biceps-model Show documentation
Show all versions of biceps-model Show documentation
SDCri is a set of Java libraries that implements a network communication framework conforming
with the IEEE 11073 SDC specifications. This project implements the model for
IEEE 11073-10207.
The newest version!
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.XmlSchemaType;
import jakarta.xml.bind.annotation.XmlSeeAlso;
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 component that is part of an MDS.
*
* Java class for AbstractDeviceComponentState complex type
.
*
* The following schema fragment specifies the expected content contained within this class.
*
* {@code
*
*
*
*
*
*
*
*
*
*
*
*
*
*
* }
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "AbstractDeviceComponentState", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/participant", propOrder = {
"calibrationInfo",
"nextCalibration",
"physicalConnector"
})
@XmlSeeAlso({
AbstractComplexDeviceComponentState.class,
ChannelState.class,
ScoState.class,
ClockState.class,
BatteryState.class,
SystemContextState.class
})
public class AbstractDeviceComponentState
extends AbstractState
implements Cloneable, CopyTo, ToString
{
/**
* Provides information about the last calibration that was performed.
*
*/
@XmlElement(name = "CalibrationInfo", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/participant")
protected CalibrationInfo calibrationInfo;
/**
* Provides information about the next calibration that will be performed.
*
*/
@XmlElement(name = "NextCalibration", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/participant")
protected CalibrationInfo nextCalibration;
/**
* The physical connector number for this component, see pm:PhysicalConnectorInfo.
*
*/
@XmlElement(name = "PhysicalConnector", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/participant")
protected PhysicalConnectorInfo physicalConnector;
/**
* See pm:ComponentActivation. The implied value SHALL be "On".
*
*/
@XmlAttribute(name = "ActivationState")
protected ComponentActivation activationState;
/**
* OPTIONAL amount of operating hours (e.g., an OR light). There are no further semantics defined.
*
*/
@XmlAttribute(name = "OperatingHours")
@XmlSchemaType(name = "unsignedInt")
protected Long operatingHours;
/**
* OPTIONAL amount of operarting cycles, e.g., the number of measurements taken within the component. There are no further semantics defined.
*
*/
@XmlAttribute(name = "OperatingCycles")
protected Integer operatingCycles;
/**
* Provides information about the last calibration that was performed.
*
* @return
* possible object is
* {@link CalibrationInfo }
*
*/
@Nullable
public CalibrationInfo getCalibrationInfo() {
return calibrationInfo;
}
/**
* Sets the value of the calibrationInfo property.
*
* @param value
* allowed object is
* {@link CalibrationInfo }
*
* @see #getCalibrationInfo()
*/
public void setCalibrationInfo(
@Nullable
CalibrationInfo value) {
this.calibrationInfo = value;
}
/**
* Provides information about the next calibration that will be performed.
*
* @return
* possible object is
* {@link CalibrationInfo }
*
*/
@Nullable
public CalibrationInfo getNextCalibration() {
return nextCalibration;
}
/**
* Sets the value of the nextCalibration property.
*
* @param value
* allowed object is
* {@link CalibrationInfo }
*
* @see #getNextCalibration()
*/
public void setNextCalibration(
@Nullable
CalibrationInfo value) {
this.nextCalibration = value;
}
/**
* The physical connector number for this component, see pm:PhysicalConnectorInfo.
*
* @return
* possible object is
* {@link PhysicalConnectorInfo }
*
*/
@Nullable
public PhysicalConnectorInfo getPhysicalConnector() {
return physicalConnector;
}
/**
* Sets the value of the physicalConnector property.
*
* @param value
* allowed object is
* {@link PhysicalConnectorInfo }
*
* @see #getPhysicalConnector()
*/
public void setPhysicalConnector(
@Nullable
PhysicalConnectorInfo value) {
this.physicalConnector = value;
}
/**
* See pm:ComponentActivation. The implied value SHALL be "On".
*
* @return
* possible object is
* {@link ComponentActivation }
*
*/
@Nullable
public ComponentActivation getActivationState() {
return activationState;
}
/**
* Sets the value of the activationState property.
*
* @param value
* allowed object is
* {@link ComponentActivation }
*
* @see #getActivationState()
*/
public void setActivationState(
@Nullable
ComponentActivation value) {
this.activationState = value;
}
/**
* OPTIONAL amount of operating hours (e.g., an OR light). There are no further semantics defined.
*
* @return
* possible object is
* {@link Long }
*
*/
@Nullable
public Long getOperatingHours() {
return operatingHours;
}
/**
* Sets the value of the operatingHours property.
*
* @param value
* allowed object is
* {@link Long }
*
* @see #getOperatingHours()
*/
public void setOperatingHours(
@Nullable
Long value) {
this.operatingHours = value;
}
/**
* OPTIONAL amount of operarting cycles, e.g., the number of measurements taken within the component. There are no further semantics defined.
*
* @return
* possible object is
* {@link Integer }
*
*/
@Nullable
public Integer getOperatingCycles() {
return operatingCycles;
}
/**
* Sets the value of the operatingCycles property.
*
* @param value
* allowed object is
* {@link Integer }
*
* @see #getOperatingCycles()
*/
public void setOperatingCycles(
@Nullable
Integer value) {
this.operatingCycles = 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 AbstractDeviceComponentState that = ((AbstractDeviceComponentState) object);
{
CalibrationInfo leftCalibrationInfo;
leftCalibrationInfo = this.getCalibrationInfo();
CalibrationInfo rightCalibrationInfo;
rightCalibrationInfo = that.getCalibrationInfo();
if (this.calibrationInfo!= null) {
if (that.calibrationInfo!= null) {
if (!leftCalibrationInfo.equals(rightCalibrationInfo)) {
return false;
}
} else {
return false;
}
} else {
if (that.calibrationInfo!= null) {
return false;
}
}
}
{
CalibrationInfo leftNextCalibration;
leftNextCalibration = this.getNextCalibration();
CalibrationInfo rightNextCalibration;
rightNextCalibration = that.getNextCalibration();
if (this.nextCalibration!= null) {
if (that.nextCalibration!= null) {
if (!leftNextCalibration.equals(rightNextCalibration)) {
return false;
}
} else {
return false;
}
} else {
if (that.nextCalibration!= null) {
return false;
}
}
}
{
PhysicalConnectorInfo leftPhysicalConnector;
leftPhysicalConnector = this.getPhysicalConnector();
PhysicalConnectorInfo rightPhysicalConnector;
rightPhysicalConnector = that.getPhysicalConnector();
if (this.physicalConnector!= null) {
if (that.physicalConnector!= null) {
if (!leftPhysicalConnector.equals(rightPhysicalConnector)) {
return false;
}
} else {
return false;
}
} else {
if (that.physicalConnector!= null) {
return false;
}
}
}
{
ComponentActivation leftActivationState;
leftActivationState = this.getActivationState();
ComponentActivation rightActivationState;
rightActivationState = that.getActivationState();
if (this.activationState!= null) {
if (that.activationState!= null) {
if (!leftActivationState.equals(rightActivationState)) {
return false;
}
} else {
return false;
}
} else {
if (that.activationState!= null) {
return false;
}
}
}
{
Long leftOperatingHours;
leftOperatingHours = this.getOperatingHours();
Long rightOperatingHours;
rightOperatingHours = that.getOperatingHours();
if (this.operatingHours!= null) {
if (that.operatingHours!= null) {
if (!leftOperatingHours.equals(rightOperatingHours)) {
return false;
}
} else {
return false;
}
} else {
if (that.operatingHours!= null) {
return false;
}
}
}
{
Integer leftOperatingCycles;
leftOperatingCycles = this.getOperatingCycles();
Integer rightOperatingCycles;
rightOperatingCycles = that.getOperatingCycles();
if (this.operatingCycles!= null) {
if (that.operatingCycles!= null) {
if (!leftOperatingCycles.equals(rightOperatingCycles)) {
return false;
}
} else {
return false;
}
} else {
if (that.operatingCycles!= null) {
return false;
}
}
}
return true;
}
@Override
public int hashCode() {
int currentHashCode = 1;
currentHashCode = ((currentHashCode* 31)+ super.hashCode());
{
currentHashCode = (currentHashCode* 31);
CalibrationInfo theCalibrationInfo;
theCalibrationInfo = this.getCalibrationInfo();
if (this.calibrationInfo!= null) {
currentHashCode += theCalibrationInfo.hashCode();
}
}
{
currentHashCode = (currentHashCode* 31);
CalibrationInfo theNextCalibration;
theNextCalibration = this.getNextCalibration();
if (this.nextCalibration!= null) {
currentHashCode += theNextCalibration.hashCode();
}
}
{
currentHashCode = (currentHashCode* 31);
PhysicalConnectorInfo thePhysicalConnector;
thePhysicalConnector = this.getPhysicalConnector();
if (this.physicalConnector!= null) {
currentHashCode += thePhysicalConnector.hashCode();
}
}
{
currentHashCode = (currentHashCode* 31);
ComponentActivation theActivationState;
theActivationState = this.getActivationState();
if (this.activationState!= null) {
currentHashCode += theActivationState.hashCode();
}
}
{
currentHashCode = (currentHashCode* 31);
Long theOperatingHours;
theOperatingHours = this.getOperatingHours();
if (this.operatingHours!= null) {
currentHashCode += theOperatingHours.hashCode();
}
}
{
currentHashCode = (currentHashCode* 31);
Integer theOperatingCycles;
theOperatingCycles = this.getOperatingCycles();
if (this.operatingCycles!= null) {
currentHashCode += theOperatingCycles.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);
{
CalibrationInfo theCalibrationInfo;
theCalibrationInfo = this.getCalibrationInfo();
strategy.appendField(locator, this, "calibrationInfo", buffer, theCalibrationInfo, (this.calibrationInfo!= null));
}
{
CalibrationInfo theNextCalibration;
theNextCalibration = this.getNextCalibration();
strategy.appendField(locator, this, "nextCalibration", buffer, theNextCalibration, (this.nextCalibration!= null));
}
{
PhysicalConnectorInfo thePhysicalConnector;
thePhysicalConnector = this.getPhysicalConnector();
strategy.appendField(locator, this, "physicalConnector", buffer, thePhysicalConnector, (this.physicalConnector!= null));
}
{
ComponentActivation theActivationState;
theActivationState = this.getActivationState();
strategy.appendField(locator, this, "activationState", buffer, theActivationState, (this.activationState!= null));
}
{
Long theOperatingHours;
theOperatingHours = this.getOperatingHours();
strategy.appendField(locator, this, "operatingHours", buffer, theOperatingHours, (this.operatingHours!= null));
}
{
Integer theOperatingCycles;
theOperatingCycles = this.getOperatingCycles();
strategy.appendField(locator, this, "operatingCycles", buffer, theOperatingCycles, (this.operatingCycles!= 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 AbstractDeviceComponentState) {
final AbstractDeviceComponentState copy = ((AbstractDeviceComponentState) draftCopy);
{
Boolean calibrationInfoShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.calibrationInfo!= null));
if (calibrationInfoShouldBeCopiedAndSet == Boolean.TRUE) {
CalibrationInfo sourceCalibrationInfo;
sourceCalibrationInfo = this.getCalibrationInfo();
CalibrationInfo copyCalibrationInfo = ((CalibrationInfo) strategy.copy(LocatorUtils.property(locator, "calibrationInfo", sourceCalibrationInfo), sourceCalibrationInfo, (this.calibrationInfo!= null)));
copy.setCalibrationInfo(copyCalibrationInfo);
} else {
if (calibrationInfoShouldBeCopiedAndSet == Boolean.FALSE) {
copy.calibrationInfo = null;
}
}
}
{
Boolean nextCalibrationShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.nextCalibration!= null));
if (nextCalibrationShouldBeCopiedAndSet == Boolean.TRUE) {
CalibrationInfo sourceNextCalibration;
sourceNextCalibration = this.getNextCalibration();
CalibrationInfo copyNextCalibration = ((CalibrationInfo) strategy.copy(LocatorUtils.property(locator, "nextCalibration", sourceNextCalibration), sourceNextCalibration, (this.nextCalibration!= null)));
copy.setNextCalibration(copyNextCalibration);
} else {
if (nextCalibrationShouldBeCopiedAndSet == Boolean.FALSE) {
copy.nextCalibration = null;
}
}
}
{
Boolean physicalConnectorShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.physicalConnector!= null));
if (physicalConnectorShouldBeCopiedAndSet == Boolean.TRUE) {
PhysicalConnectorInfo sourcePhysicalConnector;
sourcePhysicalConnector = this.getPhysicalConnector();
PhysicalConnectorInfo copyPhysicalConnector = ((PhysicalConnectorInfo) strategy.copy(LocatorUtils.property(locator, "physicalConnector", sourcePhysicalConnector), sourcePhysicalConnector, (this.physicalConnector!= null)));
copy.setPhysicalConnector(copyPhysicalConnector);
} else {
if (physicalConnectorShouldBeCopiedAndSet == Boolean.FALSE) {
copy.physicalConnector = null;
}
}
}
{
Boolean activationStateShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.activationState!= null));
if (activationStateShouldBeCopiedAndSet == Boolean.TRUE) {
ComponentActivation sourceActivationState;
sourceActivationState = this.getActivationState();
ComponentActivation copyActivationState = ((ComponentActivation) strategy.copy(LocatorUtils.property(locator, "activationState", sourceActivationState), sourceActivationState, (this.activationState!= null)));
copy.setActivationState(copyActivationState);
} else {
if (activationStateShouldBeCopiedAndSet == Boolean.FALSE) {
copy.activationState = null;
}
}
}
{
Boolean operatingHoursShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.operatingHours!= null));
if (operatingHoursShouldBeCopiedAndSet == Boolean.TRUE) {
Long sourceOperatingHours;
sourceOperatingHours = this.getOperatingHours();
Long copyOperatingHours = ((Long) strategy.copy(LocatorUtils.property(locator, "operatingHours", sourceOperatingHours), sourceOperatingHours, (this.operatingHours!= null)));
copy.setOperatingHours(copyOperatingHours);
} else {
if (operatingHoursShouldBeCopiedAndSet == Boolean.FALSE) {
copy.operatingHours = null;
}
}
}
{
Boolean operatingCyclesShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.operatingCycles!= null));
if (operatingCyclesShouldBeCopiedAndSet == Boolean.TRUE) {
Integer sourceOperatingCycles;
sourceOperatingCycles = this.getOperatingCycles();
Integer copyOperatingCycles = ((Integer) strategy.copy(LocatorUtils.property(locator, "operatingCycles", sourceOperatingCycles), sourceOperatingCycles, (this.operatingCycles!= null)));
copy.setOperatingCycles(copyOperatingCycles);
} else {
if (operatingCyclesShouldBeCopiedAndSet == Boolean.FALSE) {
copy.operatingCycles = null;
}
}
}
}
return draftCopy;
}
@Override
public Object createNewInstance() {
return new AbstractDeviceComponentState();
}
}