org.somda.sdc.biceps.model.participant.Measurement 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.math.BigDecimal;
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.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;
import org.somda.sdc.biceps.model.extension.ExtensionType;
/**
* Measurement describes a measurement and is used only for stateful object attributes that do not have a reference to a descriptor object.
*
* Example: Weight of a patient.
*
* Java class for Measurement complex type
.
*
* The following schema fragment specifies the expected content contained within this class.
*
* {@code
*
*
*
*
*
*
*
*
*
*
*
* }
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Measurement", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/participant", propOrder = {
"extension",
"measurementUnit"
})
public class Measurement implements Cloneable, CopyTo, ToString
{
@XmlElement(name = "Extension", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/extension")
protected ExtensionType extension;
/**
* The unit (dimension) of pm:Measurement.
*
*/
@XmlElement(name = "MeasurementUnit", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/participant", required = true)
protected CodedValue measurementUnit;
/**
* The value of pm:Measurement.
*
*/
@XmlAttribute(name = "MeasuredValue", required = true)
protected BigDecimal measuredValue;
/**
* Gets the value of the extension property.
*
* @return
* possible object is
* {@link ExtensionType }
*
*/
@Nullable
public ExtensionType getExtension() {
return extension;
}
/**
* Sets the value of the extension property.
*
* @param value
* allowed object is
* {@link ExtensionType }
*
*/
public void setExtension(
@Nullable
ExtensionType value) {
this.extension = value;
}
/**
* The unit (dimension) of pm:Measurement.
*
* @return
* possible object is
* {@link CodedValue }
*
*/
public CodedValue getMeasurementUnit() {
return measurementUnit;
}
/**
* Sets the value of the measurementUnit property.
*
* @param value
* allowed object is
* {@link CodedValue }
*
* @see #getMeasurementUnit()
*/
public void setMeasurementUnit(CodedValue value) {
this.measurementUnit = value;
}
/**
* The value of pm:Measurement.
*
* @return
* possible object is
* {@link BigDecimal }
*
*/
public BigDecimal getMeasuredValue() {
return measuredValue;
}
/**
* Sets the value of the measuredValue property.
*
* @param value
* allowed object is
* {@link BigDecimal }
*
* @see #getMeasuredValue()
*/
public void setMeasuredValue(BigDecimal value) {
this.measuredValue = value;
}
@Override
public boolean equals(Object object) {
if ((object == null)||(this.getClass()!= object.getClass())) {
return false;
}
if (this == object) {
return true;
}
final Measurement that = ((Measurement) object);
{
ExtensionType leftExtension;
leftExtension = this.getExtension();
ExtensionType rightExtension;
rightExtension = that.getExtension();
if (this.extension!= null) {
if (that.extension!= null) {
if (!leftExtension.equals(rightExtension)) {
return false;
}
} else {
return false;
}
} else {
if (that.extension!= null) {
return false;
}
}
}
{
CodedValue leftMeasurementUnit;
leftMeasurementUnit = this.getMeasurementUnit();
CodedValue rightMeasurementUnit;
rightMeasurementUnit = that.getMeasurementUnit();
if (this.measurementUnit!= null) {
if (that.measurementUnit!= null) {
if (!leftMeasurementUnit.equals(rightMeasurementUnit)) {
return false;
}
} else {
return false;
}
} else {
if (that.measurementUnit!= null) {
return false;
}
}
}
{
BigDecimal leftMeasuredValue;
leftMeasuredValue = this.getMeasuredValue();
BigDecimal rightMeasuredValue;
rightMeasuredValue = that.getMeasuredValue();
if (this.measuredValue!= null) {
if (that.measuredValue!= null) {
if (!leftMeasuredValue.equals(rightMeasuredValue)) {
return false;
}
} else {
return false;
}
} else {
if (that.measuredValue!= null) {
return false;
}
}
}
return true;
}
@Override
public int hashCode() {
int currentHashCode = 1;
{
currentHashCode = (currentHashCode* 31);
ExtensionType theExtension;
theExtension = this.getExtension();
if (this.extension!= null) {
currentHashCode += theExtension.hashCode();
}
}
{
currentHashCode = (currentHashCode* 31);
CodedValue theMeasurementUnit;
theMeasurementUnit = this.getMeasurementUnit();
if (this.measurementUnit!= null) {
currentHashCode += theMeasurementUnit.hashCode();
}
}
{
currentHashCode = (currentHashCode* 31);
BigDecimal theMeasuredValue;
theMeasuredValue = this.getMeasuredValue();
if (this.measuredValue!= null) {
currentHashCode += theMeasuredValue.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) {
{
ExtensionType theExtension;
theExtension = this.getExtension();
strategy.appendField(locator, this, "extension", buffer, theExtension, (this.extension!= null));
}
{
CodedValue theMeasurementUnit;
theMeasurementUnit = this.getMeasurementUnit();
strategy.appendField(locator, this, "measurementUnit", buffer, theMeasurementUnit, (this.measurementUnit!= null));
}
{
BigDecimal theMeasuredValue;
theMeasuredValue = this.getMeasuredValue();
strategy.appendField(locator, this, "measuredValue", buffer, theMeasuredValue, (this.measuredValue!= 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);
if (draftCopy instanceof Measurement) {
final Measurement copy = ((Measurement) draftCopy);
{
Boolean extensionShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.extension!= null));
if (extensionShouldBeCopiedAndSet == Boolean.TRUE) {
ExtensionType sourceExtension;
sourceExtension = this.getExtension();
ExtensionType copyExtension = ((ExtensionType) strategy.copy(LocatorUtils.property(locator, "extension", sourceExtension), sourceExtension, (this.extension!= null)));
copy.setExtension(copyExtension);
} else {
if (extensionShouldBeCopiedAndSet == Boolean.FALSE) {
copy.extension = null;
}
}
}
{
Boolean measurementUnitShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.measurementUnit!= null));
if (measurementUnitShouldBeCopiedAndSet == Boolean.TRUE) {
CodedValue sourceMeasurementUnit;
sourceMeasurementUnit = this.getMeasurementUnit();
CodedValue copyMeasurementUnit = ((CodedValue) strategy.copy(LocatorUtils.property(locator, "measurementUnit", sourceMeasurementUnit), sourceMeasurementUnit, (this.measurementUnit!= null)));
copy.setMeasurementUnit(copyMeasurementUnit);
} else {
if (measurementUnitShouldBeCopiedAndSet == Boolean.FALSE) {
copy.measurementUnit = null;
}
}
}
{
Boolean measuredValueShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.measuredValue!= null));
if (measuredValueShouldBeCopiedAndSet == Boolean.TRUE) {
BigDecimal sourceMeasuredValue;
sourceMeasuredValue = this.getMeasuredValue();
BigDecimal copyMeasuredValue = ((BigDecimal) strategy.copy(LocatorUtils.property(locator, "measuredValue", sourceMeasuredValue), sourceMeasuredValue, (this.measuredValue!= null)));
copy.setMeasuredValue(copyMeasuredValue);
} else {
if (measuredValueShouldBeCopiedAndSet == Boolean.FALSE) {
copy.measuredValue = null;
}
}
}
}
return draftCopy;
}
@Override
public Object createNewInstance() {
return new Measurement();
}
}