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

eu.toop.edm.jaxb.w3.odrl.Policy Maven / Gradle / Ivy


package eu.toop.edm.jaxb.w3.odrl;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Nonnegative;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyAttribute;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlElementRefs;
import javax.xml.bind.annotation.XmlType;
import javax.xml.namespace.QName;
import com.helger.commons.annotation.CodingStyleguideUnaware;
import com.helger.commons.annotation.ReturnsMutableCopy;
import com.helger.commons.annotation.ReturnsMutableObject;
import com.helger.commons.equals.EqualsHelper;
import com.helger.commons.hashcode.HashCodeGenerator;
import com.helger.commons.lang.IExplicitlyCloneable;
import com.helger.commons.string.ToStringGenerator;
import org.w3c.dom.Element;


/**
 * 

Java class for Policy complex type. * *

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

 * <complexType name="Policy">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence maxOccurs="unbounded" minOccurs="0">
 *         <element ref="{http://www.w3.org/ns/odrl/2/}permission" maxOccurs="unbounded" minOccurs="0"/>
 *         <element ref="{http://www.w3.org/ns/odrl/2/}prohibition" maxOccurs="unbounded" minOccurs="0"/>
 *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
 *       </sequence>
 *       <attribute name="uid" use="required" type="{http://www.w3.org/ns/odrl/2/}URIQnameQcode" />
 *       <attribute name="type" use="required" type="{http://www.w3.org/ns/odrl/2/}URIQnameQcode" />
 *       <attribute name="conflict" type="{http://www.w3.org/ns/odrl/2/}ConflictTerm" />
 *       <attribute name="undefined" type="{http://www.w3.org/ns/odrl/2/}UndefinedTerm" />
 *       <attribute name="inheritAllowed" type="{http://www.w3.org/2001/XMLSchema}boolean" />
 *       <attribute name="inheritFrom" type="{http://www.w3.org/ns/odrl/2/}URIQnameQcode" />
 *       <attribute name="inheritRelation" type="{http://www.w3.org/ns/odrl/2/}URIQnameQcode" />
 *       <attribute name="profile" 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-list-extension

*

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 = "Policy", propOrder = { "permissionAndProhibitionAndAny" }) @CodingStyleguideUnaware public class Policy implements Serializable, IExplicitlyCloneable { @XmlElementRefs({ @XmlElementRef(name = "permission", namespace = "http://www.w3.org/ns/odrl/2/", type = JAXBElement.class, required = false), @XmlElementRef(name = "prohibition", namespace = "http://www.w3.org/ns/odrl/2/", type = JAXBElement.class, required = false) }) @XmlAnyElement(lax = true) private List permissionAndProhibitionAndAny; @XmlAttribute(name = "uid", required = true) private String uid; @XmlAttribute(name = "type", required = true) private String type; @XmlAttribute(name = "conflict") private ConflictTerm conflict; @XmlAttribute(name = "undefined") private UndefinedTerm undefined; @XmlAttribute(name = "inheritAllowed") private Boolean inheritAllowed; @XmlAttribute(name = "inheritFrom") private String inheritFrom; @XmlAttribute(name = "inheritRelation") private String inheritRelation; @XmlAttribute(name = "profile") private String profile; @XmlAnyAttribute private Map otherAttributes = new HashMap(); /** * Default constructor
* Note: automatically created by ph-jaxb22-plugin -Xph-value-extender * */ public Policy() { } /** * Gets the value of the permissionAndProhibitionAndAny 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 permissionAndProhibitionAndAny property. * *

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

     *    getPermissionAndProhibitionAndAny().add(newItem);
     * 
* * *

* Objects of the following type(s) are allowed in the list * {@link JAXBElement }{@code <}{@link Permission }{@code >} * {@link JAXBElement }{@code <}{@link Prohibition }{@code >} * {@link Element } * {@link Object } * * */ @Nonnull @ReturnsMutableObject("JAXB implementation style") public List getPermissionAndProhibitionAndAny() { if (permissionAndProhibitionAndAny == null) { permissionAndProhibitionAndAny = new ArrayList(); } return this.permissionAndProhibitionAndAny; } /** * 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 type property. * * @return * possible object is * {@link String } * */ @Nullable public String getType() { return type; } /** * Sets the value of the type property. * * @param value * allowed object is * {@link String } * */ public void setType( @Nullable String value) { this.type = value; } /** * Gets the value of the conflict property. * * @return * possible object is * {@link ConflictTerm } * */ @Nullable public ConflictTerm getConflict() { return conflict; } /** * Sets the value of the conflict property. * * @param value * allowed object is * {@link ConflictTerm } * */ public void setConflict( @Nullable ConflictTerm value) { this.conflict = value; } /** * Gets the value of the undefined property. * * @return * possible object is * {@link UndefinedTerm } * */ @Nullable public UndefinedTerm getUndefined() { return undefined; } /** * Sets the value of the undefined property. * * @param value * allowed object is * {@link UndefinedTerm } * */ public void setUndefined( @Nullable UndefinedTerm value) { this.undefined = value; } /** * Gets the value of the inheritAllowed property. * * @return * possible object is * {@link Boolean } * */ public Boolean isInheritAllowed() { return inheritAllowed; } /** * Sets the value of the inheritAllowed property. * * @param value * allowed object is * {@link Boolean } * */ public void setInheritAllowed( @Nullable Boolean value) { this.inheritAllowed = value; } /** * Gets the value of the inheritFrom property. * * @return * possible object is * {@link String } * */ @Nullable public String getInheritFrom() { return inheritFrom; } /** * Sets the value of the inheritFrom property. * * @param value * allowed object is * {@link String } * */ public void setInheritFrom( @Nullable String value) { this.inheritFrom = value; } /** * Gets the value of the inheritRelation property. * * @return * possible object is * {@link String } * */ @Nullable public String getInheritRelation() { return inheritRelation; } /** * Sets the value of the inheritRelation property. * * @param value * allowed object is * {@link String } * */ public void setInheritRelation( @Nullable String value) { this.inheritRelation = value; } /** * Gets the value of the profile property. * * @return * possible object is * {@link String } * */ @Nullable public String getProfile() { return profile; } /** * Sets the value of the profile property. * * @param value * allowed object is * {@link String } * */ public void setProfile( @Nullable String value) { this.profile = 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 Policy rhs = ((Policy) o); if (!EqualsHelper.equals(conflict, rhs.conflict)) { return false; } if (!EqualsHelper.equals(inheritAllowed, rhs.inheritAllowed)) { return false; } if (!EqualsHelper.equals(inheritFrom, rhs.inheritFrom)) { return false; } if (!EqualsHelper.equals(inheritRelation, rhs.inheritRelation)) { return false; } if (!EqualsHelper.equals(otherAttributes, rhs.otherAttributes)) { return false; } if (!EqualsHelper.equalsCollection(permissionAndProhibitionAndAny, rhs.permissionAndProhibitionAndAny)) { return false; } if (!EqualsHelper.equals(profile, rhs.profile)) { return false; } if (!EqualsHelper.equals(type, rhs.type)) { return false; } if (!EqualsHelper.equals(uid, rhs.uid)) { return false; } if (!EqualsHelper.equals(undefined, rhs.undefined)) { return false; } return true; } /** * Created by ph-jaxb22-plugin -Xph-equalshashcode * */ @Override public int hashCode() { return new HashCodeGenerator(this).append(conflict).append(inheritAllowed).append(inheritFrom).append(inheritRelation).append(otherAttributes).append(permissionAndProhibitionAndAny).append(profile).append(type).append(uid).append(undefined).getHashCode(); } /** * Created by ph-jaxb22-plugin -Xph-tostring * */ @Override public String toString() { return new ToStringGenerator(this).append("conflict", conflict).append("inheritAllowed", inheritAllowed).append("inheritFrom", inheritFrom).append("inheritRelation", inheritRelation).append("otherAttributes", otherAttributes).append("permissionAndProhibitionAndAny", permissionAndProhibitionAndAny).append("profile", profile).append("type", type).append("uid", uid).append("undefined", undefined).getToString(); } /** * Created by ph-jaxb22-plugin -Xph-list-extension * * @param aList * The new list member to set. May be null. */ public void setPermissionAndProhibitionAndAny( @Nullable final List aList) { permissionAndProhibitionAndAny = aList; } /** * Created by ph-jaxb22-plugin -Xph-list-extension * * @return * true if at least one item is contained, false otherwise. */ public boolean hasPermissionAndProhibitionAndAnyEntries() { return (!getPermissionAndProhibitionAndAny().isEmpty()); } /** * Created by ph-jaxb22-plugin -Xph-list-extension * * @return * true if no item is contained, false otherwise. */ public boolean hasNoPermissionAndProhibitionAndAnyEntries() { return getPermissionAndProhibitionAndAny().isEmpty(); } /** * Created by ph-jaxb22-plugin -Xph-list-extension * * @return * The number of contained elements. Always ≥ 0. */ @Nonnegative public int getPermissionAndProhibitionAndAnyCount() { return getPermissionAndProhibitionAndAny().size(); } /** * Created by ph-jaxb22-plugin -Xph-list-extension * * @param index * The index to retrieve * @return * The element at the specified index. May be null * @throws IndexOutOfBoundsException * if the index is invalid! */ @Nullable public Object getPermissionAndProhibitionAndAnyAtIndex( @Nonnegative final int index) throws IndexOutOfBoundsException { return getPermissionAndProhibitionAndAny().get(index); } /** * Created by ph-jaxb22-plugin -Xph-list-extension * * @param elem * The element to be added. May not be null. */ public void addPermissionAndProhibitionAndAny( @Nonnull final Object elem) { getPermissionAndProhibitionAndAny().add(elem); } /** * 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 Policy ret) { ret.conflict = conflict; ret.inheritAllowed = inheritAllowed; ret.inheritFrom = inheritFrom; ret.inheritRelation = inheritRelation; if (otherAttributes == null) { ret.otherAttributes = null; } else { ret.otherAttributes = new HashMap(otherAttributes); } if (permissionAndProhibitionAndAny == null) { ret.permissionAndProhibitionAndAny = null; } else { List retPermissionAndProhibitionAndAny = new ArrayList(); for (Object aItem: getPermissionAndProhibitionAndAny()) { retPermissionAndProhibitionAndAny.add(aItem); } ret.permissionAndProhibitionAndAny = retPermissionAndProhibitionAndAny; } ret.profile = profile; ret.type = type; ret.uid = uid; ret.undefined = undefined; } /** * Created by ph-jaxb22-plugin -Xph-cloneable2 * * @return * The cloned object. Never null. */ @Nonnull @ReturnsMutableCopy @Override public Policy clone() { Policy ret = new Policy(); cloneTo(ret); return ret; } }