org.somda.sdc.biceps.model.participant.CauseInfo 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.util.ArrayList;
import java.util.List;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
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;
/**
* Cause information for an ALERT CONDITION.
*
* Java class for CauseInfo complex type
.
*
* The following schema fragment specifies the expected content contained within this class.
*
* {@code
*
*
*
*
*
*
*
*
*
*
*
* }
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CauseInfo", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/participant", propOrder = {
"extension",
"remedyInfo",
"description"
})
public class CauseInfo implements Cloneable, CopyTo, ToString
{
@XmlElement(name = "Extension", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/extension")
protected ExtensionType extension;
/**
* OPTIONAL information on how to remedy the ALERT CONDITION.
*
*/
@XmlElement(name = "RemedyInfo", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/participant")
protected RemedyInfo remedyInfo;
/**
* OPTIONAL human-readable texts that describe the cause.
*
*/
@XmlElement(name = "Description", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/participant")
protected List description;
/**
* 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;
}
/**
* OPTIONAL information on how to remedy the ALERT CONDITION.
*
* @return
* possible object is
* {@link RemedyInfo }
*
*/
@Nullable
public RemedyInfo getRemedyInfo() {
return remedyInfo;
}
/**
* Sets the value of the remedyInfo property.
*
* @param value
* allowed object is
* {@link RemedyInfo }
*
* @see #getRemedyInfo()
*/
public void setRemedyInfo(
@Nullable
RemedyInfo value) {
this.remedyInfo = value;
}
/**
* OPTIONAL human-readable texts that describe the cause.
*
* Gets the value of the description 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 description property.
*
*
* For example, to add a new item, do as follows:
*
*
* getDescription().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link LocalizedText }
*
*
*
* @return
* The value of the description property.
*/
public List getDescription() {
if (description == null) {
description = new ArrayList<>();
}
return this.description;
}
public void setDescription(
@Nullable
List value) {
this.description = null;
if (value!= null) {
List draftl = this.getDescription();
draftl.addAll(value);
}
}
@Override
public boolean equals(Object object) {
if ((object == null)||(this.getClass()!= object.getClass())) {
return false;
}
if (this == object) {
return true;
}
final CauseInfo that = ((CauseInfo) 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;
}
}
}
{
RemedyInfo leftRemedyInfo;
leftRemedyInfo = this.getRemedyInfo();
RemedyInfo rightRemedyInfo;
rightRemedyInfo = that.getRemedyInfo();
if (this.remedyInfo!= null) {
if (that.remedyInfo!= null) {
if (!leftRemedyInfo.equals(rightRemedyInfo)) {
return false;
}
} else {
return false;
}
} else {
if (that.remedyInfo!= null) {
return false;
}
}
}
{
List leftDescription;
leftDescription = (((this.description!= null)&&(!this.description.isEmpty()))?this.getDescription():null);
List rightDescription;
rightDescription = (((that.description!= null)&&(!that.description.isEmpty()))?that.getDescription():null);
if ((this.description!= null)&&(!this.description.isEmpty())) {
if ((that.description!= null)&&(!that.description.isEmpty())) {
if (!leftDescription.equals(rightDescription)) {
return false;
}
} else {
return false;
}
} else {
if ((that.description!= null)&&(!that.description.isEmpty())) {
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);
RemedyInfo theRemedyInfo;
theRemedyInfo = this.getRemedyInfo();
if (this.remedyInfo!= null) {
currentHashCode += theRemedyInfo.hashCode();
}
}
{
currentHashCode = (currentHashCode* 31);
List theDescription;
theDescription = (((this.description!= null)&&(!this.description.isEmpty()))?this.getDescription():null);
if ((this.description!= null)&&(!this.description.isEmpty())) {
currentHashCode += theDescription.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));
}
{
RemedyInfo theRemedyInfo;
theRemedyInfo = this.getRemedyInfo();
strategy.appendField(locator, this, "remedyInfo", buffer, theRemedyInfo, (this.remedyInfo!= null));
}
{
List theDescription;
theDescription = (((this.description!= null)&&(!this.description.isEmpty()))?this.getDescription():null);
strategy.appendField(locator, this, "description", buffer, theDescription, ((this.description!= null)&&(!this.description.isEmpty())));
}
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 CauseInfo) {
final CauseInfo copy = ((CauseInfo) 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 remedyInfoShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.remedyInfo!= null));
if (remedyInfoShouldBeCopiedAndSet == Boolean.TRUE) {
RemedyInfo sourceRemedyInfo;
sourceRemedyInfo = this.getRemedyInfo();
RemedyInfo copyRemedyInfo = ((RemedyInfo) strategy.copy(LocatorUtils.property(locator, "remedyInfo", sourceRemedyInfo), sourceRemedyInfo, (this.remedyInfo!= null)));
copy.setRemedyInfo(copyRemedyInfo);
} else {
if (remedyInfoShouldBeCopiedAndSet == Boolean.FALSE) {
copy.remedyInfo = null;
}
}
}
{
Boolean descriptionShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, ((this.description!= null)&&(!this.description.isEmpty())));
if (descriptionShouldBeCopiedAndSet == Boolean.TRUE) {
List sourceDescription;
sourceDescription = (((this.description!= null)&&(!this.description.isEmpty()))?this.getDescription():null);
@SuppressWarnings("unchecked")
List copyDescription = ((List ) strategy.copy(LocatorUtils.property(locator, "description", sourceDescription), sourceDescription, ((this.description!= null)&&(!this.description.isEmpty()))));
copy.setDescription(copyDescription);
} else {
if (descriptionShouldBeCopiedAndSet == Boolean.FALSE) {
copy.description = null;
}
}
}
}
return draftCopy;
}
@Override
public Object createNewInstance() {
return new CauseInfo();
}
}