eu.toop.edm.jaxb.w3.odrl.Asset Maven / Gradle / Ivy
package eu.toop.edm.jaxb.w3.odrl;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyAttribute;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlID;
import javax.xml.bind.annotation.XmlIDREF;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import javax.xml.namespace.QName;
import com.helger.commons.annotation.CodingStyleguideUnaware;
import com.helger.commons.annotation.ReturnsMutableCopy;
import com.helger.commons.equals.EqualsHelper;
import com.helger.commons.hashcode.HashCodeGenerator;
import com.helger.commons.lang.IExplicitlyCloneable;
import com.helger.commons.string.ToStringGenerator;
/**
* Java class for Asset complex type.
*
*
The following schema fragment specifies the expected content contained within this class.
*
*
* <complexType name="Asset">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <attGroup ref="{http://www.w3.org/ns/odrl/2/}idAttributes"/>
* <attribute name="uid" type="{http://www.w3.org/ns/odrl/2/}URIQnameQcode" />
* <attribute name="relation" type="{http://www.w3.org/ns/odrl/2/}URIQnameQcode" />
* <anyAttribute processContents='lax' namespace='##other'/>
* </restriction>
* </complexContent>
* </complexType>
*
* This class was annotated by ph-jaxb22-plugin -Xph-annotate
* This class contains methods created by ph-jaxb22-plugin -Xph-equalshashcode
* This class contains methods created by ph-jaxb22-plugin -Xph-tostring
* This class contains methods created by ph-jaxb22-plugin -Xph-cloneable2
* This class contains methods created by ph-jaxb22-plugin -Xph-value-extender
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Asset")
@CodingStyleguideUnaware
public class Asset implements Serializable, IExplicitlyCloneable
{
@XmlAttribute(name = "uid")
private String uid;
@XmlAttribute(name = "relation")
private String relation;
@XmlAttribute(name = "id")
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
@XmlID
@XmlSchemaType(name = "ID")
private String id;
@XmlAttribute(name = "idref")
@XmlIDREF
@XmlSchemaType(name = "IDREF")
private Object idref;
@XmlAnyAttribute
private Map otherAttributes = new HashMap();
/**
* Default constructor
* Note: automatically created by ph-jaxb22-plugin -Xph-value-extender
*
*/
public Asset() {
}
/**
* Gets the value of the uid property.
*
* @return
* possible object is
* {@link String }
*
*/
@Nullable
public String getUid() {
return uid;
}
/**
* Sets the value of the uid property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setUid(
@Nullable
String value) {
this.uid = value;
}
/**
* Gets the value of the relation property.
*
* @return
* possible object is
* {@link String }
*
*/
@Nullable
public String getRelation() {
return relation;
}
/**
* Sets the value of the relation property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setRelation(
@Nullable
String value) {
this.relation = value;
}
/**
* Gets the value of the id property.
*
* @return
* possible object is
* {@link String }
*
*/
@Nullable
public String getId() {
return id;
}
/**
* Sets the value of the id property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setId(
@Nullable
String value) {
this.id = value;
}
/**
* Gets the value of the idref property.
*
* @return
* possible object is
* {@link Object }
*
*/
@Nullable
public Object getIdref() {
return idref;
}
/**
* Sets the value of the idref property.
*
* @param value
* allowed object is
* {@link Object }
*
*/
public void setIdref(
@Nullable
Object value) {
this.idref = 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
*/
@Nullable
public Map getOtherAttributes() {
return otherAttributes;
}
/**
* Created by ph-jaxb22-plugin -Xph-equalshashcode
*
*/
@Override
public boolean equals(final Object o) {
if (o == this) {
return true;
}
if ((o == null)||(!getClass().equals(o.getClass()))) {
return false;
}
final Asset rhs = ((Asset) o);
if (!EqualsHelper.equals(id, rhs.id)) {
return false;
}
if (!EqualsHelper.equals(idref, rhs.idref)) {
return false;
}
if (!EqualsHelper.equals(otherAttributes, rhs.otherAttributes)) {
return false;
}
if (!EqualsHelper.equals(relation, rhs.relation)) {
return false;
}
if (!EqualsHelper.equals(uid, rhs.uid)) {
return false;
}
return true;
}
/**
* Created by ph-jaxb22-plugin -Xph-equalshashcode
*
*/
@Override
public int hashCode() {
return new HashCodeGenerator(this).append(id).append(idref).append(otherAttributes).append(relation).append(uid).getHashCode();
}
/**
* Created by ph-jaxb22-plugin -Xph-tostring
*
*/
@Override
public String toString() {
return new ToStringGenerator(this).append("id", id).append("idref", idref).append("otherAttributes", otherAttributes).append("relation", relation).append("uid", uid).getToString();
}
/**
* This method clones all values from this
to the passed object. All data in the parameter object is overwritten!Created by ph-jaxb22-plugin -Xph-cloneable2
*
* @param ret
* The target object to clone to. May not be null
.
*/
public void cloneTo(
@Nonnull
Asset ret) {
ret.id = id;
ret.idref = idref;
if (otherAttributes == null) {
ret.otherAttributes = null;
} else {
ret.otherAttributes = new HashMap(otherAttributes);
}
ret.relation = relation;
ret.uid = uid;
}
/**
* Created by ph-jaxb22-plugin -Xph-cloneable2
*
* @return
* The cloned object. Never null
.
*/
@Nonnull
@ReturnsMutableCopy
@Override
public Asset clone() {
Asset ret = new Asset();
cloneTo(ret);
return ret;
}
}