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

de.micromata.opengis.kml.v_2_2_0.xal.XAL Maven / Gradle / Ivy

Go to download

This is JavaAPIforKMml, Micromata's library for use with applications that want to parse, generate and operate on KML. It is an implementation of the OGC KML 2.2 standard. It is written entirely in Java and makes heavy use of JAXB.

There is a newer version: 3.0.4
Show newest version

package de.micromata.opengis.kml.v_2_2_0.xal;

import jakarta.xml.bind.annotation.*;

import javax.xml.namespace.QName;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


/**
 * 
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "xalAddressDetails",
    "any"
})
@XmlRootElement(name = "xAL")
public class XAL implements Cloneable
{

    @XmlElement(name = "AddressDetails", required = true)
    protected List xalAddressDetails;
    @XmlAnyElement(lax = true)
    protected List any;
    @XmlAttribute(name = "Version")
    @XmlSchemaType(name = "anySimpleType")
    protected String version;
    @XmlAnyAttribute
    private Map otherAttributes = new HashMap();

    /**
     * Value constructor with only mandatory fields
     * 
     * @param xalAddressDetails
     *     required parameter
     */
    public XAL(final List xalAddressDetails) {
        super();
        this.xalAddressDetails = xalAddressDetails;
    }

    /**
     * Default no-arg constructor is private. Use overloaded constructor instead! (Temporary solution, till a better and more suitable ObjectFactory is created.) 
     * 
     */
    @Deprecated
    private XAL() {
        super();
    }

    /**
     * 
     */
    public List getXalAddressDetails() {
        if (xalAddressDetails == null) {
            xalAddressDetails = new ArrayList();
        }
        return this.xalAddressDetails;
    }

    /**
     * 
     */
    public List getAny() {
        if (any == null) {
            any = new ArrayList();
        }
        return this.any;
    }

    /**
     * 
     * @return
     *     possible object is
     *     {@link String}
     *     
     */
    public String getVersion() {
        return version;
    }

    /**
     * 
     * @param value
     *     allowed object is
     *     {@link String}
     *     
     */
    public void setVersion(String value) {
        this.version = value;
    }

    /**
     * 
     * @return
     *     always non-null
     */
    public Map getOtherAttributes() {
        return otherAttributes;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = ((prime*result)+((xalAddressDetails == null)? 0 :xalAddressDetails.hashCode()));
        result = ((prime*result)+((any == null)? 0 :any.hashCode()));
        result = ((prime*result)+((version == null)? 0 :version.hashCode()));
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if ((obj instanceof XAL) == false) {
            return false;
        }
        XAL other = ((XAL) obj);
        if (xalAddressDetails == null) {
            if (other.xalAddressDetails!= null) {
                return false;
            }
        } else {
            if (xalAddressDetails.equals(other.xalAddressDetails) == false) {
                return false;
            }
        }
        if (any == null) {
            if (other.any!= null) {
                return false;
            }
        } else {
            if (any.equals(other.any) == false) {
                return false;
            }
        }
        if (version == null) {
            if (other.version!= null) {
                return false;
            }
        } else {
            if (version.equals(other.version) == false) {
                return false;
            }
        }
        return true;
    }

    /**
     * Creates a new instance of {@link AddressDetails} and adds it to xalAddressDetails.
     * This method is a short version for:
     * {@code
     * AddressDetails addressDetails = new AddressDetails();
     * this.getXalAddressDetails().add(addressDetails); }
     * 
     * 
     * @param xalAddress
     *     required parameter
     * @param addressLines
     *     required parameter
     * @param country
     *     required parameter
     * @param locality
     *     required parameter
     * @param administrativeArea
     *     required parameter
     * @param thoroughfare
     *     required parameter
     */
    public AddressDetails createAndAddXalAddressDetails(final AddressDetails.Address xalAddress, final AddressLines addressLines, final AddressDetails.Country country, final AdministrativeArea administrativeArea, final Locality locality, final Thoroughfare thoroughfare) {
        AddressDetails newValue = new AddressDetails(xalAddress, addressLines, country, administrativeArea, locality, thoroughfare);
        this.getXalAddressDetails().add(newValue);
        return newValue;
    }

    /**
     * Sets the value of the xalAddressDetails property Objects of the following type(s) are allowed in the list {@code List}.
     * 

Note: *

This method does not make use of the fluent pattern.If you would like to make it fluent, use withXalAddressDetails instead. * * * @param xalAddressDetails * Objects of the following type are allowed in the list: {@link AddressDetails} */ public void setXalAddressDetails(final List xalAddressDetails) { this.xalAddressDetails = xalAddressDetails; } /** * add a value to the xalAddressDetails property collection * * @param xalAddressDetails * Objects of the following type are allowed in the list: {@link AddressDetails} * @return * true (as general contract of Collection.add). */ public XAL addToXalAddressDetails(final AddressDetails xalAddressDetails) { this.getXalAddressDetails().add(xalAddressDetails); return this; } /** * Sets the value of the any property Objects of the following type(s) are allowed in the list {@code List}. *

Note: *

This method does not make use of the fluent pattern.If you would like to make it fluent, use {@link #withAny} instead. * * * @param any * Objects of the following type are allowed in the list: {@link Object} */ public void setAny(final List any) { this.any = any; } /** * add a value to the any property collection * * @param any * Objects of the following type are allowed in the list: {@link Object} * @return * true (as general contract of Collection.add). */ public XAL addToAny(final Object any) { this.getAny().add(any); return this; } /** * fluent setter * * * @param any * required parameter */ public XAL withAny(final List any) { this.setAny(any); return this; } /** * fluent setter * * * @param version * required parameter */ public XAL withVersion(final String version) { this.setVersion(version); return this; } @Override public XAL clone() { XAL copy; try { copy = ((XAL) super.clone()); } catch (CloneNotSupportedException _x) { throw new InternalError((_x.toString())); } copy.xalAddressDetails = new ArrayList((getXalAddressDetails().size())); for (AddressDetails iter: xalAddressDetails) { copy.xalAddressDetails.add(iter.clone()); } copy.any = new ArrayList((getAny().size())); for (Object iter: any) { copy.any.add(iter); } return copy; } }