org.somda.sdc.biceps.model.message.AbstractGetResponse 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.message;
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.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;
import org.somda.sdc.biceps.model.extension.ExtensionType;
/**
* The GET SERVICE provides a set of request and response MESSAGEs. AbstractGetResponse is the building block for any GET SERVICE response MESSAGE.
*
* Per convention any response MESSAGE ends up with "Response", whereas request MESSAGEs possess no specific suffix.
*
* Java class for AbstractGetResponse complex type
.
*
* The following schema fragment specifies the expected content contained within this class.
*
* {@code
*
*
*
*
*
*
*
*
*
*
* }
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "AbstractGetResponse", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/message", propOrder = {
"extension"
})
@XmlSeeAlso({
GetDescriptorResponse.class,
GetContainmentTreeResponse.class,
GetStatesFromArchiveResponse.class,
GetDescriptorsFromArchiveResponse.class,
GetSupportedLanguagesResponse.class,
GetLocalizedTextResponse.class,
GetContextStatesByFilterResponse.class,
GetContextStatesByIdentificationResponse.class,
GetContextStatesResponse.class,
GetMdStateResponse.class,
GetMdDescriptionResponse.class,
GetMdibResponse.class
})
public class AbstractGetResponse implements Cloneable, CopyTo, ToString
{
@XmlElement(name = "Extension", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/extension")
protected ExtensionType extension;
/**
* 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 }
*
*/
public ExtensionType getExtension() {
return extension;
}
/**
* Sets the value of the extension property.
*
* @param value
* allowed object is
* {@link ExtensionType }
*
*/
public void setExtension(ExtensionType value) {
this.extension = 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 AbstractGetResponse that = ((AbstractGetResponse) 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;
}
}
}
{
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);
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));
}
{
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 AbstractGetResponse) {
final AbstractGetResponse copy = ((AbstractGetResponse) 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 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 AbstractGetResponse();
}
}