All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.somda.sdc.biceps.model.participant.SampleArrayValue Maven / Gradle / Ivy

Go to download

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.math.BigDecimal;
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.XmlSchemaType;
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;


/**
 * Type that contains sequences of values, i.e., sample arrays.
 * 
 * The ./pmMetricQuality ELEMENT relates to all samples.
 * 
 * NOTE 1—pm:Timestamp (see base: pm:AbstractMetricValue) refers to the first value of the array. The individual timestamps of the values can thus be computed from the sample rate (see pm:RealTimeSampleArrayMetricDescriptor).
 * NOTE 2—If ./pmMetricQuality cannot be applied to all samples due to, e.g., some invalid values, a SERVICE PROVIDER can decide to set ./pmMetricQuality/@Validity to "Qst" or "Inv".
 * 
 * 

Java class for SampleArrayValue complex type

. * *

The following schema fragment specifies the expected content contained within this class.

* *
{@code
 * 
 *   
 *     
 *       
 *         
 *           
 *             
 *               
 *                 
 *                 
 *               
 *             
 *           
 *         
 *       
 *       
 *     
 *   
 * 
 * }
* * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "SampleArrayValue", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/participant", propOrder = { "applyAnnotation" }) public class SampleArrayValue extends AbstractMetricValue implements Cloneable, CopyTo, ToString { /** * Annotations MAY only apply to specific values in the real-time sample array. The ApplyAnnotation set relates annotations to sample indices. If no ApplyAnnotation ELEMENT is provided all annotations are valid for all values in the context. * */ @XmlElement(name = "ApplyAnnotation", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/participant") protected List applyAnnotation; @XmlAttribute(name = "Samples") protected List samples; /** * Annotations MAY only apply to specific values in the real-time sample array. The ApplyAnnotation set relates annotations to sample indices. If no ApplyAnnotation ELEMENT is provided all annotations are valid for all values in the context. * * Gets the value of the applyAnnotation 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 applyAnnotation property.

* *

* For example, to add a new item, do as follows: *

*
     * getApplyAnnotation().add(newItem);
     * 
* * *

* Objects of the following type(s) are allowed in the list * {@link SampleArrayValue.ApplyAnnotation } *

* * * @return * The value of the applyAnnotation property. */ public List getApplyAnnotation() { if (applyAnnotation == null) { applyAnnotation = new ArrayList<>(); } return this.applyAnnotation; } /** * Gets the value of the samples 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 samples property.

* *

* For example, to add a new item, do as follows: *

*
     * getSamples().add(newItem);
     * 
* * *

* Objects of the following type(s) are allowed in the list * {@link BigDecimal } *

* * * @return * The value of the samples property. */ @Nullable public List getSamples() { if (samples == null) { samples = new ArrayList<>(); } return this.samples; } public void setApplyAnnotation( @Nullable List value) { this.applyAnnotation = null; if (value!= null) { List draftl = this.getApplyAnnotation(); draftl.addAll(value); } } public void setSamples( @Nullable List value) { this.samples = null; if (value!= null) { List draftl = this.getSamples(); 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 SampleArrayValue that = ((SampleArrayValue) object); { List leftApplyAnnotation; leftApplyAnnotation = (((this.applyAnnotation!= null)&&(!this.applyAnnotation.isEmpty()))?this.getApplyAnnotation():null); List rightApplyAnnotation; rightApplyAnnotation = (((that.applyAnnotation!= null)&&(!that.applyAnnotation.isEmpty()))?that.getApplyAnnotation():null); if ((this.applyAnnotation!= null)&&(!this.applyAnnotation.isEmpty())) { if ((that.applyAnnotation!= null)&&(!that.applyAnnotation.isEmpty())) { if (!leftApplyAnnotation.equals(rightApplyAnnotation)) { return false; } } else { return false; } } else { if ((that.applyAnnotation!= null)&&(!that.applyAnnotation.isEmpty())) { return false; } } } { List leftSamples; leftSamples = (((this.samples!= null)&&(!this.samples.isEmpty()))?this.getSamples():null); List rightSamples; rightSamples = (((that.samples!= null)&&(!that.samples.isEmpty()))?that.getSamples():null); if ((this.samples!= null)&&(!this.samples.isEmpty())) { if ((that.samples!= null)&&(!that.samples.isEmpty())) { if (!leftSamples.equals(rightSamples)) { return false; } } else { return false; } } else { if ((that.samples!= null)&&(!that.samples.isEmpty())) { return false; } } } return true; } @Override public int hashCode() { int currentHashCode = 1; currentHashCode = ((currentHashCode* 31)+ super.hashCode()); { currentHashCode = (currentHashCode* 31); List theApplyAnnotation; theApplyAnnotation = (((this.applyAnnotation!= null)&&(!this.applyAnnotation.isEmpty()))?this.getApplyAnnotation():null); if ((this.applyAnnotation!= null)&&(!this.applyAnnotation.isEmpty())) { currentHashCode += theApplyAnnotation.hashCode(); } } { currentHashCode = (currentHashCode* 31); List theSamples; theSamples = (((this.samples!= null)&&(!this.samples.isEmpty()))?this.getSamples():null); if ((this.samples!= null)&&(!this.samples.isEmpty())) { currentHashCode += theSamples.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 theApplyAnnotation; theApplyAnnotation = (((this.applyAnnotation!= null)&&(!this.applyAnnotation.isEmpty()))?this.getApplyAnnotation():null); strategy.appendField(locator, this, "applyAnnotation", buffer, theApplyAnnotation, ((this.applyAnnotation!= null)&&(!this.applyAnnotation.isEmpty()))); } { List theSamples; theSamples = (((this.samples!= null)&&(!this.samples.isEmpty()))?this.getSamples():null); strategy.appendField(locator, this, "samples", buffer, theSamples, ((this.samples!= null)&&(!this.samples.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 SampleArrayValue) { final SampleArrayValue copy = ((SampleArrayValue) draftCopy); { Boolean applyAnnotationShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, ((this.applyAnnotation!= null)&&(!this.applyAnnotation.isEmpty()))); if (applyAnnotationShouldBeCopiedAndSet == Boolean.TRUE) { List sourceApplyAnnotation; sourceApplyAnnotation = (((this.applyAnnotation!= null)&&(!this.applyAnnotation.isEmpty()))?this.getApplyAnnotation():null); @SuppressWarnings("unchecked") List copyApplyAnnotation = ((List ) strategy.copy(LocatorUtils.property(locator, "applyAnnotation", sourceApplyAnnotation), sourceApplyAnnotation, ((this.applyAnnotation!= null)&&(!this.applyAnnotation.isEmpty())))); copy.setApplyAnnotation(copyApplyAnnotation); } else { if (applyAnnotationShouldBeCopiedAndSet == Boolean.FALSE) { copy.applyAnnotation = null; } } } { Boolean samplesShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, ((this.samples!= null)&&(!this.samples.isEmpty()))); if (samplesShouldBeCopiedAndSet == Boolean.TRUE) { List sourceSamples; sourceSamples = (((this.samples!= null)&&(!this.samples.isEmpty()))?this.getSamples():null); @SuppressWarnings("unchecked") List copySamples = ((List ) strategy.copy(LocatorUtils.property(locator, "samples", sourceSamples), sourceSamples, ((this.samples!= null)&&(!this.samples.isEmpty())))); copy.setSamples(copySamples); } else { if (samplesShouldBeCopiedAndSet == Boolean.FALSE) { copy.samples = null; } } } } return draftCopy; } @Override public Object createNewInstance() { return new 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 = "") public static class ApplyAnnotation implements Cloneable, CopyTo, ToString { /** * Index number of the annotation that is addressed by the ApplyAnnotation ELEMENT. The index number refers to the (n+1)-nth pm:AbstractMetricValue/pm:Annotation ELEMENT. Hence, numbering is zero-based. * */ @XmlAttribute(name = "AnnotationIndex", required = true) @XmlSchemaType(name = "unsignedInt") protected long annotationIndex; /** * Index number of the sample the defined annotation refers to. The index number addresses the (n+1)-nth number in the pm:RealTimeSampleArrayValue/pm:Samples ATTRIBUTE. Hence, numbering is zero-based. * */ @XmlAttribute(name = "SampleIndex", required = true) @XmlSchemaType(name = "unsignedInt") protected long sampleIndex; /** * Index number of the annotation that is addressed by the ApplyAnnotation ELEMENT. The index number refers to the (n+1)-nth pm:AbstractMetricValue/pm:Annotation ELEMENT. Hence, numbering is zero-based. * */ public long getAnnotationIndex() { return annotationIndex; } /** * Sets the value of the annotationIndex property. * */ public void setAnnotationIndex(long value) { this.annotationIndex = value; } /** * Index number of the sample the defined annotation refers to. The index number addresses the (n+1)-nth number in the pm:RealTimeSampleArrayValue/pm:Samples ATTRIBUTE. Hence, numbering is zero-based. * */ public long getSampleIndex() { return sampleIndex; } /** * Sets the value of the sampleIndex property. * */ public void setSampleIndex(long value) { this.sampleIndex = value; } @Override public boolean equals(Object object) { if ((object == null)||(this.getClass()!= object.getClass())) { return false; } if (this == object) { return true; } final SampleArrayValue.ApplyAnnotation that = ((SampleArrayValue.ApplyAnnotation) object); { long leftAnnotationIndex; leftAnnotationIndex = this.getAnnotationIndex(); long rightAnnotationIndex; rightAnnotationIndex = that.getAnnotationIndex(); if (leftAnnotationIndex!= rightAnnotationIndex) { return false; } } { long leftSampleIndex; leftSampleIndex = this.getSampleIndex(); long rightSampleIndex; rightSampleIndex = that.getSampleIndex(); if (leftSampleIndex!= rightSampleIndex) { return false; } } return true; } @Override public int hashCode() { int currentHashCode = 1; { currentHashCode = (currentHashCode* 31); long theAnnotationIndex; theAnnotationIndex = this.getAnnotationIndex(); currentHashCode += ((int)(theAnnotationIndex^(theAnnotationIndex >>> 32))); } { currentHashCode = (currentHashCode* 31); long theSampleIndex; theSampleIndex = this.getSampleIndex(); currentHashCode += ((int)(theSampleIndex^(theSampleIndex >>> 32))); } 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) { { long theAnnotationIndex; theAnnotationIndex = this.getAnnotationIndex(); strategy.appendField(locator, this, "annotationIndex", buffer, theAnnotationIndex, true); } { long theSampleIndex; theSampleIndex = this.getSampleIndex(); strategy.appendField(locator, this, "sampleIndex", buffer, theSampleIndex, true); } 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 SampleArrayValue.ApplyAnnotation) { final SampleArrayValue.ApplyAnnotation copy = ((SampleArrayValue.ApplyAnnotation) draftCopy); { Boolean annotationIndexShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, true); if (annotationIndexShouldBeCopiedAndSet == Boolean.TRUE) { long sourceAnnotationIndex; sourceAnnotationIndex = this.getAnnotationIndex(); long copyAnnotationIndex = strategy.copy(LocatorUtils.property(locator, "annotationIndex", sourceAnnotationIndex), sourceAnnotationIndex, true); copy.setAnnotationIndex(copyAnnotationIndex); } else { if (annotationIndexShouldBeCopiedAndSet == Boolean.FALSE) { } } } { Boolean sampleIndexShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, true); if (sampleIndexShouldBeCopiedAndSet == Boolean.TRUE) { long sourceSampleIndex; sourceSampleIndex = this.getSampleIndex(); long copySampleIndex = strategy.copy(LocatorUtils.property(locator, "sampleIndex", sourceSampleIndex), sourceSampleIndex, true); copy.setSampleIndex(copySampleIndex); } else { if (sampleIndexShouldBeCopiedAndSet == Boolean.FALSE) { } } } } return draftCopy; } @Override public Object createNewInstance() { return new SampleArrayValue.ApplyAnnotation(); } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy