org.somda.sdc.biceps.model.message.ObservedValueStream 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 java.util.ArrayList;
import java.util.List;
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.XmlRootElement;
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.participant.SampleArrayValue;
/**
* Java class for anonymous complex type
.
*
* The following schema fragment specifies the expected content contained within this class.
*
* {@code
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
* }
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"value"
})
@XmlRootElement(name = "ObservedValueStream", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/message")
public class ObservedValueStream
extends AbstractReport
implements Cloneable, CopyTo, ToString
{
@XmlElement(name = "Value", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/message")
protected List value;
/**
* Gets the value of the value 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 value property.
*
*
* For example, to add a new item, do as follows:
*
*
* getValue().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link ObservedValueStream.Value }
*
*
*
* @return
* The value of the value property.
*/
public List getValue() {
if (value == null) {
value = new ArrayList<>();
}
return this.value;
}
public void setValue(List value) {
this.value = null;
if (value!= null) {
List draftl = this.getValue();
draftl.addAll(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 ObservedValueStream that = ((ObservedValueStream) object);
{
List leftValue;
leftValue = (((this.value!= null)&&(!this.value.isEmpty()))?this.getValue():null);
List rightValue;
rightValue = (((that.value!= null)&&(!that.value.isEmpty()))?that.getValue():null);
if ((this.value!= null)&&(!this.value.isEmpty())) {
if ((that.value!= null)&&(!that.value.isEmpty())) {
if (!leftValue.equals(rightValue)) {
return false;
}
} else {
return false;
}
} else {
if ((that.value!= null)&&(!that.value.isEmpty())) {
return false;
}
}
}
return true;
}
@Override
public int hashCode() {
int currentHashCode = 1;
currentHashCode = ((currentHashCode* 31)+ super.hashCode());
{
currentHashCode = (currentHashCode* 31);
List theValue;
theValue = (((this.value!= null)&&(!this.value.isEmpty()))?this.getValue():null);
if ((this.value!= null)&&(!this.value.isEmpty())) {
currentHashCode += theValue.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);
{
List theValue;
theValue = (((this.value!= null)&&(!this.value.isEmpty()))?this.getValue():null);
strategy.appendField(locator, this, "value", buffer, theValue, ((this.value!= null)&&(!this.value.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);
super.copyTo(locator, draftCopy, strategy);
if (draftCopy instanceof ObservedValueStream) {
final ObservedValueStream copy = ((ObservedValueStream) draftCopy);
{
Boolean valueShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, ((this.value!= null)&&(!this.value.isEmpty())));
if (valueShouldBeCopiedAndSet == Boolean.TRUE) {
List sourceValue;
sourceValue = (((this.value!= null)&&(!this.value.isEmpty()))?this.getValue():null);
@SuppressWarnings("unchecked")
List copyValue = ((List ) strategy.copy(LocatorUtils.property(locator, "value", sourceValue), sourceValue, ((this.value!= null)&&(!this.value.isEmpty()))));
copy.setValue(copyValue);
} else {
if (valueShouldBeCopiedAndSet == Boolean.FALSE) {
copy.value = null;
}
}
}
}
return draftCopy;
}
@Override
public Object createNewInstance() {
return new ObservedValueStream();
}
/**
* A stream ELEMENT that contains observed values of a stream-able state.
*
* Java class for anonymous complex type
.
*
* The following schema fragment specifies the expected content contained within this class.
*
* {@code
*
*
*
*
*
*
*
*
*
*
*
* }
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"value"
})
public static class Value implements Cloneable, CopyTo, ToString
{
@XmlElement(name = "Value", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/message")
protected SampleArrayValue value;
/**
* Handle reference to the descriptor the observed values belong to.
*
*/
@XmlAttribute(name = "Metric", required = true)
protected String metric;
/**
* Version number of the state. The implied value SHALL be "0".
*
*/
@XmlAttribute(name = "StateVersion")
protected BigInteger stateVersion;
/**
* Gets the value of the value property.
*
* @return
* possible object is
* {@link SampleArrayValue }
*
*/
public SampleArrayValue getValue() {
return value;
}
/**
* Sets the value of the value property.
*
* @param value
* allowed object is
* {@link SampleArrayValue }
*
*/
public void setValue(SampleArrayValue value) {
this.value = value;
}
/**
* Handle reference to the descriptor the observed values belong to.
*
* @return
* possible object is
* {@link String }
*
*/
public String getMetric() {
return metric;
}
/**
* Sets the value of the metric property.
*
* @param value
* allowed object is
* {@link String }
*
* @see #getMetric()
*/
public void setMetric(String value) {
this.metric = value;
}
/**
* Version number of the state. The implied value SHALL be "0".
*
* @return
* possible object is
* {@link BigInteger }
*
*/
public BigInteger getStateVersion() {
return stateVersion;
}
/**
* Sets the value of the stateVersion property.
*
* @param value
* allowed object is
* {@link BigInteger }
*
* @see #getStateVersion()
*/
public void setStateVersion(BigInteger value) {
this.stateVersion = value;
}
@Override
public boolean equals(Object object) {
if ((object == null)||(this.getClass()!= object.getClass())) {
return false;
}
if (this == object) {
return true;
}
final ObservedValueStream.Value that = ((ObservedValueStream.Value) object);
{
SampleArrayValue leftValue;
leftValue = this.getValue();
SampleArrayValue rightValue;
rightValue = that.getValue();
if (this.value!= null) {
if (that.value!= null) {
if (!leftValue.equals(rightValue)) {
return false;
}
} else {
return false;
}
} else {
if (that.value!= null) {
return false;
}
}
}
{
String leftMetric;
leftMetric = this.getMetric();
String rightMetric;
rightMetric = that.getMetric();
if (this.metric!= null) {
if (that.metric!= null) {
if (!leftMetric.equals(rightMetric)) {
return false;
}
} else {
return false;
}
} else {
if (that.metric!= null) {
return false;
}
}
}
{
BigInteger leftStateVersion;
leftStateVersion = this.getStateVersion();
BigInteger rightStateVersion;
rightStateVersion = that.getStateVersion();
if (this.stateVersion!= null) {
if (that.stateVersion!= null) {
if (!leftStateVersion.equals(rightStateVersion)) {
return false;
}
} else {
return false;
}
} else {
if (that.stateVersion!= null) {
return false;
}
}
}
return true;
}
@Override
public int hashCode() {
int currentHashCode = 1;
{
currentHashCode = (currentHashCode* 31);
SampleArrayValue theValue;
theValue = this.getValue();
if (this.value!= null) {
currentHashCode += theValue.hashCode();
}
}
{
currentHashCode = (currentHashCode* 31);
String theMetric;
theMetric = this.getMetric();
if (this.metric!= null) {
currentHashCode += theMetric.hashCode();
}
}
{
currentHashCode = (currentHashCode* 31);
BigInteger theStateVersion;
theStateVersion = this.getStateVersion();
if (this.stateVersion!= null) {
currentHashCode += theStateVersion.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) {
{
SampleArrayValue theValue;
theValue = this.getValue();
strategy.appendField(locator, this, "value", buffer, theValue, (this.value!= null));
}
{
String theMetric;
theMetric = this.getMetric();
strategy.appendField(locator, this, "metric", buffer, theMetric, (this.metric!= null));
}
{
BigInteger theStateVersion;
theStateVersion = this.getStateVersion();
strategy.appendField(locator, this, "stateVersion", buffer, theStateVersion, (this.stateVersion!= 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 ObservedValueStream.Value) {
final ObservedValueStream.Value copy = ((ObservedValueStream.Value) draftCopy);
{
Boolean valueShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.value!= null));
if (valueShouldBeCopiedAndSet == Boolean.TRUE) {
SampleArrayValue sourceValue;
sourceValue = this.getValue();
SampleArrayValue copyValue = ((SampleArrayValue) strategy.copy(LocatorUtils.property(locator, "value", sourceValue), sourceValue, (this.value!= null)));
copy.setValue(copyValue);
} else {
if (valueShouldBeCopiedAndSet == Boolean.FALSE) {
copy.value = null;
}
}
}
{
Boolean metricShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.metric!= null));
if (metricShouldBeCopiedAndSet == Boolean.TRUE) {
String sourceMetric;
sourceMetric = this.getMetric();
String copyMetric = ((String) strategy.copy(LocatorUtils.property(locator, "metric", sourceMetric), sourceMetric, (this.metric!= null)));
copy.setMetric(copyMetric);
} else {
if (metricShouldBeCopiedAndSet == Boolean.FALSE) {
copy.metric = null;
}
}
}
{
Boolean stateVersionShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.stateVersion!= null));
if (stateVersionShouldBeCopiedAndSet == Boolean.TRUE) {
BigInteger sourceStateVersion;
sourceStateVersion = this.getStateVersion();
BigInteger copyStateVersion = ((BigInteger) strategy.copy(LocatorUtils.property(locator, "stateVersion", sourceStateVersion), sourceStateVersion, (this.stateVersion!= null)));
copy.setStateVersion(copyStateVersion);
} else {
if (stateVersionShouldBeCopiedAndSet == Boolean.FALSE) {
copy.stateVersion = null;
}
}
}
}
return draftCopy;
}
@Override
public Object createNewInstance() {
return new ObservedValueStream.Value();
}
}
}