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

no.digipost.org.w3.xlink.Resource Maven / Gradle / Ivy

//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.0 
// See https://javaee.github.io/jaxb-v2/ 
// Any modifications to this file will be lost upon recompilation of the source schema. 
// Generated on: 2021.12.01 at 12:54:39 PM UTC 
//


package no.digipost.org.w3.xlink;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlMixed;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.jvnet.jaxb2_commons.lang.Equals2;
import org.jvnet.jaxb2_commons.lang.EqualsStrategy2;
import org.jvnet.jaxb2_commons.lang.HashCode2;
import org.jvnet.jaxb2_commons.lang.HashCodeStrategy2;
import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBToStringStrategy;
import org.jvnet.jaxb2_commons.lang.ToString2;
import org.jvnet.jaxb2_commons.lang.ToStringStrategy2;
import org.jvnet.jaxb2_commons.locator.ObjectLocator;
import org.jvnet.jaxb2_commons.locator.util.LocatorUtils;
import org.w3c.dom.Element;


/**
 * 

Java class for resourceType complex type. * *

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

 * <complexType name="resourceType">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <group ref="{http://www.w3.org/1999/xlink}resourceModel"/>
 *       <attGroup ref="{http://www.w3.org/1999/xlink}resourceAttrs"/>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 * 
* * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "resourceType", propOrder = { "content" }) @XmlRootElement(name = "resource") public abstract class Resource implements Equals2, HashCode2, ToString2 { @XmlMixed @XmlAnyElement(lax = true) protected List content; @XmlAttribute(name = "type", namespace = "http://www.w3.org/1999/xlink", required = true) protected TypeType type; @XmlAttribute(name = "role", namespace = "http://www.w3.org/1999/xlink") protected String role; @XmlAttribute(name = "title", namespace = "http://www.w3.org/1999/xlink") protected String title; @XmlAttribute(name = "label", namespace = "http://www.w3.org/1999/xlink") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) protected String label; /** * Default no-arg constructor * */ public Resource() { super(); } /** * Fully-initialising value constructor * */ public Resource(final List content, final TypeType type, final String role, final String title, final String label) { this.content = content; this.type = type; this.role = role; this.title = title; this.label = label; } /** * Gets the value of the content 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 content property. * *

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

     *    getContent().add(newItem);
     * 
* * *

* Objects of the following type(s) are allowed in the list * {@link Element } * {@link Object } * {@link String } * * */ public List getContent() { if (content == null) { content = new ArrayList(); } return this.content; } /** * Gets the value of the type property. * * @return * possible object is * {@link TypeType } * */ public TypeType getType() { if (type == null) { return TypeType.RESOURCE; } else { return type; } } /** * Sets the value of the type property. * * @param value * allowed object is * {@link TypeType } * */ public void setType(TypeType value) { this.type = value; } /** * Gets the value of the role property. * * @return * possible object is * {@link String } * */ public String getRole() { return role; } /** * Sets the value of the role property. * * @param value * allowed object is * {@link String } * */ public void setRole(String value) { this.role = value; } /** * Gets the value of the title property. * * @return * possible object is * {@link String } * */ public String getTitle() { return title; } /** * Sets the value of the title property. * * @param value * allowed object is * {@link String } * */ public void setTitle(String value) { this.title = value; } /** * Gets the value of the label property. * * @return * possible object is * {@link String } * */ public String getLabel() { return label; } /** * Sets the value of the label property. * * @param value * allowed object is * {@link String } * */ public void setLabel(String value) { this.label = value; } public void setContent(List value) { this.content = null; if (value!= null) { List draftl = this.getContent(); draftl.addAll(value); } } public String toString() { final ToStringStrategy2 strategy = JAXBToStringStrategy.INSTANCE2; final StringBuilder buffer = new StringBuilder(); append(null, buffer, strategy); return buffer.toString(); } public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) { strategy.appendStart(locator, this, buffer); appendFields(locator, buffer, strategy); strategy.appendEnd(locator, this, buffer); return buffer; } public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) { { List theContent; theContent = (((this.content!= null)&&(!this.content.isEmpty()))?this.getContent():null); strategy.appendField(locator, this, "content", buffer, theContent, ((this.content!= null)&&(!this.content.isEmpty()))); } { TypeType theType; theType = this.getType(); strategy.appendField(locator, this, "type", buffer, theType, (this.type!= null)); } { String theRole; theRole = this.getRole(); strategy.appendField(locator, this, "role", buffer, theRole, (this.role!= null)); } { String theTitle; theTitle = this.getTitle(); strategy.appendField(locator, this, "title", buffer, theTitle, (this.title!= null)); } { String theLabel; theLabel = this.getLabel(); strategy.appendField(locator, this, "label", buffer, theLabel, (this.label!= null)); } return buffer; } public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy2 strategy) { if ((object == null)||(this.getClass()!= object.getClass())) { return false; } if (this == object) { return true; } final Resource that = ((Resource) object); { List lhsContent; lhsContent = (((this.content!= null)&&(!this.content.isEmpty()))?this.getContent():null); List rhsContent; rhsContent = (((that.content!= null)&&(!that.content.isEmpty()))?that.getContent():null); if (!strategy.equals(LocatorUtils.property(thisLocator, "content", lhsContent), LocatorUtils.property(thatLocator, "content", rhsContent), lhsContent, rhsContent, ((this.content!= null)&&(!this.content.isEmpty())), ((that.content!= null)&&(!that.content.isEmpty())))) { return false; } } { TypeType lhsType; lhsType = this.getType(); TypeType rhsType; rhsType = that.getType(); if (!strategy.equals(LocatorUtils.property(thisLocator, "type", lhsType), LocatorUtils.property(thatLocator, "type", rhsType), lhsType, rhsType, (this.type!= null), (that.type!= null))) { return false; } } { String lhsRole; lhsRole = this.getRole(); String rhsRole; rhsRole = that.getRole(); if (!strategy.equals(LocatorUtils.property(thisLocator, "role", lhsRole), LocatorUtils.property(thatLocator, "role", rhsRole), lhsRole, rhsRole, (this.role!= null), (that.role!= null))) { return false; } } { String lhsTitle; lhsTitle = this.getTitle(); String rhsTitle; rhsTitle = that.getTitle(); if (!strategy.equals(LocatorUtils.property(thisLocator, "title", lhsTitle), LocatorUtils.property(thatLocator, "title", rhsTitle), lhsTitle, rhsTitle, (this.title!= null), (that.title!= null))) { return false; } } { String lhsLabel; lhsLabel = this.getLabel(); String rhsLabel; rhsLabel = that.getLabel(); if (!strategy.equals(LocatorUtils.property(thisLocator, "label", lhsLabel), LocatorUtils.property(thatLocator, "label", rhsLabel), lhsLabel, rhsLabel, (this.label!= null), (that.label!= null))) { return false; } } return true; } public boolean equals(Object object) { final EqualsStrategy2 strategy = JAXBEqualsStrategy.INSTANCE2; return equals(null, null, object, strategy); } public int hashCode(ObjectLocator locator, HashCodeStrategy2 strategy) { int currentHashCode = 1; { List theContent; theContent = (((this.content!= null)&&(!this.content.isEmpty()))?this.getContent():null); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "content", theContent), currentHashCode, theContent, ((this.content!= null)&&(!this.content.isEmpty()))); } { TypeType theType; theType = this.getType(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "type", theType), currentHashCode, theType, (this.type!= null)); } { String theRole; theRole = this.getRole(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "role", theRole), currentHashCode, theRole, (this.role!= null)); } { String theTitle; theTitle = this.getTitle(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "title", theTitle), currentHashCode, theTitle, (this.title!= null)); } { String theLabel; theLabel = this.getLabel(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "label", theLabel), currentHashCode, theLabel, (this.label!= null)); } return currentHashCode; } public int hashCode() { final HashCodeStrategy2 strategy = JAXBHashCodeStrategy.INSTANCE2; return this.hashCode(null, strategy); } public Resource withContent(Object... values) { if (values!= null) { for (Object value: values) { getContent().add(value); } } return this; } public Resource withContent(Collection values) { if (values!= null) { getContent().addAll(values); } return this; } public Resource withType(TypeType value) { setType(value); return this; } public Resource withRole(String value) { setRole(value); return this; } public Resource withTitle(String value) { setTitle(value); return this; } public Resource withLabel(String value) { setLabel(value); return this; } public Resource withContent(List value) { setContent(value); return this; } }