org.somda.sdc.biceps.model.message.AbstractSet 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 jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlSeeAlso;
import jakarta.xml.bind.annotation.XmlType;
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 SET SERVICE provides a set of request and response MESSAGEs. AbstractSet is the building block for any SET SERVICE request MESSAGE.
*
* Java class for AbstractSet complex type
.
*
* The following schema fragment specifies the expected content contained within this class.
*
* {@code
*
*
*
*
*
*
*
*
*
*
* }
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "AbstractSet", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/message", propOrder = {
"extension",
"operationHandleRef"
})
@XmlSeeAlso({
SetMetricState.class,
SetComponentState.class,
SetAlertState.class,
Activate.class,
SetString.class,
SetValue.class,
SetContextState.class
})
public class AbstractSet implements Cloneable, CopyTo, ToString
{
@XmlElement(name = "Extension", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/extension")
protected ExtensionType extension;
/**
* Handle of the set operation to invoke.
*
* A SERVICE PROVIDER SHALL accept a set request only if at least the operation target HANDLE is valid and the operation is enabled according to the POC MEDICAL DEVICE's MDIB. A target HANDLE is valid if the operation to invoke can be applied on the object referenced by the target HANDLE. An operation can be considered as enabled if pm:AbstractOperationStateType/@OperatingMode equals "En".
*
*/
@XmlElement(name = "OperationHandleRef", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/message", required = true)
protected String operationHandleRef;
/**
* 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;
}
/**
* Handle of the set operation to invoke.
*
* A SERVICE PROVIDER SHALL accept a set request only if at least the operation target HANDLE is valid and the operation is enabled according to the POC MEDICAL DEVICE's MDIB. A target HANDLE is valid if the operation to invoke can be applied on the object referenced by the target HANDLE. An operation can be considered as enabled if pm:AbstractOperationStateType/@OperatingMode equals "En".
*
* @return
* possible object is
* {@link String }
*
*/
public String getOperationHandleRef() {
return operationHandleRef;
}
/**
* Sets the value of the operationHandleRef property.
*
* @param value
* allowed object is
* {@link String }
*
* @see #getOperationHandleRef()
*/
public void setOperationHandleRef(String value) {
this.operationHandleRef = value;
}
@Override
public boolean equals(Object object) {
if ((object == null)||(this.getClass()!= object.getClass())) {
return false;
}
if (this == object) {
return true;
}
final AbstractSet that = ((AbstractSet) 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;
}
}
}
{
String leftOperationHandleRef;
leftOperationHandleRef = this.getOperationHandleRef();
String rightOperationHandleRef;
rightOperationHandleRef = that.getOperationHandleRef();
if (this.operationHandleRef!= null) {
if (that.operationHandleRef!= null) {
if (!leftOperationHandleRef.equals(rightOperationHandleRef)) {
return false;
}
} else {
return false;
}
} else {
if (that.operationHandleRef!= 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);
String theOperationHandleRef;
theOperationHandleRef = this.getOperationHandleRef();
if (this.operationHandleRef!= null) {
currentHashCode += theOperationHandleRef.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));
}
{
String theOperationHandleRef;
theOperationHandleRef = this.getOperationHandleRef();
strategy.appendField(locator, this, "operationHandleRef", buffer, theOperationHandleRef, (this.operationHandleRef!= 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 AbstractSet) {
final AbstractSet copy = ((AbstractSet) 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 operationHandleRefShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.operationHandleRef!= null));
if (operationHandleRefShouldBeCopiedAndSet == Boolean.TRUE) {
String sourceOperationHandleRef;
sourceOperationHandleRef = this.getOperationHandleRef();
String copyOperationHandleRef = ((String) strategy.copy(LocatorUtils.property(locator, "operationHandleRef", sourceOperationHandleRef), sourceOperationHandleRef, (this.operationHandleRef!= null)));
copy.setOperationHandleRef(copyOperationHandleRef);
} else {
if (operationHandleRefShouldBeCopiedAndSet == Boolean.FALSE) {
copy.operationHandleRef = null;
}
}
}
}
return draftCopy;
}
@Override
public Object createNewInstance() {
return new AbstractSet();
}
}