org.somda.sdc.biceps.model.participant.LocationReference 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.util.ArrayList;
import java.util.List;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
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 reference to an identifiable location with human readable location details.
*
* Java class for LocationReference complex type
.
*
* The following schema fragment specifies the expected content contained within this class.
*
* {@code
*
*
*
*
*
*
*
*
*
*
*
* }
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "LocationReference", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/participant", propOrder = {
"extension",
"identification",
"locationDetail"
})
public class LocationReference implements Cloneable, CopyTo, ToString
{
@XmlElement(name = "Extension", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/extension")
protected ExtensionType extension;
/**
* The list of identifiers for the location.
*
*/
@XmlElement(name = "Identification", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/participant", required = true)
protected List identification;
/**
* Human readable location details which are intended for information purposes only.
*
*/
@XmlElement(name = "LocationDetail", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/participant")
protected LocationDetail locationDetail;
/**
* 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 list of identifiers for the location.
*
* Gets the value of the identification 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 identification property.
*
*
* For example, to add a new item, do as follows:
*
*
* getIdentification().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link InstanceIdentifier }
*
*
*
* @return
* The value of the identification property.
*/
public List getIdentification() {
if (identification == null) {
identification = new ArrayList<>();
}
return this.identification;
}
/**
* Human readable location details which are intended for information purposes only.
*
* @return
* possible object is
* {@link LocationDetail }
*
*/
@Nullable
public LocationDetail getLocationDetail() {
return locationDetail;
}
/**
* Sets the value of the locationDetail property.
*
* @param value
* allowed object is
* {@link LocationDetail }
*
* @see #getLocationDetail()
*/
public void setLocationDetail(
@Nullable
LocationDetail value) {
this.locationDetail = value;
}
public void setIdentification(List value) {
this.identification = null;
if (value!= null) {
List draftl = this.getIdentification();
draftl.addAll(value);
}
}
@Override
public boolean equals(Object object) {
if ((object == null)||(this.getClass()!= object.getClass())) {
return false;
}
if (this == object) {
return true;
}
final LocationReference that = ((LocationReference) 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;
}
}
}
{
List leftIdentification;
leftIdentification = (((this.identification!= null)&&(!this.identification.isEmpty()))?this.getIdentification():null);
List rightIdentification;
rightIdentification = (((that.identification!= null)&&(!that.identification.isEmpty()))?that.getIdentification():null);
if ((this.identification!= null)&&(!this.identification.isEmpty())) {
if ((that.identification!= null)&&(!that.identification.isEmpty())) {
if (!leftIdentification.equals(rightIdentification)) {
return false;
}
} else {
return false;
}
} else {
if ((that.identification!= null)&&(!that.identification.isEmpty())) {
return false;
}
}
}
{
LocationDetail leftLocationDetail;
leftLocationDetail = this.getLocationDetail();
LocationDetail rightLocationDetail;
rightLocationDetail = that.getLocationDetail();
if (this.locationDetail!= null) {
if (that.locationDetail!= null) {
if (!leftLocationDetail.equals(rightLocationDetail)) {
return false;
}
} else {
return false;
}
} else {
if (that.locationDetail!= 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);
List theIdentification;
theIdentification = (((this.identification!= null)&&(!this.identification.isEmpty()))?this.getIdentification():null);
if ((this.identification!= null)&&(!this.identification.isEmpty())) {
currentHashCode += theIdentification.hashCode();
}
}
{
currentHashCode = (currentHashCode* 31);
LocationDetail theLocationDetail;
theLocationDetail = this.getLocationDetail();
if (this.locationDetail!= null) {
currentHashCode += theLocationDetail.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));
}
{
List theIdentification;
theIdentification = (((this.identification!= null)&&(!this.identification.isEmpty()))?this.getIdentification():null);
strategy.appendField(locator, this, "identification", buffer, theIdentification, ((this.identification!= null)&&(!this.identification.isEmpty())));
}
{
LocationDetail theLocationDetail;
theLocationDetail = this.getLocationDetail();
strategy.appendField(locator, this, "locationDetail", buffer, theLocationDetail, (this.locationDetail!= 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 LocationReference) {
final LocationReference copy = ((LocationReference) 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 identificationShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, ((this.identification!= null)&&(!this.identification.isEmpty())));
if (identificationShouldBeCopiedAndSet == Boolean.TRUE) {
List sourceIdentification;
sourceIdentification = (((this.identification!= null)&&(!this.identification.isEmpty()))?this.getIdentification():null);
@SuppressWarnings("unchecked")
List copyIdentification = ((List ) strategy.copy(LocatorUtils.property(locator, "identification", sourceIdentification), sourceIdentification, ((this.identification!= null)&&(!this.identification.isEmpty()))));
copy.setIdentification(copyIdentification);
} else {
if (identificationShouldBeCopiedAndSet == Boolean.FALSE) {
copy.identification = null;
}
}
}
{
Boolean locationDetailShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.locationDetail!= null));
if (locationDetailShouldBeCopiedAndSet == Boolean.TRUE) {
LocationDetail sourceLocationDetail;
sourceLocationDetail = this.getLocationDetail();
LocationDetail copyLocationDetail = ((LocationDetail) strategy.copy(LocatorUtils.property(locator, "locationDetail", sourceLocationDetail), sourceLocationDetail, (this.locationDetail!= null)));
copy.setLocationDetail(copyLocationDetail);
} else {
if (locationDetailShouldBeCopiedAndSet == Boolean.FALSE) {
copy.locationDetail = null;
}
}
}
}
return draftCopy;
}
@Override
public Object createNewInstance() {
return new LocationReference();
}
}