org.somda.sdc.biceps.model.participant.AlertConditionState 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.time.Duration;
import java.time.Instant;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlSchemaType;
import jakarta.xml.bind.annotation.XmlSeeAlso;
import jakarta.xml.bind.annotation.XmlType;
import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
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.common.model.DurationAdapter;
import org.somda.sdc.common.model.TimestampAdapter;
/**
* AlertConditionState contains the dynamic/volatile information of an ALERT CONDITION. See pm:AlertConditionDescriptor for static information.
*
* Java class for AlertConditionState complex type
.
*
* The following schema fragment specifies the expected content contained within this class.
*
* {@code
*
*
*
*
*
*
*
*
*
*
*
* }
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "AlertConditionState", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/participant")
@XmlSeeAlso({
LimitAlertConditionState.class
})
public class AlertConditionState
extends AbstractAlertState
implements Cloneable, CopyTo, ToString
{
/**
* ActualConditionGenerationDelay overrides pm:AlertConditionDescriptor/@DefaultConditionGenerationDelay.
*
*/
@XmlAttribute(name = "ActualConditionGenerationDelay")
@XmlJavaTypeAdapter(DurationAdapter.class)
@XmlSchemaType(name = "duration")
protected Duration actualConditionGenerationDelay;
/**
* The current priority of the ALERT CONDITION that has been modified by an escalation or de-escalation process.
*
* NOTE—If this ATTRIBUTE is present in an pm:AlertConditonState ELEMENT, the related pm:AlertConditionDescritptor/pm:Priority ELEMENT MAY NOT reflect the current severity of the potential or actual hazard that exists if this ALERT CONDITION is present.
*
*/
@XmlAttribute(name = "ActualPriority")
protected AlertConditionPriority actualPriority;
/**
* The rank is an optional ATTRIBUTE allowing finer distinction of ALERT CONDITION priorities. A ranking is a relationship between a set of chainSegments such that, for any two chainSegments, the first is either "ranked higher than", "ranked lower than" or "ranked equal to" the second.
*
*/
@XmlAttribute(name = "Rank")
protected Integer rank;
/**
* The Presence ATTRIBUTE is set to "true" if the ALERT CONDITION has been detected and is still present. Otherwise it is set to "false". The implied value SHALL be "false".
*
*/
@XmlAttribute(name = "Presence")
protected Boolean presence;
/**
* Timepoint when the ALERT CONDITION has changed its presence the last time.
*
*/
@XmlAttribute(name = "DeterminationTime")
@XmlJavaTypeAdapter(TimestampAdapter.class)
protected Instant determinationTime;
/**
* ActualConditionGenerationDelay overrides pm:AlertConditionDescriptor/@DefaultConditionGenerationDelay.
*
* @return
* possible object is
* {@link String }
*
*/
@Nullable
public Duration getActualConditionGenerationDelay() {
return actualConditionGenerationDelay;
}
/**
* Sets the value of the actualConditionGenerationDelay property.
*
* @param value
* allowed object is
* {@link String }
*
* @see #getActualConditionGenerationDelay()
*/
public void setActualConditionGenerationDelay(
@Nullable
Duration value) {
this.actualConditionGenerationDelay = value;
}
/**
* The current priority of the ALERT CONDITION that has been modified by an escalation or de-escalation process.
*
* NOTE—If this ATTRIBUTE is present in an pm:AlertConditonState ELEMENT, the related pm:AlertConditionDescritptor/pm:Priority ELEMENT MAY NOT reflect the current severity of the potential or actual hazard that exists if this ALERT CONDITION is present.
*
* @return
* possible object is
* {@link AlertConditionPriority }
*
*/
@Nullable
public AlertConditionPriority getActualPriority() {
return actualPriority;
}
/**
* Sets the value of the actualPriority property.
*
* @param value
* allowed object is
* {@link AlertConditionPriority }
*
* @see #getActualPriority()
*/
public void setActualPriority(
@Nullable
AlertConditionPriority value) {
this.actualPriority = value;
}
/**
* The rank is an optional ATTRIBUTE allowing finer distinction of ALERT CONDITION priorities. A ranking is a relationship between a set of chainSegments such that, for any two chainSegments, the first is either "ranked higher than", "ranked lower than" or "ranked equal to" the second.
*
* @return
* possible object is
* {@link Integer }
*
*/
@Nullable
public Integer getRank() {
return rank;
}
/**
* Sets the value of the rank property.
*
* @param value
* allowed object is
* {@link Integer }
*
* @see #getRank()
*/
public void setRank(
@Nullable
Integer value) {
this.rank = value;
}
/**
* The Presence ATTRIBUTE is set to "true" if the ALERT CONDITION has been detected and is still present. Otherwise it is set to "false". The implied value SHALL be "false".
*
* @return
* possible object is
* {@link Boolean }
*
*/
@Nullable
public Boolean isPresence() {
return presence;
}
/**
* Sets the value of the presence property.
*
* @param value
* allowed object is
* {@link Boolean }
*
* @see #isPresence()
*/
public void setPresence(
@Nullable
Boolean value) {
this.presence = value;
}
/**
* Timepoint when the ALERT CONDITION has changed its presence the last time.
*
* @return
* possible object is
* {@link String }
*
*/
@Nullable
public Instant getDeterminationTime() {
return determinationTime;
}
/**
* Sets the value of the determinationTime property.
*
* @param value
* allowed object is
* {@link String }
*
* @see #getDeterminationTime()
*/
public void setDeterminationTime(
@Nullable
Instant value) {
this.determinationTime = value;
}
@Override
public boolean equals(Object object) {
if ((object == null)||(this.getClass()!= object.getClass())) {
return false;
}
if (this == object) {
return true;
}
if (!super.equals(object)) {
return false;
}
final AlertConditionState that = ((AlertConditionState) object);
{
Duration leftActualConditionGenerationDelay;
leftActualConditionGenerationDelay = this.getActualConditionGenerationDelay();
Duration rightActualConditionGenerationDelay;
rightActualConditionGenerationDelay = that.getActualConditionGenerationDelay();
if (this.actualConditionGenerationDelay!= null) {
if (that.actualConditionGenerationDelay!= null) {
if (!leftActualConditionGenerationDelay.equals(rightActualConditionGenerationDelay)) {
return false;
}
} else {
return false;
}
} else {
if (that.actualConditionGenerationDelay!= null) {
return false;
}
}
}
{
AlertConditionPriority leftActualPriority;
leftActualPriority = this.getActualPriority();
AlertConditionPriority rightActualPriority;
rightActualPriority = that.getActualPriority();
if (this.actualPriority!= null) {
if (that.actualPriority!= null) {
if (!leftActualPriority.equals(rightActualPriority)) {
return false;
}
} else {
return false;
}
} else {
if (that.actualPriority!= null) {
return false;
}
}
}
{
Integer leftRank;
leftRank = this.getRank();
Integer rightRank;
rightRank = that.getRank();
if (this.rank!= null) {
if (that.rank!= null) {
if (!leftRank.equals(rightRank)) {
return false;
}
} else {
return false;
}
} else {
if (that.rank!= null) {
return false;
}
}
}
{
Boolean leftPresence;
leftPresence = this.isPresence();
Boolean rightPresence;
rightPresence = that.isPresence();
if (this.presence!= null) {
if (that.presence!= null) {
if (!leftPresence.equals(rightPresence)) {
return false;
}
} else {
return false;
}
} else {
if (that.presence!= null) {
return false;
}
}
}
{
Instant leftDeterminationTime;
leftDeterminationTime = this.getDeterminationTime();
Instant rightDeterminationTime;
rightDeterminationTime = that.getDeterminationTime();
if (this.determinationTime!= null) {
if (that.determinationTime!= null) {
if (!leftDeterminationTime.equals(rightDeterminationTime)) {
return false;
}
} else {
return false;
}
} else {
if (that.determinationTime!= null) {
return false;
}
}
}
return true;
}
@Override
public int hashCode() {
int currentHashCode = 1;
currentHashCode = ((currentHashCode* 31)+ super.hashCode());
{
currentHashCode = (currentHashCode* 31);
Duration theActualConditionGenerationDelay;
theActualConditionGenerationDelay = this.getActualConditionGenerationDelay();
if (this.actualConditionGenerationDelay!= null) {
currentHashCode += theActualConditionGenerationDelay.hashCode();
}
}
{
currentHashCode = (currentHashCode* 31);
AlertConditionPriority theActualPriority;
theActualPriority = this.getActualPriority();
if (this.actualPriority!= null) {
currentHashCode += theActualPriority.hashCode();
}
}
{
currentHashCode = (currentHashCode* 31);
Integer theRank;
theRank = this.getRank();
if (this.rank!= null) {
currentHashCode += theRank.hashCode();
}
}
{
currentHashCode = (currentHashCode* 31);
Boolean thePresence;
thePresence = this.isPresence();
if (this.presence!= null) {
currentHashCode += thePresence.hashCode();
}
}
{
currentHashCode = (currentHashCode* 31);
Instant theDeterminationTime;
theDeterminationTime = this.getDeterminationTime();
if (this.determinationTime!= null) {
currentHashCode += theDeterminationTime.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) {
super.appendFields(locator, buffer, strategy);
{
Duration theActualConditionGenerationDelay;
theActualConditionGenerationDelay = this.getActualConditionGenerationDelay();
strategy.appendField(locator, this, "actualConditionGenerationDelay", buffer, theActualConditionGenerationDelay, (this.actualConditionGenerationDelay!= null));
}
{
AlertConditionPriority theActualPriority;
theActualPriority = this.getActualPriority();
strategy.appendField(locator, this, "actualPriority", buffer, theActualPriority, (this.actualPriority!= null));
}
{
Integer theRank;
theRank = this.getRank();
strategy.appendField(locator, this, "rank", buffer, theRank, (this.rank!= null));
}
{
Boolean thePresence;
thePresence = this.isPresence();
strategy.appendField(locator, this, "presence", buffer, thePresence, (this.presence!= null));
}
{
Instant theDeterminationTime;
theDeterminationTime = this.getDeterminationTime();
strategy.appendField(locator, this, "determinationTime", buffer, theDeterminationTime, (this.determinationTime!= 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);
super.copyTo(locator, draftCopy, strategy);
if (draftCopy instanceof AlertConditionState) {
final AlertConditionState copy = ((AlertConditionState) draftCopy);
{
Boolean actualConditionGenerationDelayShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.actualConditionGenerationDelay!= null));
if (actualConditionGenerationDelayShouldBeCopiedAndSet == Boolean.TRUE) {
Duration sourceActualConditionGenerationDelay;
sourceActualConditionGenerationDelay = this.getActualConditionGenerationDelay();
Duration copyActualConditionGenerationDelay = ((Duration) strategy.copy(LocatorUtils.property(locator, "actualConditionGenerationDelay", sourceActualConditionGenerationDelay), sourceActualConditionGenerationDelay, (this.actualConditionGenerationDelay!= null)));
copy.setActualConditionGenerationDelay(copyActualConditionGenerationDelay);
} else {
if (actualConditionGenerationDelayShouldBeCopiedAndSet == Boolean.FALSE) {
copy.actualConditionGenerationDelay = null;
}
}
}
{
Boolean actualPriorityShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.actualPriority!= null));
if (actualPriorityShouldBeCopiedAndSet == Boolean.TRUE) {
AlertConditionPriority sourceActualPriority;
sourceActualPriority = this.getActualPriority();
AlertConditionPriority copyActualPriority = ((AlertConditionPriority) strategy.copy(LocatorUtils.property(locator, "actualPriority", sourceActualPriority), sourceActualPriority, (this.actualPriority!= null)));
copy.setActualPriority(copyActualPriority);
} else {
if (actualPriorityShouldBeCopiedAndSet == Boolean.FALSE) {
copy.actualPriority = null;
}
}
}
{
Boolean rankShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.rank!= null));
if (rankShouldBeCopiedAndSet == Boolean.TRUE) {
Integer sourceRank;
sourceRank = this.getRank();
Integer copyRank = ((Integer) strategy.copy(LocatorUtils.property(locator, "rank", sourceRank), sourceRank, (this.rank!= null)));
copy.setRank(copyRank);
} else {
if (rankShouldBeCopiedAndSet == Boolean.FALSE) {
copy.rank = null;
}
}
}
{
Boolean presenceShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.presence!= null));
if (presenceShouldBeCopiedAndSet == Boolean.TRUE) {
Boolean sourcePresence;
sourcePresence = this.isPresence();
Boolean copyPresence = ((Boolean) strategy.copy(LocatorUtils.property(locator, "presence", sourcePresence), sourcePresence, (this.presence!= null)));
copy.setPresence(copyPresence);
} else {
if (presenceShouldBeCopiedAndSet == Boolean.FALSE) {
copy.presence = null;
}
}
}
{
Boolean determinationTimeShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.determinationTime!= null));
if (determinationTimeShouldBeCopiedAndSet == Boolean.TRUE) {
Instant sourceDeterminationTime;
sourceDeterminationTime = this.getDeterminationTime();
Instant copyDeterminationTime = ((Instant) strategy.copy(LocatorUtils.property(locator, "determinationTime", sourceDeterminationTime), sourceDeterminationTime, (this.determinationTime!= null)));
copy.setDeterminationTime(copyDeterminationTime);
} else {
if (determinationTimeShouldBeCopiedAndSet == Boolean.FALSE) {
copy.determinationTime = null;
}
}
}
}
return draftCopy;
}
@Override
public Object createNewInstance() {
return new AlertConditionState();
}
}