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

com.helger.xsds.xlink.XLinkExtended Maven / Gradle / Ivy

The newest version!

package com.helger.xsds.xlink;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Nonnegative;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
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 jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlElements;
import jakarta.xml.bind.annotation.XmlType;


/**
 * 
 *     Intended for use as the type of user-declared elements to make them
 *     extended links.
 *     Note that the elements referenced in the content model are all abstract.
 *     The intention is that by simply declaring elements with these as their
 *     substitutionGroup, all the right things will happen.
 *    
 * 
 * 

Java class for extended complex type. * *

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

{@code
 * 
 *   
 *     
 *       
 *       
 *     
 *   
 * 
 * }
*

This class was annotated by ph-jaxb-plugin -Xph-annotate

*

This class contains methods created by ph-jaxb-plugin -Xph-equalshashcode

*

This class contains methods created by ph-jaxb-plugin -Xph-tostring

*

This class contains methods created by ph-jaxb-plugin -Xph-list-extension

*

This class contains methods created by ph-jaxb-plugin -Xph-cloneable2

*

This class contains methods created by ph-jaxb-plugin -Xph-value-extender

* * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "extended", propOrder = { "extendedModel" }) @CodingStyleguideUnaware public class XLinkExtended implements Serializable, IExplicitlyCloneable { @XmlElements({ @XmlElement(name = "title", type = XLinkTitleEltType.class), @XmlElement(name = "resource", type = XLinkResourceType.class), @XmlElement(name = "locator", type = XLinkLocatorType.class), @XmlElement(name = "arc", type = XLinkArcType.class) }) private List extendedModel; /** * * */ @XmlAttribute(name = "type", namespace = "http://www.w3.org/1999/xlink", required = true) private final static XLinkTypeType TYPE = XLinkTypeType.EXTENDED; @XmlAttribute(name = "role", namespace = "http://www.w3.org/1999/xlink") private String role; @XmlAttribute(name = "title", namespace = "http://www.w3.org/1999/xlink") private String title; /** * Default constructor
* Note: automatically created by ph-jaxb-plugin -Xph-value-extender * */ public XLinkExtended() { } /** * Gets the value of the extendedModel 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 Jakarta XML Binding object. * This is why there is not a {@code set} method for the extendedModel property. * *

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

     *    getExtendedModel().add(newItem);
     * 
* * *

* Objects of the following type(s) are allowed in the list * {@link XLinkArcType } * {@link XLinkLocatorType } * {@link XLinkResourceType } * {@link XLinkTitleEltType } * * * @return * The value of the extendedModel property. */ @Nonnull @ReturnsMutableObject("JAXB implementation style") public List getExtendedModel() { if (extendedModel == null) { extendedModel = new ArrayList<>(); } return this.extendedModel; } /** * Gets the value of the role property. * * @return * possible object is * {@link String } * */ @Nullable public String getRole() { return role; } /** * Sets the value of the role property. * * @param value * allowed object is * {@link String } * */ public void setRole( @Nullable String value) { this.role = value; } /** * Gets the value of the title property. * * @return * possible object is * {@link String } * */ @Nullable public String getTitle() { return title; } /** * Sets the value of the title property. * * @param value * allowed object is * {@link String } * */ public void setTitle( @Nullable String value) { this.title = value; } /** * Created by ph-jaxb-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 XLinkExtended rhs = ((XLinkExtended) o); if (!EqualsHelper.equalsCollection(extendedModel, rhs.extendedModel)) { return false; } if (!EqualsHelper.equals(role, rhs.role)) { return false; } if (!EqualsHelper.equals(title, rhs.title)) { return false; } return true; } /** * Created by ph-jaxb-plugin -Xph-equalshashcode * */ @Override public int hashCode() { return new HashCodeGenerator(this).append(extendedModel).append(role).append(title).getHashCode(); } /** * Created by ph-jaxb-plugin -Xph-tostring * */ @Override public String toString() { return new ToStringGenerator(this).append("extendedModel", extendedModel).append("role", role).append("title", title).getToString(); } /** * Created by ph-jaxb-plugin -Xph-list-extension * * @param aList * The new list member to set. May be null. */ public void setExtendedModel( @Nullable final List aList) { extendedModel = aList; } /** * Created by ph-jaxb-plugin -Xph-list-extension * * @return * true if at least one item is contained, false otherwise. */ public boolean hasExtendedModelEntries() { return (!getExtendedModel().isEmpty()); } /** * Created by ph-jaxb-plugin -Xph-list-extension * * @return * true if no item is contained, false otherwise. */ public boolean hasNoExtendedModelEntries() { return getExtendedModel().isEmpty(); } /** * Created by ph-jaxb-plugin -Xph-list-extension * * @return * The number of contained elements. Always ≥ 0. */ @Nonnegative public int getExtendedModelCount() { return getExtendedModel().size(); } /** * Created by ph-jaxb-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 getExtendedModelAtIndex( @Nonnegative final int index) throws IndexOutOfBoundsException { return getExtendedModel().get(index); } /** * Created by ph-jaxb-plugin -Xph-list-extension * * @param elem * The element to be added. May not be null. */ public void addExtendedModel( @Nonnull final Object elem) { getExtendedModel().add(elem); } /** * This method clones all values from this to the passed object. All data in the parameter object is overwritten!Created by ph-jaxb-plugin -Xph-cloneable2 * * @param ret * The target object to clone to. May not be null. */ public void cloneTo( @Nonnull XLinkExtended ret) { if (extendedModel == null) { ret.extendedModel = null; } else { List retExtendedModel = new ArrayList<>(); for (Object aItem: getExtendedModel()) { retExtendedModel.add(aItem); } ret.extendedModel = retExtendedModel; } ret.role = role; ret.title = title; } /** * Created by ph-jaxb-plugin -Xph-cloneable2 * * @return * The cloned object. Never null. */ @Nonnull @ReturnsMutableCopy @Override public XLinkExtended clone() { XLinkExtended ret = new XLinkExtended(); cloneTo(ret); return ret; } }