de.micromata.opengis.kml.v_2_2_0.SimpleData Maven / Gradle / Ivy
Show all versions of JavaAPIforKml Show documentation
package de.micromata.opengis.kml.v_2_2_0;
import jakarta.xml.bind.annotation.*;
/**
* {@code }
*
* {@code } This element assigns a value to the custom data field
* identified by the name attribute. The type and name of this custom data field are
* declared in the {@code } element. Here is an example of defining two custom data
* elements: {@code Easy trail
* Pi in the sky 3.14159
* 10 Point
* coordinates-122.000,37.002 Difficult
* trail Mount Everest 347.45
* 10000
* Point coordinates-122.000,37.002 }
*
*
* Here is an example of defining two custom data elements:
*
*
* This element assigns a value to the custom data field identified by the name attribute.
* The type and name of this custom data field are declared in the {@code } element.
*
*
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "SimpleDataType", propOrder = {
"value"
})
@XmlRootElement(name = "SimpleData", namespace = "http://www.opengis.net/kml/2.2")
public class SimpleData implements Cloneable
{
/**
* {@code }
*
* {@code Club house 1
* 234
* 4 }
*
*
* {@code } An optional formatted version of name, to be used for display purposes.
* {@code } Value of the data pair. {@code Club house
* 1 234
* 4 }
*
*
* Value of the data pair.
*
*
*
*
*/
@XmlValue
protected String value;
/**
* {@code }
*
* User-defined text displayed in the 3D viewer as the label for the object (for example,
* for a Placemark, Folder, or NetworkLink).
*
*
*
*
*/
@XmlAttribute(name = "name", required = true)
protected String name;
/**
* Value constructor with only mandatory fields
*
* @param name
* required parameter
*/
public SimpleData(final String name) {
super();
this.name = name;
}
/**
* Default no-arg constructor is private. Use overloaded constructor instead! (Temporary solution, till a better and more suitable ObjectFactory is created.)
*
*/
@Deprecated
private SimpleData() {
super();
}
/**
*
*
* @return
* possible object is
* {@link String}
*
*/
public String getValue() {
return value;
}
/**
*
*
* @param value
* allowed object is
* {@link String}
*
*/
public void setValue(String value) {
this.value = 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)+((value == null)? 0 :value.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 SimpleData) == false) {
return false;
}
SimpleData other = ((SimpleData) obj);
if (value == null) {
if (other.value!= null) {
return false;
}
} else {
if (value.equals(other.value) == false) {
return false;
}
}
if (name == null) {
if (other.name!= null) {
return false;
}
} else {
if (name.equals(other.name) == false) {
return false;
}
}
return true;
}
/**
* fluent setter
*
*
* @param value
* required parameter
*/
public SimpleData withValue(final String value) {
this.setValue(value);
return this;
}
@Override
public SimpleData clone() {
SimpleData copy;
try {
copy = ((SimpleData) super.clone());
} catch (CloneNotSupportedException _x) {
throw new InternalError((_x.toString()));
}
return copy;
}
}