Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
org.somda.sdc.dpws.model.Relationship Maven / Gradle / Ivy
package org.somda.sdc.dpws.model;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.xml.namespace.QName;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAnyAttribute;
import jakarta.xml.bind.annotation.XmlAnyElement;
import jakarta.xml.bind.annotation.XmlAttribute;
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.w3c.dom.Element;
/**
* 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 = {
"any"
})
@XmlRootElement(name = "Relationship", namespace = "http://docs.oasis-open.org/ws-dd/ns/dpws/2009/01")
public class Relationship implements Cloneable, CopyTo, ToString
{
@XmlAnyElement(lax = true)
protected List any;
@XmlAttribute(name = "Type", required = true)
protected String type;
@XmlAnyAttribute
private Map otherAttributes = new HashMap<>();
/**
* Gets the value of the any 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 any property.
*
*
* For example, to add a new item, do as follows:
*
*
* getAny().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link Object }
* {@link Element }
*
*
*
* @return
* The value of the any property.
*/
public List getAny() {
if (any == null) {
any = new ArrayList<>();
}
return this.any;
}
/**
* Gets the value of the type property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getType() {
return type;
}
/**
* Sets the value of the type property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setType(String value) {
this.type = value;
}
/**
* Gets a map that contains attributes that aren't bound to any typed property on this class.
*
*
* the map is keyed by the name of the attribute and
* the value is the string value of the attribute.
*
* the map returned by this method is live, and you can add new attribute
* by updating the map directly. Because of this design, there's no setter.
*
*
* @return
* always non-null
*/
public Map getOtherAttributes() {
return otherAttributes;
}
public void setAny(List value) {
this.any = null;
if (value!= null) {
List draftl = this.getAny();
draftl.addAll(value);
}
}
@Override
public boolean equals(Object object) {
if ((object == null)||(this.getClass()!= object.getClass())) {
return false;
}
if (this == object) {
return true;
}
final Relationship that = ((Relationship) object);
{
List leftAny;
leftAny = (((this.any!= null)&&(!this.any.isEmpty()))?this.getAny():null);
List rightAny;
rightAny = (((that.any!= null)&&(!that.any.isEmpty()))?that.getAny():null);
if ((this.any!= null)&&(!this.any.isEmpty())) {
if ((that.any!= null)&&(!that.any.isEmpty())) {
if (!leftAny.equals(rightAny)) {
return false;
}
} else {
return false;
}
} else {
if ((that.any!= null)&&(!that.any.isEmpty())) {
return false;
}
}
}
{
String leftType;
leftType = this.getType();
String rightType;
rightType = that.getType();
if (this.type!= null) {
if (that.type!= null) {
if (!leftType.equals(rightType)) {
return false;
}
} else {
return false;
}
} else {
if (that.type!= null) {
return false;
}
}
}
return true;
}
@Override
public int hashCode() {
int currentHashCode = 1;
{
currentHashCode = (currentHashCode* 31);
List theAny;
theAny = (((this.any!= null)&&(!this.any.isEmpty()))?this.getAny():null);
if ((this.any!= null)&&(!this.any.isEmpty())) {
currentHashCode += theAny.hashCode();
}
}
{
currentHashCode = (currentHashCode* 31);
String theType;
theType = this.getType();
if (this.type!= null) {
currentHashCode += theType.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) {
{
List theAny;
theAny = (((this.any!= null)&&(!this.any.isEmpty()))?this.getAny():null);
strategy.appendField(locator, this, "any", buffer, theAny, ((this.any!= null)&&(!this.any.isEmpty())));
}
{
String theType;
theType = this.getType();
strategy.appendField(locator, this, "type", buffer, theType, (this.type!= 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 Relationship) {
final Relationship copy = ((Relationship) draftCopy);
{
Boolean anyShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, ((this.any!= null)&&(!this.any.isEmpty())));
if (anyShouldBeCopiedAndSet == Boolean.TRUE) {
List sourceAny;
sourceAny = (((this.any!= null)&&(!this.any.isEmpty()))?this.getAny():null);
@SuppressWarnings("unchecked")
List copyAny = ((List ) strategy.copy(LocatorUtils.property(locator, "any", sourceAny), sourceAny, ((this.any!= null)&&(!this.any.isEmpty()))));
copy.setAny(copyAny);
} else {
if (anyShouldBeCopiedAndSet == Boolean.FALSE) {
copy.any = null;
}
}
}
{
Boolean typeShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.type!= null));
if (typeShouldBeCopiedAndSet == Boolean.TRUE) {
String sourceType;
sourceType = this.getType();
String copyType = ((String) strategy.copy(LocatorUtils.property(locator, "type", sourceType), sourceType, (this.type!= null)));
copy.setType(copyType);
} else {
if (typeShouldBeCopiedAndSet == Boolean.FALSE) {
copy.type = null;
}
}
}
}
return draftCopy;
}
@Override
public Object createNewInstance() {
return new Relationship();
}
}