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

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


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

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyAttribute;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.namespace.QName;


/**
 * 
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "AddressLinesType", propOrder = {
    "addressLine",
    "any"
})
@XmlRootElement(name = "AddressLines", namespace = "urn:oasis:names:tc:ciq:xsdschema:xAL:2.0")
public class AddressLines implements Cloneable
{

    @XmlElement(name = "AddressLine", required = true)
    protected List addressLine;
    @XmlAnyElement(lax = true)
    protected List any;
    @XmlAnyAttribute
    private Map otherAttributes = new HashMap();

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

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

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

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

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

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

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

    /**
     * Creates a new instance of {@link AddressLine} and adds it to addressLine.
     * This method is a short version for:
     * 
     * AddressLine addressLine = new AddressLine();
     * this.getAddressLine().add(addressLine); 
     * 
     * 
     */
    public AddressLine createAndAddAddressLine() {
        AddressLine newValue = new AddressLine();
        this.getAddressLine().add(newValue);
        return newValue;
    }

    /**
     * Sets the value of the addressLine property Objects of the following type(s) are allowed in the list List.
     * 

Note: *

This method does not make use of the fluent pattern.If you would like to make it fluent, use {@link #withAddressLine} instead. * * * @param addressLine */ public void setAddressLine(final List addressLine) { this.addressLine = addressLine; } /** * add a value to the addressLine property collection * * @param addressLine * Objects of the following type are allowed in the list: {@link AddressLine} * @return * true (as general contract of Collection.add). */ public AddressLines addToAddressLine(final AddressLine addressLine) { this.getAddressLine().add(addressLine); return this; } /** * Sets the value of the any property Objects of the following type(s) are allowed in the list 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 */ 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 AddressLines addToAny(final Object any) { this.getAny().add(any); return this; } /** * fluent setter * @see #setAny(List) * * @param any * required parameter */ public AddressLines withAny(final List any) { this.setAny(any); return this; } @Override public AddressLines clone() { AddressLines copy; try { copy = ((AddressLines) super.clone()); } catch (CloneNotSupportedException _x) { throw new InternalError((_x.toString())); } copy.addressLine = new ArrayList((getAddressLine().size())); for (AddressLine iter: addressLine) { copy.addressLine.add(iter.clone()); } copy.any = new ArrayList((getAny().size())); for (Object iter: any) { copy.any.add(iter); } return copy; } }