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

de.micromata.opengis.kml.v_2_2_0.SimpleField 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;

import jakarta.xml.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;


/**
 * 
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "SimpleFieldType", propOrder = {
    "displayName",
    "simpleFieldExtension"
})
@XmlRootElement(name = "SimpleField", namespace = "http://www.opengis.net/kml/2.2")
public class SimpleField implements Cloneable
{

    protected String displayName;
    @XmlElement(name = "SimpleFieldExtension")
    protected List simpleFieldExtension;
    @XmlAttribute(name = "type")
    protected String type;
    @XmlAttribute(name = "name")
    protected String name;

    public SimpleField() {
        super();
    }

    /**
     * 
     * @return
     *     possible object is
     *     {@link String}
     *     
     */
    public String getDisplayName() {
        return displayName;
    }

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

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

    /**
     * 
     * @return
     *     possible object is
     *     {@link String}
     *     
     */
    public String getType() {
        return type;
    }

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

    /**
     * 
     * @return
     *     possible object is
     *     {@link String}
     *     
     */
    public String getName() {
        return name;
    }

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

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

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if ((obj instanceof SimpleField) == false) {
            return false;
        }
        SimpleField other = ((SimpleField) obj);
        if (displayName == null) {
            if (other.displayName!= null) {
                return false;
            }
        } else {
            if (displayName.equals(other.displayName) == false) {
                return false;
            }
        }
        if (simpleFieldExtension == null) {
            if (other.simpleFieldExtension!= null) {
                return false;
            }
        } else {
            if (simpleFieldExtension.equals(other.simpleFieldExtension) == false) {
                return false;
            }
        }
        if (type == null) {
            if (other.type!= null) {
                return false;
            }
        } else {
            if (type.equals(other.type) == false) {
                return false;
            }
        }
        if (name == null) {
            if (other.name!= null) {
                return false;
            }
        } else {
            if (name.equals(other.name) == false) {
                return false;
            }
        }
        return true;
    }

    /**
     * Sets the value of the simpleFieldExtension 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 #withSimpleFieldExtension} instead. * * * @param simpleFieldExtension * Objects of the following type are allowed in the list: {@link Object} */ public void setSimpleFieldExtension(final List simpleFieldExtension) { this.simpleFieldExtension = simpleFieldExtension; } /** * add a value to the simpleFieldExtension property collection * * @param simpleFieldExtension * Objects of the following type are allowed in the list: {@link Object} * @return * true (as general contract of Collection.add). */ public SimpleField addToSimpleFieldExtension(final Object simpleFieldExtension) { this.getSimpleFieldExtension().add(simpleFieldExtension); return this; } /** * fluent setter * * * @param displayName * required parameter */ public SimpleField withDisplayName(final String displayName) { this.setDisplayName(displayName); return this; } /** * fluent setter * * * @param simpleFieldExtension * required parameter */ public SimpleField withSimpleFieldExtension(final List simpleFieldExtension) { this.setSimpleFieldExtension(simpleFieldExtension); return this; } /** * fluent setter * * * @param type * required parameter */ public SimpleField withType(final String type) { this.setType(type); return this; } /** * fluent setter * * * @param name * required parameter */ public SimpleField withName(final String name) { this.setName(name); return this; } @Override public SimpleField clone() { SimpleField copy; try { copy = ((SimpleField) super.clone()); } catch (CloneNotSupportedException _x) { throw new InternalError((_x.toString())); } copy.simpleFieldExtension = new ArrayList((getSimpleFieldExtension().size())); for (Object iter: simpleFieldExtension) { copy.simpleFieldExtension.add(iter); } return copy; } }