org.somda.sdc.biceps.model.participant.AlertSignalState 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 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.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;
/**
* AlertSignalState contains the dynamic/volatile information of an ALERT SIGNAL. See pm:AlertSignalDescriptor for static information.
*
* Java class for AlertSignalState complex type
.
*
* The following schema fragment specifies the expected content contained within this class.
*
* {@code
*
*
*
*
*
*
*
*
*
*
* }
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "AlertSignalState", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/participant")
public class AlertSignalState
extends AbstractAlertState
implements Cloneable, CopyTo, ToString
{
/**
* ActualSignalGenerationDelay overrides pm:AlertSignalDescriptor/@DefaultSignalGenerationDelay.
*
*/
@XmlAttribute(name = "ActualSignalGenerationDelay")
@XmlJavaTypeAdapter(DurationAdapter.class)
@XmlSchemaType(name = "duration")
protected Duration actualSignalGenerationDelay;
/**
* See pm:AlertSignalPresence. The implied value SHALL be "Off".
*
*/
@XmlAttribute(name = "Presence")
protected AlertSignalPresence presence;
/**
* See pm:AlertSignalPrimaryLocation. The implied value SHALL be "Loc".
*
*/
@XmlAttribute(name = "Location")
protected AlertSignalPrimaryLocation location;
/**
* The slot is a 0-based index that allows a prioritization of the ALERT SIGNAL w.r.t. signal tangibility. The Slot SHOULD be used if the medium for signal generation has only a limited capability of parallel signal generation. The smaller the slot index, the higher is the priority in generation of the signal.
*
* Example: if a signal is audible and there are different audio signals for different ALERT SIGNALs, and more than one ALERT SIGNAL has to be generated, the generating system has to decide which of the ALERT SIGNALs it generates as overlaying audio signals might not be desirable. For example, if the first ALERT SIGNAL has a slot number of 0 and the second ALERT SIGNAL has a slot number 1 and both signals are active, than the ALERT SYSTEM generates only the ALERT SIGNAL with the slot number 0.
*
*/
@XmlAttribute(name = "Slot")
@XmlSchemaType(name = "unsignedInt")
protected Long slot;
/**
* ActualSignalGenerationDelay overrides pm:AlertSignalDescriptor/@DefaultSignalGenerationDelay.
*
* @return
* possible object is
* {@link String }
*
*/
@Nullable
public Duration getActualSignalGenerationDelay() {
return actualSignalGenerationDelay;
}
/**
* Sets the value of the actualSignalGenerationDelay property.
*
* @param value
* allowed object is
* {@link String }
*
* @see #getActualSignalGenerationDelay()
*/
public void setActualSignalGenerationDelay(
@Nullable
Duration value) {
this.actualSignalGenerationDelay = value;
}
/**
* See pm:AlertSignalPresence. The implied value SHALL be "Off".
*
* @return
* possible object is
* {@link AlertSignalPresence }
*
*/
@Nullable
public AlertSignalPresence getPresence() {
return presence;
}
/**
* Sets the value of the presence property.
*
* @param value
* allowed object is
* {@link AlertSignalPresence }
*
* @see #getPresence()
*/
public void setPresence(
@Nullable
AlertSignalPresence value) {
this.presence = value;
}
/**
* See pm:AlertSignalPrimaryLocation. The implied value SHALL be "Loc".
*
* @return
* possible object is
* {@link AlertSignalPrimaryLocation }
*
*/
@Nullable
public AlertSignalPrimaryLocation getLocation() {
return location;
}
/**
* Sets the value of the location property.
*
* @param value
* allowed object is
* {@link AlertSignalPrimaryLocation }
*
* @see #getLocation()
*/
public void setLocation(
@Nullable
AlertSignalPrimaryLocation value) {
this.location = value;
}
/**
* The slot is a 0-based index that allows a prioritization of the ALERT SIGNAL w.r.t. signal tangibility. The Slot SHOULD be used if the medium for signal generation has only a limited capability of parallel signal generation. The smaller the slot index, the higher is the priority in generation of the signal.
*
* Example: if a signal is audible and there are different audio signals for different ALERT SIGNALs, and more than one ALERT SIGNAL has to be generated, the generating system has to decide which of the ALERT SIGNALs it generates as overlaying audio signals might not be desirable. For example, if the first ALERT SIGNAL has a slot number of 0 and the second ALERT SIGNAL has a slot number 1 and both signals are active, than the ALERT SYSTEM generates only the ALERT SIGNAL with the slot number 0.
*
* @return
* possible object is
* {@link Long }
*
*/
@Nullable
public Long getSlot() {
return slot;
}
/**
* Sets the value of the slot property.
*
* @param value
* allowed object is
* {@link Long }
*
* @see #getSlot()
*/
public void setSlot(
@Nullable
Long value) {
this.slot = 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 AlertSignalState that = ((AlertSignalState) object);
{
Duration leftActualSignalGenerationDelay;
leftActualSignalGenerationDelay = this.getActualSignalGenerationDelay();
Duration rightActualSignalGenerationDelay;
rightActualSignalGenerationDelay = that.getActualSignalGenerationDelay();
if (this.actualSignalGenerationDelay!= null) {
if (that.actualSignalGenerationDelay!= null) {
if (!leftActualSignalGenerationDelay.equals(rightActualSignalGenerationDelay)) {
return false;
}
} else {
return false;
}
} else {
if (that.actualSignalGenerationDelay!= null) {
return false;
}
}
}
{
AlertSignalPresence leftPresence;
leftPresence = this.getPresence();
AlertSignalPresence rightPresence;
rightPresence = that.getPresence();
if (this.presence!= null) {
if (that.presence!= null) {
if (!leftPresence.equals(rightPresence)) {
return false;
}
} else {
return false;
}
} else {
if (that.presence!= null) {
return false;
}
}
}
{
AlertSignalPrimaryLocation leftLocation;
leftLocation = this.getLocation();
AlertSignalPrimaryLocation rightLocation;
rightLocation = that.getLocation();
if (this.location!= null) {
if (that.location!= null) {
if (!leftLocation.equals(rightLocation)) {
return false;
}
} else {
return false;
}
} else {
if (that.location!= null) {
return false;
}
}
}
{
Long leftSlot;
leftSlot = this.getSlot();
Long rightSlot;
rightSlot = that.getSlot();
if (this.slot!= null) {
if (that.slot!= null) {
if (!leftSlot.equals(rightSlot)) {
return false;
}
} else {
return false;
}
} else {
if (that.slot!= null) {
return false;
}
}
}
return true;
}
@Override
public int hashCode() {
int currentHashCode = 1;
currentHashCode = ((currentHashCode* 31)+ super.hashCode());
{
currentHashCode = (currentHashCode* 31);
Duration theActualSignalGenerationDelay;
theActualSignalGenerationDelay = this.getActualSignalGenerationDelay();
if (this.actualSignalGenerationDelay!= null) {
currentHashCode += theActualSignalGenerationDelay.hashCode();
}
}
{
currentHashCode = (currentHashCode* 31);
AlertSignalPresence thePresence;
thePresence = this.getPresence();
if (this.presence!= null) {
currentHashCode += thePresence.hashCode();
}
}
{
currentHashCode = (currentHashCode* 31);
AlertSignalPrimaryLocation theLocation;
theLocation = this.getLocation();
if (this.location!= null) {
currentHashCode += theLocation.hashCode();
}
}
{
currentHashCode = (currentHashCode* 31);
Long theSlot;
theSlot = this.getSlot();
if (this.slot!= null) {
currentHashCode += theSlot.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 theActualSignalGenerationDelay;
theActualSignalGenerationDelay = this.getActualSignalGenerationDelay();
strategy.appendField(locator, this, "actualSignalGenerationDelay", buffer, theActualSignalGenerationDelay, (this.actualSignalGenerationDelay!= null));
}
{
AlertSignalPresence thePresence;
thePresence = this.getPresence();
strategy.appendField(locator, this, "presence", buffer, thePresence, (this.presence!= null));
}
{
AlertSignalPrimaryLocation theLocation;
theLocation = this.getLocation();
strategy.appendField(locator, this, "location", buffer, theLocation, (this.location!= null));
}
{
Long theSlot;
theSlot = this.getSlot();
strategy.appendField(locator, this, "slot", buffer, theSlot, (this.slot!= 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 AlertSignalState) {
final AlertSignalState copy = ((AlertSignalState) draftCopy);
{
Boolean actualSignalGenerationDelayShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.actualSignalGenerationDelay!= null));
if (actualSignalGenerationDelayShouldBeCopiedAndSet == Boolean.TRUE) {
Duration sourceActualSignalGenerationDelay;
sourceActualSignalGenerationDelay = this.getActualSignalGenerationDelay();
Duration copyActualSignalGenerationDelay = ((Duration) strategy.copy(LocatorUtils.property(locator, "actualSignalGenerationDelay", sourceActualSignalGenerationDelay), sourceActualSignalGenerationDelay, (this.actualSignalGenerationDelay!= null)));
copy.setActualSignalGenerationDelay(copyActualSignalGenerationDelay);
} else {
if (actualSignalGenerationDelayShouldBeCopiedAndSet == Boolean.FALSE) {
copy.actualSignalGenerationDelay = null;
}
}
}
{
Boolean presenceShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.presence!= null));
if (presenceShouldBeCopiedAndSet == Boolean.TRUE) {
AlertSignalPresence sourcePresence;
sourcePresence = this.getPresence();
AlertSignalPresence copyPresence = ((AlertSignalPresence) strategy.copy(LocatorUtils.property(locator, "presence", sourcePresence), sourcePresence, (this.presence!= null)));
copy.setPresence(copyPresence);
} else {
if (presenceShouldBeCopiedAndSet == Boolean.FALSE) {
copy.presence = null;
}
}
}
{
Boolean locationShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.location!= null));
if (locationShouldBeCopiedAndSet == Boolean.TRUE) {
AlertSignalPrimaryLocation sourceLocation;
sourceLocation = this.getLocation();
AlertSignalPrimaryLocation copyLocation = ((AlertSignalPrimaryLocation) strategy.copy(LocatorUtils.property(locator, "location", sourceLocation), sourceLocation, (this.location!= null)));
copy.setLocation(copyLocation);
} else {
if (locationShouldBeCopiedAndSet == Boolean.FALSE) {
copy.location = null;
}
}
}
{
Boolean slotShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.slot!= null));
if (slotShouldBeCopiedAndSet == Boolean.TRUE) {
Long sourceSlot;
sourceSlot = this.getSlot();
Long copySlot = ((Long) strategy.copy(LocatorUtils.property(locator, "slot", sourceSlot), sourceSlot, (this.slot!= null)));
copy.setSlot(copySlot);
} else {
if (slotShouldBeCopiedAndSet == Boolean.FALSE) {
copy.slot = null;
}
}
}
}
return draftCopy;
}
@Override
public Object createNewInstance() {
return new AlertSignalState();
}
}