/** * @author Hyacinthe MENIET * Created on 24 août 07 */ package net.dotmyself.weatherws; import java.math.BigDecimal; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "name", "temperature", "humidity", "weather", "uri", "lastUpdate" }) @XmlRootElement(name = "city") public class City { @XmlElement(required = true) protected String name; @XmlElement(required = true) protected BigDecimal temperature; @XmlElement(required = true) protected long humidity; @XmlElement(required = true) protected String weather; @XmlElement protected String uri; @XmlElement protected String lastUpdate; @XmlAttribute protected Long id; /** * Gets the value of the name property. * * @return * possible object is * {@link String } * */ public String getName() { return name; } /** * Sets the value of the name property. * * @param value * allowed object is * {@link String } * */ public void setName(String value) { this.name = value; } /** * Gets the value of the temperature property. * * @return * possible object is * {@link BigDecimal } * */ public BigDecimal getTemperature() { return temperature; } /** * Sets the value of the temperature property. * * @param value * allowed object is * {@link BigDecimal } * */ public void setTemperature(BigDecimal value) { this.temperature = value; } /** * Gets the value of the humidity property. * */ public long getHumidity() { return humidity; } /** * Sets the value of the humidity property. * */ public void setHumidity(long value) { this.humidity = value; } /** * Gets the value of the weather property. * * @return * possible object is * {@link String } * */ public String getWeather() { return weather; } /** * Sets the value of the weather property. * * @param value * allowed object is * {@link String } * */ public void setWeather(String value) { this.weather = value; } /** * Gets the value of the uri property. * * @return * possible object is * {@link String } * */ public String getUri() { return uri; } /** * Sets the value of the uri property. * * @param value * allowed object is * {@link String } * */ public void setUri(String value) { this.uri = value; } /** * Gets the value of the lastUpdate property. * * @return * possible object is * {@link String } * */ public String getLastUpdate() { return lastUpdate; } /** * Sets the value of the lastUpdate property. * * @param value * allowed object is * {@link String } * */ public void setLastUpdate(String value) { this.lastUpdate = value; } /** * Gets the value of the id property. * * @return * possible object is * {@link Long } * */ public Long getId() { return id; } /** * Sets the value of the id property. * * @param value * allowed object is * {@link Long } * */ public void setId(Long value) { this.id = value; } @Override public String toString() { return "City=" + name; } @Override public boolean equals(Object obj) { if (obj==this) { return true; } if (obj instanceof City) { City other = (City) obj; if (this.name != other.name) { if (this.name == null || !this.name.equals(other.name)) { return false; } } return true; } return false; } @Override public int hashCode() { return getName() != null ? getName().hashCode() : 1; } }