org.somda.sdc.biceps.model.participant.Range 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.math.BigDecimal;
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.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;
/**
* A range of decimal values which provides a lower and an upper bound as well as a step width.
*
* Java class for Range complex type
.
*
* The following schema fragment specifies the expected content contained within this class.
*
* {@code
*
*
*
*
*
*
*
*
*
*
*
*
*
*
* }
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Range", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/participant", propOrder = {
"extension"
})
public class Range implements Cloneable, CopyTo, ToString
{
@XmlElement(name = "Extension", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/extension")
protected ExtensionType extension;
/**
* The including lower bound of the range.
*
*/
@XmlAttribute(name = "Lower")
protected BigDecimal lower;
/**
* The including upper bound of the range.
*
*/
@XmlAttribute(name = "Upper")
protected BigDecimal upper;
/**
* The numerical distance between two values in the range of the given upper and lower bound.
*
*/
@XmlAttribute(name = "StepWidth")
protected BigDecimal stepWidth;
/**
* Maximum relative error in relation to the correct value within the given range.
*
*/
@XmlAttribute(name = "RelativeAccuracy")
protected BigDecimal relativeAccuracy;
/**
* Maximum absolute error in relation to the correct value within the given range.
*
*/
@XmlAttribute(name = "AbsoluteAccuracy")
protected BigDecimal absoluteAccuracy;
/**
* 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;
}
/**
* The including lower bound of the range.
*
* @return
* possible object is
* {@link BigDecimal }
*
*/
@Nullable
public BigDecimal getLower() {
return lower;
}
/**
* Sets the value of the lower property.
*
* @param value
* allowed object is
* {@link BigDecimal }
*
* @see #getLower()
*/
public void setLower(
@Nullable
BigDecimal value) {
this.lower = value;
}
/**
* The including upper bound of the range.
*
* @return
* possible object is
* {@link BigDecimal }
*
*/
@Nullable
public BigDecimal getUpper() {
return upper;
}
/**
* Sets the value of the upper property.
*
* @param value
* allowed object is
* {@link BigDecimal }
*
* @see #getUpper()
*/
public void setUpper(
@Nullable
BigDecimal value) {
this.upper = value;
}
/**
* The numerical distance between two values in the range of the given upper and lower bound.
*
* @return
* possible object is
* {@link BigDecimal }
*
*/
@Nullable
public BigDecimal getStepWidth() {
return stepWidth;
}
/**
* Sets the value of the stepWidth property.
*
* @param value
* allowed object is
* {@link BigDecimal }
*
* @see #getStepWidth()
*/
public void setStepWidth(
@Nullable
BigDecimal value) {
this.stepWidth = value;
}
/**
* Maximum relative error in relation to the correct value within the given range.
*
* @return
* possible object is
* {@link BigDecimal }
*
*/
@Nullable
public BigDecimal getRelativeAccuracy() {
return relativeAccuracy;
}
/**
* Sets the value of the relativeAccuracy property.
*
* @param value
* allowed object is
* {@link BigDecimal }
*
* @see #getRelativeAccuracy()
*/
public void setRelativeAccuracy(
@Nullable
BigDecimal value) {
this.relativeAccuracy = value;
}
/**
* Maximum absolute error in relation to the correct value within the given range.
*
* @return
* possible object is
* {@link BigDecimal }
*
*/
@Nullable
public BigDecimal getAbsoluteAccuracy() {
return absoluteAccuracy;
}
/**
* Sets the value of the absoluteAccuracy property.
*
* @param value
* allowed object is
* {@link BigDecimal }
*
* @see #getAbsoluteAccuracy()
*/
public void setAbsoluteAccuracy(
@Nullable
BigDecimal value) {
this.absoluteAccuracy = value;
}
@Override
public boolean equals(Object object) {
if ((object == null)||(this.getClass()!= object.getClass())) {
return false;
}
if (this == object) {
return true;
}
final Range that = ((Range) 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;
}
}
}
{
BigDecimal leftLower;
leftLower = this.getLower();
BigDecimal rightLower;
rightLower = that.getLower();
if (this.lower!= null) {
if (that.lower!= null) {
if (!leftLower.equals(rightLower)) {
return false;
}
} else {
return false;
}
} else {
if (that.lower!= null) {
return false;
}
}
}
{
BigDecimal leftUpper;
leftUpper = this.getUpper();
BigDecimal rightUpper;
rightUpper = that.getUpper();
if (this.upper!= null) {
if (that.upper!= null) {
if (!leftUpper.equals(rightUpper)) {
return false;
}
} else {
return false;
}
} else {
if (that.upper!= null) {
return false;
}
}
}
{
BigDecimal leftStepWidth;
leftStepWidth = this.getStepWidth();
BigDecimal rightStepWidth;
rightStepWidth = that.getStepWidth();
if (this.stepWidth!= null) {
if (that.stepWidth!= null) {
if (!leftStepWidth.equals(rightStepWidth)) {
return false;
}
} else {
return false;
}
} else {
if (that.stepWidth!= null) {
return false;
}
}
}
{
BigDecimal leftRelativeAccuracy;
leftRelativeAccuracy = this.getRelativeAccuracy();
BigDecimal rightRelativeAccuracy;
rightRelativeAccuracy = that.getRelativeAccuracy();
if (this.relativeAccuracy!= null) {
if (that.relativeAccuracy!= null) {
if (!leftRelativeAccuracy.equals(rightRelativeAccuracy)) {
return false;
}
} else {
return false;
}
} else {
if (that.relativeAccuracy!= null) {
return false;
}
}
}
{
BigDecimal leftAbsoluteAccuracy;
leftAbsoluteAccuracy = this.getAbsoluteAccuracy();
BigDecimal rightAbsoluteAccuracy;
rightAbsoluteAccuracy = that.getAbsoluteAccuracy();
if (this.absoluteAccuracy!= null) {
if (that.absoluteAccuracy!= null) {
if (!leftAbsoluteAccuracy.equals(rightAbsoluteAccuracy)) {
return false;
}
} else {
return false;
}
} else {
if (that.absoluteAccuracy!= null) {
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);
BigDecimal theLower;
theLower = this.getLower();
if (this.lower!= null) {
currentHashCode += theLower.hashCode();
}
}
{
currentHashCode = (currentHashCode* 31);
BigDecimal theUpper;
theUpper = this.getUpper();
if (this.upper!= null) {
currentHashCode += theUpper.hashCode();
}
}
{
currentHashCode = (currentHashCode* 31);
BigDecimal theStepWidth;
theStepWidth = this.getStepWidth();
if (this.stepWidth!= null) {
currentHashCode += theStepWidth.hashCode();
}
}
{
currentHashCode = (currentHashCode* 31);
BigDecimal theRelativeAccuracy;
theRelativeAccuracy = this.getRelativeAccuracy();
if (this.relativeAccuracy!= null) {
currentHashCode += theRelativeAccuracy.hashCode();
}
}
{
currentHashCode = (currentHashCode* 31);
BigDecimal theAbsoluteAccuracy;
theAbsoluteAccuracy = this.getAbsoluteAccuracy();
if (this.absoluteAccuracy!= null) {
currentHashCode += theAbsoluteAccuracy.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));
}
{
BigDecimal theLower;
theLower = this.getLower();
strategy.appendField(locator, this, "lower", buffer, theLower, (this.lower!= null));
}
{
BigDecimal theUpper;
theUpper = this.getUpper();
strategy.appendField(locator, this, "upper", buffer, theUpper, (this.upper!= null));
}
{
BigDecimal theStepWidth;
theStepWidth = this.getStepWidth();
strategy.appendField(locator, this, "stepWidth", buffer, theStepWidth, (this.stepWidth!= null));
}
{
BigDecimal theRelativeAccuracy;
theRelativeAccuracy = this.getRelativeAccuracy();
strategy.appendField(locator, this, "relativeAccuracy", buffer, theRelativeAccuracy, (this.relativeAccuracy!= null));
}
{
BigDecimal theAbsoluteAccuracy;
theAbsoluteAccuracy = this.getAbsoluteAccuracy();
strategy.appendField(locator, this, "absoluteAccuracy", buffer, theAbsoluteAccuracy, (this.absoluteAccuracy!= 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 Range) {
final Range copy = ((Range) 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 lowerShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.lower!= null));
if (lowerShouldBeCopiedAndSet == Boolean.TRUE) {
BigDecimal sourceLower;
sourceLower = this.getLower();
BigDecimal copyLower = ((BigDecimal) strategy.copy(LocatorUtils.property(locator, "lower", sourceLower), sourceLower, (this.lower!= null)));
copy.setLower(copyLower);
} else {
if (lowerShouldBeCopiedAndSet == Boolean.FALSE) {
copy.lower = null;
}
}
}
{
Boolean upperShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.upper!= null));
if (upperShouldBeCopiedAndSet == Boolean.TRUE) {
BigDecimal sourceUpper;
sourceUpper = this.getUpper();
BigDecimal copyUpper = ((BigDecimal) strategy.copy(LocatorUtils.property(locator, "upper", sourceUpper), sourceUpper, (this.upper!= null)));
copy.setUpper(copyUpper);
} else {
if (upperShouldBeCopiedAndSet == Boolean.FALSE) {
copy.upper = null;
}
}
}
{
Boolean stepWidthShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.stepWidth!= null));
if (stepWidthShouldBeCopiedAndSet == Boolean.TRUE) {
BigDecimal sourceStepWidth;
sourceStepWidth = this.getStepWidth();
BigDecimal copyStepWidth = ((BigDecimal) strategy.copy(LocatorUtils.property(locator, "stepWidth", sourceStepWidth), sourceStepWidth, (this.stepWidth!= null)));
copy.setStepWidth(copyStepWidth);
} else {
if (stepWidthShouldBeCopiedAndSet == Boolean.FALSE) {
copy.stepWidth = null;
}
}
}
{
Boolean relativeAccuracyShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.relativeAccuracy!= null));
if (relativeAccuracyShouldBeCopiedAndSet == Boolean.TRUE) {
BigDecimal sourceRelativeAccuracy;
sourceRelativeAccuracy = this.getRelativeAccuracy();
BigDecimal copyRelativeAccuracy = ((BigDecimal) strategy.copy(LocatorUtils.property(locator, "relativeAccuracy", sourceRelativeAccuracy), sourceRelativeAccuracy, (this.relativeAccuracy!= null)));
copy.setRelativeAccuracy(copyRelativeAccuracy);
} else {
if (relativeAccuracyShouldBeCopiedAndSet == Boolean.FALSE) {
copy.relativeAccuracy = null;
}
}
}
{
Boolean absoluteAccuracyShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.absoluteAccuracy!= null));
if (absoluteAccuracyShouldBeCopiedAndSet == Boolean.TRUE) {
BigDecimal sourceAbsoluteAccuracy;
sourceAbsoluteAccuracy = this.getAbsoluteAccuracy();
BigDecimal copyAbsoluteAccuracy = ((BigDecimal) strategy.copy(LocatorUtils.property(locator, "absoluteAccuracy", sourceAbsoluteAccuracy), sourceAbsoluteAccuracy, (this.absoluteAccuracy!= null)));
copy.setAbsoluteAccuracy(copyAbsoluteAccuracy);
} else {
if (absoluteAccuracyShouldBeCopiedAndSet == Boolean.FALSE) {
copy.absoluteAccuracy = null;
}
}
}
}
return draftCopy;
}
@Override
public Object createNewInstance() {
return new Range();
}
}