de.micromata.opengis.kml.v_2_2_0.gx.Option Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of JavaAPIforKml Show documentation
Show all versions of JavaAPIforKml Show documentation
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.
package de.micromata.opengis.kml.v_2_2_0.gx;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlRootElement;
import jakarta.xml.bind.annotation.XmlType;
/**
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "optionType")
@XmlRootElement(name = "Option", namespace = "http://www.google.com/kml/ext/2.2")
public class Option implements Cloneable
{
@XmlAttribute(name = "name")
protected String name;
@XmlAttribute(name = "enabled")
protected boolean enabled;
public Option() {
super();
}
/**
*
* @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;
}
/**
*
*/
public boolean isEnabled() {
return enabled;
}
/**
*
*/
public void setEnabled(boolean value) {
this.enabled = value;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = ((prime*result)+((name == null)? 0 :name.hashCode()));
result = ((prime*result)+(new Boolean(enabled).hashCode()));
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if ((obj instanceof Option) == false) {
return false;
}
Option other = ((Option) obj);
if (name == null) {
if (other.name!= null) {
return false;
}
} else {
if (name.equals(other.name) == false) {
return false;
}
}
if (enabled!= other.enabled) {
return false;
}
return true;
}
/**
* fluent setter
*
*
* @param name
* required parameter
*/
public Option withName(final String name) {
this.setName(name);
return this;
}
/**
* fluent setter
*
*
* @param enabled
* required parameter
*/
public Option withEnabled(final boolean enabled) {
this.setEnabled(enabled);
return this;
}
@Override
public Option clone() {
Option copy;
try {
copy = ((Option) super.clone());
} catch (CloneNotSupportedException _x) {
throw new InternalError((_x.toString()));
}
return copy;
}
}