org.somda.sdc.biceps.model.participant.AbstractMetricState 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 java.time.Duration;
import java.util.ArrayList;
import java.util.List;
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 jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
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;
import org.somda.sdc.common.model.DurationAdapter;
/**
* Abstract state of a METRIC.
*
* Java class for AbstractMetricState complex type
.
*
* The following schema fragment specifies the expected content contained within this class.
*
* {@code
*
*
*
*
*
*
*
*
*
*
*
*
*
* }
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "AbstractMetricState", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/participant", propOrder = {
"bodySite",
"physicalConnector"
})
@XmlSeeAlso({
NumericMetricState.class,
StringMetricState.class,
RealTimeSampleArrayMetricState.class,
DistributionSampleArrayMetricState.class
})
public class AbstractMetricState
extends AbstractState
implements Cloneable, CopyTo, ToString
{
/**
* OPTIONAL list of CODED VALUEs that describe the body sites where the measurement is performed or where the setting is applied to.
* This list of body sites MAY provide more details to location of the measurement or setting that are be available at runtime only or that changes at runtime of the POC MEDICAL DEVICE. It SHOULD NOT contradict the location that has been listed in the descriptor.
*
* Example: if in the descriptor the location "Upper Abdomen" is defined, than the state's body site give more details to where the measurement is performed like "Upper Right Quadrant" and "Liver".
*
*/
@XmlElement(name = "BodySite", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/participant")
protected List bodySite;
/**
* The physical connector number for this METRIC, see pm:PhysicalConnectorInfo.
*
*/
@XmlElement(name = "PhysicalConnector", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/participant")
protected PhysicalConnectorInfo physicalConnector;
/**
* The activation state of a METRIC. The implied value SHALL be "On".
*
*/
@XmlAttribute(name = "ActivationState")
protected ComponentActivation activationState;
/**
* OPTIONAL information of the currently active determination repetition time if it is different from the default determination time that is defined in the descriptive part. ActiveDeterminationPeriod is not necessarily the same as the update period of the periodic event service.
*
*/
@XmlAttribute(name = "ActiveDeterminationPeriod")
@XmlJavaTypeAdapter(DurationAdapter.class)
@XmlSchemaType(name = "duration")
protected Duration activeDeterminationPeriod;
/**
* OPTIONAL currently active life-time period that supersedes pm:AbstractMetricDescriptor/@LifeTimePeriod.
*
*/
@XmlAttribute(name = "LifeTimePeriod")
@XmlJavaTypeAdapter(DurationAdapter.class)
@XmlSchemaType(name = "duration")
protected Duration lifeTimePeriod;
/**
* OPTIONAL list of CODED VALUEs that describe the body sites where the measurement is performed or where the setting is applied to.
* This list of body sites MAY provide more details to location of the measurement or setting that are be available at runtime only or that changes at runtime of the POC MEDICAL DEVICE. It SHOULD NOT contradict the location that has been listed in the descriptor.
*
* Example: if in the descriptor the location "Upper Abdomen" is defined, than the state's body site give more details to where the measurement is performed like "Upper Right Quadrant" and "Liver".
*
* Gets the value of the bodySite property.
*
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a set
method for the bodySite property.
*
*
* For example, to add a new item, do as follows:
*
*
* getBodySite().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link CodedValue }
*
*
*
* @return
* The value of the bodySite property.
*/
public List getBodySite() {
if (bodySite == null) {
bodySite = new ArrayList<>();
}
return this.bodySite;
}
/**
* The physical connector number for this METRIC, 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;
}
/**
* The activation state of a METRIC. 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 information of the currently active determination repetition time if it is different from the default determination time that is defined in the descriptive part. ActiveDeterminationPeriod is not necessarily the same as the update period of the periodic event service.
*
* @return
* possible object is
* {@link String }
*
*/
@Nullable
public Duration getActiveDeterminationPeriod() {
return activeDeterminationPeriod;
}
/**
* Sets the value of the activeDeterminationPeriod property.
*
* @param value
* allowed object is
* {@link String }
*
* @see #getActiveDeterminationPeriod()
*/
public void setActiveDeterminationPeriod(
@Nullable
Duration value) {
this.activeDeterminationPeriod = value;
}
/**
* OPTIONAL currently active life-time period that supersedes pm:AbstractMetricDescriptor/@LifeTimePeriod.
*
* @return
* possible object is
* {@link String }
*
*/
@Nullable
public Duration getLifeTimePeriod() {
return lifeTimePeriod;
}
/**
* Sets the value of the lifeTimePeriod property.
*
* @param value
* allowed object is
* {@link String }
*
* @see #getLifeTimePeriod()
*/
public void setLifeTimePeriod(
@Nullable
Duration value) {
this.lifeTimePeriod = value;
}
public void setBodySite(
@Nullable
List value) {
this.bodySite = null;
if (value!= null) {
List draftl = this.getBodySite();
draftl.addAll(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 AbstractMetricState that = ((AbstractMetricState) object);
{
List leftBodySite;
leftBodySite = (((this.bodySite!= null)&&(!this.bodySite.isEmpty()))?this.getBodySite():null);
List rightBodySite;
rightBodySite = (((that.bodySite!= null)&&(!that.bodySite.isEmpty()))?that.getBodySite():null);
if ((this.bodySite!= null)&&(!this.bodySite.isEmpty())) {
if ((that.bodySite!= null)&&(!that.bodySite.isEmpty())) {
if (!leftBodySite.equals(rightBodySite)) {
return false;
}
} else {
return false;
}
} else {
if ((that.bodySite!= null)&&(!that.bodySite.isEmpty())) {
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;
}
}
}
{
Duration leftActiveDeterminationPeriod;
leftActiveDeterminationPeriod = this.getActiveDeterminationPeriod();
Duration rightActiveDeterminationPeriod;
rightActiveDeterminationPeriod = that.getActiveDeterminationPeriod();
if (this.activeDeterminationPeriod!= null) {
if (that.activeDeterminationPeriod!= null) {
if (!leftActiveDeterminationPeriod.equals(rightActiveDeterminationPeriod)) {
return false;
}
} else {
return false;
}
} else {
if (that.activeDeterminationPeriod!= null) {
return false;
}
}
}
{
Duration leftLifeTimePeriod;
leftLifeTimePeriod = this.getLifeTimePeriod();
Duration rightLifeTimePeriod;
rightLifeTimePeriod = that.getLifeTimePeriod();
if (this.lifeTimePeriod!= null) {
if (that.lifeTimePeriod!= null) {
if (!leftLifeTimePeriod.equals(rightLifeTimePeriod)) {
return false;
}
} else {
return false;
}
} else {
if (that.lifeTimePeriod!= null) {
return false;
}
}
}
return true;
}
@Override
public int hashCode() {
int currentHashCode = 1;
currentHashCode = ((currentHashCode* 31)+ super.hashCode());
{
currentHashCode = (currentHashCode* 31);
List theBodySite;
theBodySite = (((this.bodySite!= null)&&(!this.bodySite.isEmpty()))?this.getBodySite():null);
if ((this.bodySite!= null)&&(!this.bodySite.isEmpty())) {
currentHashCode += theBodySite.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);
Duration theActiveDeterminationPeriod;
theActiveDeterminationPeriod = this.getActiveDeterminationPeriod();
if (this.activeDeterminationPeriod!= null) {
currentHashCode += theActiveDeterminationPeriod.hashCode();
}
}
{
currentHashCode = (currentHashCode* 31);
Duration theLifeTimePeriod;
theLifeTimePeriod = this.getLifeTimePeriod();
if (this.lifeTimePeriod!= null) {
currentHashCode += theLifeTimePeriod.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);
{
List theBodySite;
theBodySite = (((this.bodySite!= null)&&(!this.bodySite.isEmpty()))?this.getBodySite():null);
strategy.appendField(locator, this, "bodySite", buffer, theBodySite, ((this.bodySite!= null)&&(!this.bodySite.isEmpty())));
}
{
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));
}
{
Duration theActiveDeterminationPeriod;
theActiveDeterminationPeriod = this.getActiveDeterminationPeriod();
strategy.appendField(locator, this, "activeDeterminationPeriod", buffer, theActiveDeterminationPeriod, (this.activeDeterminationPeriod!= null));
}
{
Duration theLifeTimePeriod;
theLifeTimePeriod = this.getLifeTimePeriod();
strategy.appendField(locator, this, "lifeTimePeriod", buffer, theLifeTimePeriod, (this.lifeTimePeriod!= 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 AbstractMetricState) {
final AbstractMetricState copy = ((AbstractMetricState) draftCopy);
{
Boolean bodySiteShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, ((this.bodySite!= null)&&(!this.bodySite.isEmpty())));
if (bodySiteShouldBeCopiedAndSet == Boolean.TRUE) {
List sourceBodySite;
sourceBodySite = (((this.bodySite!= null)&&(!this.bodySite.isEmpty()))?this.getBodySite():null);
@SuppressWarnings("unchecked")
List copyBodySite = ((List ) strategy.copy(LocatorUtils.property(locator, "bodySite", sourceBodySite), sourceBodySite, ((this.bodySite!= null)&&(!this.bodySite.isEmpty()))));
copy.setBodySite(copyBodySite);
} else {
if (bodySiteShouldBeCopiedAndSet == Boolean.FALSE) {
copy.bodySite = 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 activeDeterminationPeriodShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.activeDeterminationPeriod!= null));
if (activeDeterminationPeriodShouldBeCopiedAndSet == Boolean.TRUE) {
Duration sourceActiveDeterminationPeriod;
sourceActiveDeterminationPeriod = this.getActiveDeterminationPeriod();
Duration copyActiveDeterminationPeriod = ((Duration) strategy.copy(LocatorUtils.property(locator, "activeDeterminationPeriod", sourceActiveDeterminationPeriod), sourceActiveDeterminationPeriod, (this.activeDeterminationPeriod!= null)));
copy.setActiveDeterminationPeriod(copyActiveDeterminationPeriod);
} else {
if (activeDeterminationPeriodShouldBeCopiedAndSet == Boolean.FALSE) {
copy.activeDeterminationPeriod = null;
}
}
}
{
Boolean lifeTimePeriodShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.lifeTimePeriod!= null));
if (lifeTimePeriodShouldBeCopiedAndSet == Boolean.TRUE) {
Duration sourceLifeTimePeriod;
sourceLifeTimePeriod = this.getLifeTimePeriod();
Duration copyLifeTimePeriod = ((Duration) strategy.copy(LocatorUtils.property(locator, "lifeTimePeriod", sourceLifeTimePeriod), sourceLifeTimePeriod, (this.lifeTimePeriod!= null)));
copy.setLifeTimePeriod(copyLifeTimePeriod);
} else {
if (lifeTimePeriodShouldBeCopiedAndSet == Boolean.FALSE) {
copy.lifeTimePeriod = null;
}
}
}
}
return draftCopy;
}
@Override
public Object createNewInstance() {
return new AbstractMetricState();
}
}