no.digipost.org.w3.xlink.Locator Maven / Gradle / Ivy
//
// This file was generated by the Eclipse Implementation of JAXB, v2.3.7
// See https://eclipse-ee4j.github.io/jaxb-ri
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2024.11.06 at 01:54:33 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.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
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;
/**
* Java class for locatorType complex type.
*
*
The following schema fragment specifies the expected content contained within this class.
*
*
* <complexType name="locatorType">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <group ref="{http://www.w3.org/1999/xlink}locatorModel"/>
* <attGroup ref="{http://www.w3.org/1999/xlink}locatorAttrs"/>
* </restriction>
* </complexContent>
* </complexType>
*
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "locatorType", propOrder = {
"titles"
})
@XmlRootElement(name = "locator")
public abstract class Locator implements Equals2, HashCode2, ToString2
{
@XmlElement(name = "title")
protected List titles;
@XmlAttribute(name = "type", namespace = "http://www.w3.org/1999/xlink", required = true)
protected TypeType type;
@XmlAttribute(name = "href", namespace = "http://www.w3.org/1999/xlink", required = true)
protected String href;
@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 Locator() {
super();
}
/**
* Fully-initialising value constructor
*
*/
public Locator(final List titles, final TypeType type, final String href, final String role, final String title, final String label) {
this.titles = titles;
this.type = type;
this.href = href;
this.role = role;
this.title = title;
this.label = label;
}
/**
* Gets the value of the titles 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 titles property.
*
*
* For example, to add a new item, do as follows:
*
* getTitles().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link Title }
*
*
*/
public List
getTitles() {
if (titles == null) {
titles = new ArrayList();
}
return this.titles;
}
/**
* Gets the value of the type property.
*
* @return
* possible object is
* {@link TypeType }
*
*/
public TypeType getType() {
if (type == null) {
return TypeType.LOCATOR;
} 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 href property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getHref() {
return href;
}
/**
* Sets the value of the href property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setHref(String value) {
this.href = 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;
}
/**
*
* label is not required, but locators have no particular
* XLink function if they are not labeled.
*
*
* @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 setTitles(List value) {
this.titles = null;
if (value!= null) {
List draftl = this.getTitles();
draftl.addAll(value);
}
}
@Override
public String toString() {
final ToStringStrategy2 strategy = JAXBToStringStrategy.getInstance();
final StringBuilder buffer = new StringBuilder();
append(null, buffer, strategy);
return buffer.toString();
}
@Override
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;
}
@Override
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) {
{
List theTitles;
theTitles = (((this.titles!= null)&&(!this.titles.isEmpty()))?this.getTitles():null);
strategy.appendField(locator, this, "titles", buffer, theTitles, ((this.titles!= null)&&(!this.titles.isEmpty())));
}
{
TypeType theType;
theType = this.getType();
strategy.appendField(locator, this, "type", buffer, theType, (this.type!= null));
}
{
String theHref;
theHref = this.getHref();
strategy.appendField(locator, this, "href", buffer, theHref, (this.href!= 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;
}
@Override
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 Locator that = ((Locator) object);
{
List lhsTitles;
lhsTitles = (((this.titles!= null)&&(!this.titles.isEmpty()))?this.getTitles():null);
List rhsTitles;
rhsTitles = (((that.titles!= null)&&(!that.titles.isEmpty()))?that.getTitles():null);
if (!strategy.equals(LocatorUtils.property(thisLocator, "titles", lhsTitles), LocatorUtils.property(thatLocator, "titles", rhsTitles), lhsTitles, rhsTitles, ((this.titles!= null)&&(!this.titles.isEmpty())), ((that.titles!= null)&&(!that.titles.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 lhsHref;
lhsHref = this.getHref();
String rhsHref;
rhsHref = that.getHref();
if (!strategy.equals(LocatorUtils.property(thisLocator, "href", lhsHref), LocatorUtils.property(thatLocator, "href", rhsHref), lhsHref, rhsHref, (this.href!= null), (that.href!= 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;
}
@Override
public boolean equals(Object object) {
final EqualsStrategy2 strategy = JAXBEqualsStrategy.getInstance();
return equals(null, null, object, strategy);
}
@Override
public int hashCode(ObjectLocator locator, HashCodeStrategy2 strategy) {
int currentHashCode = 1;
{
List theTitles;
theTitles = (((this.titles!= null)&&(!this.titles.isEmpty()))?this.getTitles():null);
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "titles", theTitles), currentHashCode, theTitles, ((this.titles!= null)&&(!this.titles.isEmpty())));
}
{
TypeType theType;
theType = this.getType();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "type", theType), currentHashCode, theType, (this.type!= null));
}
{
String theHref;
theHref = this.getHref();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "href", theHref), currentHashCode, theHref, (this.href!= 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;
}
@Override
public int hashCode() {
final HashCodeStrategy2 strategy = JAXBHashCodeStrategy.getInstance();
return this.hashCode(null, strategy);
}
public Locator withTitles(Title... values) {
if (values!= null) {
for (Title value: values) {
getTitles().add(value);
}
}
return this;
}
public Locator withTitles(Collection values) {
if (values!= null) {
getTitles().addAll(values);
}
return this;
}
public Locator withType(TypeType value) {
setType(value);
return this;
}
public Locator withHref(String value) {
setHref(value);
return this;
}
public Locator withRole(String value) {
setRole(value);
return this;
}
public Locator withTitle(String value) {
setTitle(value);
return this;
}
public Locator withLabel(String value) {
setLabel(value);
return this;
}
public Locator withTitles(List value) {
setTitles(value);
return this;
}
}