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

com.phloc.genericode.v04.AnyOtherLanguageContent Maven / Gradle / Ivy


package com.phloc.genericode.v04;

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 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.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import com.phloc.commons.annotations.ReturnsMutableObject;
import com.phloc.commons.equals.EqualsUtils;
import com.phloc.commons.hash.HashCodeGenerator;
import com.phloc.commons.string.ToStringGenerator;


/**
 * Container for any human-readable XML content which is in a different namespace to the Schema's target namespace.
 * 
 * 

Java class for AnyOtherLanguageContent complex type. * *

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

 * <complexType name="AnyOtherLanguageContent">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <any maxOccurs="unbounded" minOccurs="0"/>
 *       </sequence>
 *       <attribute ref="{http://www.w3.org/XML/1998/namespace}lang"/>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 * 
* * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "AnyOtherLanguageContent", propOrder = { "any" }) public class AnyOtherLanguageContent implements Serializable { @XmlAnyElement(lax = true) private List any; @XmlAttribute(name = "lang", namespace = "http://www.w3.org/XML/1998/namespace") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "language") private String lang; /** * Gets the value of the any 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 any property. * *

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

     *    getAny().add(newItem);
     * 
* * *

* Objects of the following type(s) are allowed in the list * {@link Object } * * */ @Nonnull @ReturnsMutableObject(reason = "JAXB implementation style") public List getAny() { if (any == null) { any = new ArrayList(); } return this.any; } /** * The language in which the content is written. * * @return * possible object is * {@link String } * */ @Nullable public String getLang() { return lang; } /** * Sets the value of the lang property. * * @param value * allowed object is * {@link String } * */ public void setLang( @Nullable String value) { this.lang = value; } /** * Created by phloc-jaxb22-plugin -Xphloc-equalshashcode * */ @Override public boolean equals(final Object o) { if (o == this) { return true; } if ((o == null)||(!getClass().equals(o.getClass()))) { return false; } final AnyOtherLanguageContent rhs = ((AnyOtherLanguageContent) o); if (!EqualsUtils.equals(any, rhs.any)) { return false; } if (!EqualsUtils.equals(lang, rhs.lang)) { return false; } return true; } /** * Created by phloc-jaxb22-plugin -Xphloc-equalshashcode * */ @Override public int hashCode() { return new HashCodeGenerator(this).append(any).append(lang).getHashCode(); } /** * Created by phloc-jaxb22-plugin -Xphloc-tostring * */ @Override public String toString() { return new ToStringGenerator(this).append("any", any).append("lang", lang).toString(); } /** * Created by phloc-jaxb22-plugin -Xphloc-list-extension * * @param aList * The new list member to set. May be null. */ public void setAny( @Nullable final List aList) { any = aList; } /** * Created by phloc-jaxb22-plugin -Xphloc-list-extension * * @return * true if at least one item is contained, false otherwise. */ public boolean hasAnyEntries() { return (!getAny().isEmpty()); } /** * Created by phloc-jaxb22-plugin -Xphloc-list-extension * * @return * true if no item is contained, false otherwise. */ public boolean hasNoAnyEntries() { return getAny().isEmpty(); } /** * Created by phloc-jaxb22-plugin -Xphloc-list-extension * * @return * The number of contained elements. Always ≥ 0. */ @Nonnegative public int getAnyCount() { return getAny().size(); } /** * Created by phloc-jaxb22-plugin -Xphloc-list-extension * * @param index * The index to retrieve * @return * The element at the specified index. May be null * @throws ArrayIndexOutOfBoundsException * if the index is invalid! */ @Nullable public Object getAnyAtIndex( @Nonnegative final int index) { return getAny().get(index); } }