org.somda.sdc.biceps.model.participant.Mdib 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.BigInteger;
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.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;
/**
* Root object that comprises the capability description of the represented MDSs in pm:MdDescription (descriptive part) as well as the current state in pm:MdState (state part).
*
* Java class for Mdib complex type
.
*
* The following schema fragment specifies the expected content contained within this class.
*
* {@code
*
*
*
*
*
*
*
*
*
*
*
*
* }
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Mdib", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/participant", propOrder = {
"extension",
"mdDescription",
"mdState"
})
public class Mdib implements Cloneable, CopyTo, ToString
{
@XmlElement(name = "Extension", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/extension")
protected ExtensionType extension;
@XmlElement(name = "MdDescription", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/participant")
protected MdDescription mdDescription;
@XmlElement(name = "MdState", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/participant")
protected MdState mdState;
/**
* The unique change version number of the MDIB. The implied value of the initial version SHALL be "0".
*
*/
@XmlAttribute(name = "MdibVersion")
protected BigInteger mdibVersion;
/**
* SequenceId identifies a sequence within the context of ./@InstanceId.
*
* __R5029: SequenceId SHALL be compared per RFC 3986 Section 6.2.1 Simple String Comparison [RFC3986].__
*
*/
@XmlAttribute(name = "SequenceId", required = true)
@XmlSchemaType(name = "anyURI")
protected String sequenceId;
/**
* Value that indicates an instantiation counter.
*
* __R5004: If InstanceId is used, it SHALL be incremented by a positive value (>= 1) when the SequenceId has changed.__
*
* NOTE—This occurs each time the POC MEDICAL DEVICE has gone down, lost state, and came back up again.
*
* __R5005: InstanceId SHOULD NOT be incremented otherwise than defined in R5004.__
*
* NOTE 1—Means to set this value include, but are not limited to:
*
* - A counter that is incremented on each cold boot
* - The boot time of the POC MEDICAL DEVICE, expressed as seconds elapsed since midnight January 1, 1970
*
* NOTE 2—The MDIB version's instance id is different to the pm:InstanceIdentifier data type.
*
*/
@XmlAttribute(name = "InstanceId")
@XmlSchemaType(name = "unsignedLong")
protected BigInteger instanceId;
/**
* 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;
}
/**
* Gets the value of the mdDescription property.
*
* @return
* possible object is
* {@link MdDescription }
*
*/
@Nullable
public MdDescription getMdDescription() {
return mdDescription;
}
/**
* Sets the value of the mdDescription property.
*
* @param value
* allowed object is
* {@link MdDescription }
*
*/
public void setMdDescription(
@Nullable
MdDescription value) {
this.mdDescription = value;
}
/**
* Gets the value of the mdState property.
*
* @return
* possible object is
* {@link MdState }
*
*/
@Nullable
public MdState getMdState() {
return mdState;
}
/**
* Sets the value of the mdState property.
*
* @param value
* allowed object is
* {@link MdState }
*
*/
public void setMdState(
@Nullable
MdState value) {
this.mdState = value;
}
/**
* The unique change version number of the MDIB. The implied value of the initial version SHALL be "0".
*
* @return
* possible object is
* {@link BigInteger }
*
*/
@Nullable
public BigInteger getMdibVersion() {
return mdibVersion;
}
/**
* Sets the value of the mdibVersion property.
*
* @param value
* allowed object is
* {@link BigInteger }
*
* @see #getMdibVersion()
*/
public void setMdibVersion(
@Nullable
BigInteger value) {
this.mdibVersion = value;
}
/**
* SequenceId identifies a sequence within the context of ./@InstanceId.
*
* __R5029: SequenceId SHALL be compared per RFC 3986 Section 6.2.1 Simple String Comparison [RFC3986].__
*
* @return
* possible object is
* {@link String }
*
*/
public String getSequenceId() {
return sequenceId;
}
/**
* Sets the value of the sequenceId property.
*
* @param value
* allowed object is
* {@link String }
*
* @see #getSequenceId()
*/
public void setSequenceId(String value) {
this.sequenceId = value;
}
/**
* Value that indicates an instantiation counter.
*
* __R5004: If InstanceId is used, it SHALL be incremented by a positive value (>= 1) when the SequenceId has changed.__
*
* NOTE—This occurs each time the POC MEDICAL DEVICE has gone down, lost state, and came back up again.
*
* __R5005: InstanceId SHOULD NOT be incremented otherwise than defined in R5004.__
*
* NOTE 1—Means to set this value include, but are not limited to:
*
* - A counter that is incremented on each cold boot
* - The boot time of the POC MEDICAL DEVICE, expressed as seconds elapsed since midnight January 1, 1970
*
* NOTE 2—The MDIB version's instance id is different to the pm:InstanceIdentifier data type.
*
* @return
* possible object is
* {@link BigInteger }
*
*/
@Nullable
public BigInteger getInstanceId() {
return instanceId;
}
/**
* Sets the value of the instanceId property.
*
* @param value
* allowed object is
* {@link BigInteger }
*
* @see #getInstanceId()
*/
public void setInstanceId(
@Nullable
BigInteger value) {
this.instanceId = value;
}
@Override
public boolean equals(Object object) {
if ((object == null)||(this.getClass()!= object.getClass())) {
return false;
}
if (this == object) {
return true;
}
final Mdib that = ((Mdib) 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;
}
}
}
{
MdDescription leftMdDescription;
leftMdDescription = this.getMdDescription();
MdDescription rightMdDescription;
rightMdDescription = that.getMdDescription();
if (this.mdDescription!= null) {
if (that.mdDescription!= null) {
if (!leftMdDescription.equals(rightMdDescription)) {
return false;
}
} else {
return false;
}
} else {
if (that.mdDescription!= null) {
return false;
}
}
}
{
MdState leftMdState;
leftMdState = this.getMdState();
MdState rightMdState;
rightMdState = that.getMdState();
if (this.mdState!= null) {
if (that.mdState!= null) {
if (!leftMdState.equals(rightMdState)) {
return false;
}
} else {
return false;
}
} else {
if (that.mdState!= null) {
return false;
}
}
}
{
BigInteger leftMdibVersion;
leftMdibVersion = this.getMdibVersion();
BigInteger rightMdibVersion;
rightMdibVersion = that.getMdibVersion();
if (this.mdibVersion!= null) {
if (that.mdibVersion!= null) {
if (!leftMdibVersion.equals(rightMdibVersion)) {
return false;
}
} else {
return false;
}
} else {
if (that.mdibVersion!= null) {
return false;
}
}
}
{
String leftSequenceId;
leftSequenceId = this.getSequenceId();
String rightSequenceId;
rightSequenceId = that.getSequenceId();
if (this.sequenceId!= null) {
if (that.sequenceId!= null) {
if (!leftSequenceId.equals(rightSequenceId)) {
return false;
}
} else {
return false;
}
} else {
if (that.sequenceId!= null) {
return false;
}
}
}
{
BigInteger leftInstanceId;
leftInstanceId = this.getInstanceId();
BigInteger rightInstanceId;
rightInstanceId = that.getInstanceId();
if (this.instanceId!= null) {
if (that.instanceId!= null) {
if (!leftInstanceId.equals(rightInstanceId)) {
return false;
}
} else {
return false;
}
} else {
if (that.instanceId!= 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);
MdDescription theMdDescription;
theMdDescription = this.getMdDescription();
if (this.mdDescription!= null) {
currentHashCode += theMdDescription.hashCode();
}
}
{
currentHashCode = (currentHashCode* 31);
MdState theMdState;
theMdState = this.getMdState();
if (this.mdState!= null) {
currentHashCode += theMdState.hashCode();
}
}
{
currentHashCode = (currentHashCode* 31);
BigInteger theMdibVersion;
theMdibVersion = this.getMdibVersion();
if (this.mdibVersion!= null) {
currentHashCode += theMdibVersion.hashCode();
}
}
{
currentHashCode = (currentHashCode* 31);
String theSequenceId;
theSequenceId = this.getSequenceId();
if (this.sequenceId!= null) {
currentHashCode += theSequenceId.hashCode();
}
}
{
currentHashCode = (currentHashCode* 31);
BigInteger theInstanceId;
theInstanceId = this.getInstanceId();
if (this.instanceId!= null) {
currentHashCode += theInstanceId.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));
}
{
MdDescription theMdDescription;
theMdDescription = this.getMdDescription();
strategy.appendField(locator, this, "mdDescription", buffer, theMdDescription, (this.mdDescription!= null));
}
{
MdState theMdState;
theMdState = this.getMdState();
strategy.appendField(locator, this, "mdState", buffer, theMdState, (this.mdState!= null));
}
{
BigInteger theMdibVersion;
theMdibVersion = this.getMdibVersion();
strategy.appendField(locator, this, "mdibVersion", buffer, theMdibVersion, (this.mdibVersion!= null));
}
{
String theSequenceId;
theSequenceId = this.getSequenceId();
strategy.appendField(locator, this, "sequenceId", buffer, theSequenceId, (this.sequenceId!= null));
}
{
BigInteger theInstanceId;
theInstanceId = this.getInstanceId();
strategy.appendField(locator, this, "instanceId", buffer, theInstanceId, (this.instanceId!= 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 Mdib) {
final Mdib copy = ((Mdib) 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 mdDescriptionShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.mdDescription!= null));
if (mdDescriptionShouldBeCopiedAndSet == Boolean.TRUE) {
MdDescription sourceMdDescription;
sourceMdDescription = this.getMdDescription();
MdDescription copyMdDescription = ((MdDescription) strategy.copy(LocatorUtils.property(locator, "mdDescription", sourceMdDescription), sourceMdDescription, (this.mdDescription!= null)));
copy.setMdDescription(copyMdDescription);
} else {
if (mdDescriptionShouldBeCopiedAndSet == Boolean.FALSE) {
copy.mdDescription = null;
}
}
}
{
Boolean mdStateShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.mdState!= null));
if (mdStateShouldBeCopiedAndSet == Boolean.TRUE) {
MdState sourceMdState;
sourceMdState = this.getMdState();
MdState copyMdState = ((MdState) strategy.copy(LocatorUtils.property(locator, "mdState", sourceMdState), sourceMdState, (this.mdState!= null)));
copy.setMdState(copyMdState);
} else {
if (mdStateShouldBeCopiedAndSet == Boolean.FALSE) {
copy.mdState = null;
}
}
}
{
Boolean mdibVersionShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.mdibVersion!= null));
if (mdibVersionShouldBeCopiedAndSet == Boolean.TRUE) {
BigInteger sourceMdibVersion;
sourceMdibVersion = this.getMdibVersion();
BigInteger copyMdibVersion = ((BigInteger) strategy.copy(LocatorUtils.property(locator, "mdibVersion", sourceMdibVersion), sourceMdibVersion, (this.mdibVersion!= null)));
copy.setMdibVersion(copyMdibVersion);
} else {
if (mdibVersionShouldBeCopiedAndSet == Boolean.FALSE) {
copy.mdibVersion = null;
}
}
}
{
Boolean sequenceIdShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.sequenceId!= null));
if (sequenceIdShouldBeCopiedAndSet == Boolean.TRUE) {
String sourceSequenceId;
sourceSequenceId = this.getSequenceId();
String copySequenceId = ((String) strategy.copy(LocatorUtils.property(locator, "sequenceId", sourceSequenceId), sourceSequenceId, (this.sequenceId!= null)));
copy.setSequenceId(copySequenceId);
} else {
if (sequenceIdShouldBeCopiedAndSet == Boolean.FALSE) {
copy.sequenceId = null;
}
}
}
{
Boolean instanceIdShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.instanceId!= null));
if (instanceIdShouldBeCopiedAndSet == Boolean.TRUE) {
BigInteger sourceInstanceId;
sourceInstanceId = this.getInstanceId();
BigInteger copyInstanceId = ((BigInteger) strategy.copy(LocatorUtils.property(locator, "instanceId", sourceInstanceId), sourceInstanceId, (this.instanceId!= null)));
copy.setInstanceId(copyInstanceId);
} else {
if (instanceIdShouldBeCopiedAndSet == Boolean.FALSE) {
copy.instanceId = null;
}
}
}
}
return draftCopy;
}
@Override
public Object createNewInstance() {
return new Mdib();
}
}