001 // 002 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.5-b01-fcs 003 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 004 // Any modifications to this file will be lost upon recompilation of the source schema. 005 // Generated on: 2008.06.27 at 11:37:10 AM GMT-10:00 006 // 007 008 009 package org.hackystat.sensorbase.resource.sensordata.jaxb; 010 011 import java.io.Serializable; 012 import javax.xml.bind.annotation.XmlAccessType; 013 import javax.xml.bind.annotation.XmlAccessorType; 014 import javax.xml.bind.annotation.XmlAttribute; 015 import javax.xml.bind.annotation.XmlElement; 016 import javax.xml.bind.annotation.XmlRootElement; 017 import javax.xml.bind.annotation.XmlSchemaType; 018 import javax.xml.bind.annotation.XmlType; 019 import javax.xml.datatype.XMLGregorianCalendar; 020 021 022 /** 023 * <p>Java class for anonymous complex type. 024 * 025 * <p>The following schema fragment specifies the expected content contained within this class. 026 * 027 * <pre> 028 * <complexType> 029 * <complexContent> 030 * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> 031 * <sequence> 032 * <element ref="{}Timestamp"/> 033 * <element ref="{}Runtime"/> 034 * <element ref="{}Tool"/> 035 * <element ref="{}SensorDataType"/> 036 * <element ref="{}Resource"/> 037 * <element ref="{}Owner"/> 038 * <element ref="{}Properties"/> 039 * </sequence> 040 * <attribute ref="{}LastMod"/> 041 * </restriction> 042 * </complexContent> 043 * </complexType> 044 * </pre> 045 * 046 * 047 */ 048 @XmlAccessorType(XmlAccessType.FIELD) 049 @XmlType(name = "", propOrder = { 050 "timestamp", 051 "runtime", 052 "tool", 053 "sensorDataType", 054 "resource", 055 "owner", 056 "properties" 057 }) 058 @XmlRootElement(name = "SensorData") 059 public class SensorData 060 implements Serializable 061 { 062 063 private final static long serialVersionUID = 12343L; 064 @XmlElement(name = "Timestamp", required = true) 065 @XmlSchemaType(name = "dateTime") 066 protected XMLGregorianCalendar timestamp; 067 @XmlElement(name = "Runtime", required = true) 068 @XmlSchemaType(name = "dateTime") 069 protected XMLGregorianCalendar runtime; 070 @XmlElement(name = "Tool", required = true) 071 protected String tool; 072 @XmlElement(name = "SensorDataType", required = true) 073 protected String sensorDataType; 074 @XmlElement(name = "Resource", required = true) 075 @XmlSchemaType(name = "anyURI") 076 protected String resource; 077 @XmlElement(name = "Owner", required = true) 078 protected String owner; 079 @XmlElement(name = "Properties", required = true) 080 protected Properties properties; 081 @XmlAttribute(name = "LastMod") 082 @XmlSchemaType(name = "dateTime") 083 protected XMLGregorianCalendar lastMod; 084 085 /** 086 * Gets the value of the timestamp property. 087 * 088 * @return 089 * possible object is 090 * {@link XMLGregorianCalendar } 091 * 092 */ 093 public XMLGregorianCalendar getTimestamp() { 094 return timestamp; 095 } 096 097 /** 098 * Sets the value of the timestamp property. 099 * 100 * @param value 101 * allowed object is 102 * {@link XMLGregorianCalendar } 103 * 104 */ 105 public void setTimestamp(XMLGregorianCalendar value) { 106 this.timestamp = value; 107 } 108 109 public boolean isSetTimestamp() { 110 return (this.timestamp!= null); 111 } 112 113 /** 114 * Gets the value of the runtime property. 115 * 116 * @return 117 * possible object is 118 * {@link XMLGregorianCalendar } 119 * 120 */ 121 public XMLGregorianCalendar getRuntime() { 122 return runtime; 123 } 124 125 /** 126 * Sets the value of the runtime property. 127 * 128 * @param value 129 * allowed object is 130 * {@link XMLGregorianCalendar } 131 * 132 */ 133 public void setRuntime(XMLGregorianCalendar value) { 134 this.runtime = value; 135 } 136 137 public boolean isSetRuntime() { 138 return (this.runtime!= null); 139 } 140 141 /** 142 * Gets the value of the tool property. 143 * 144 * @return 145 * possible object is 146 * {@link String } 147 * 148 */ 149 public String getTool() { 150 return tool; 151 } 152 153 /** 154 * Sets the value of the tool property. 155 * 156 * @param value 157 * allowed object is 158 * {@link String } 159 * 160 */ 161 public void setTool(String value) { 162 this.tool = value; 163 } 164 165 public boolean isSetTool() { 166 return (this.tool!= null); 167 } 168 169 /** 170 * Gets the value of the sensorDataType property. 171 * 172 * @return 173 * possible object is 174 * {@link String } 175 * 176 */ 177 public String getSensorDataType() { 178 return sensorDataType; 179 } 180 181 /** 182 * Sets the value of the sensorDataType property. 183 * 184 * @param value 185 * allowed object is 186 * {@link String } 187 * 188 */ 189 public void setSensorDataType(String value) { 190 this.sensorDataType = value; 191 } 192 193 public boolean isSetSensorDataType() { 194 return (this.sensorDataType!= null); 195 } 196 197 /** 198 * Gets the value of the resource property. 199 * 200 * @return 201 * possible object is 202 * {@link String } 203 * 204 */ 205 public String getResource() { 206 return resource; 207 } 208 209 /** 210 * Sets the value of the resource property. 211 * 212 * @param value 213 * allowed object is 214 * {@link String } 215 * 216 */ 217 public void setResource(String value) { 218 this.resource = value; 219 } 220 221 public boolean isSetResource() { 222 return (this.resource!= null); 223 } 224 225 /** 226 * Gets the value of the owner property. 227 * 228 * @return 229 * possible object is 230 * {@link String } 231 * 232 */ 233 public String getOwner() { 234 return owner; 235 } 236 237 /** 238 * Sets the value of the owner property. 239 * 240 * @param value 241 * allowed object is 242 * {@link String } 243 * 244 */ 245 public void setOwner(String value) { 246 this.owner = value; 247 } 248 249 public boolean isSetOwner() { 250 return (this.owner!= null); 251 } 252 253 /** 254 * Gets the value of the properties property. 255 * 256 * @return 257 * possible object is 258 * {@link Properties } 259 * 260 */ 261 public Properties getProperties() { 262 return properties; 263 } 264 265 /** 266 * Sets the value of the properties property. 267 * 268 * @param value 269 * allowed object is 270 * {@link Properties } 271 * 272 */ 273 public void setProperties(Properties value) { 274 this.properties = value; 275 } 276 277 public boolean isSetProperties() { 278 return (this.properties!= null); 279 } 280 281 /** 282 * Gets the value of the lastMod property. 283 * 284 * @return 285 * possible object is 286 * {@link XMLGregorianCalendar } 287 * 288 */ 289 public XMLGregorianCalendar getLastMod() { 290 return lastMod; 291 } 292 293 /** 294 * Sets the value of the lastMod property. 295 * 296 * @param value 297 * allowed object is 298 * {@link XMLGregorianCalendar } 299 * 300 */ 301 public void setLastMod(XMLGregorianCalendar value) { 302 this.lastMod = value; 303 } 304 305 public boolean isSetLastMod() { 306 return (this.lastMod!= null); 307 } 308 309 // Custom methods here. Must be manually maintained. 310 311 /** 312 * Returns the first Property instance with the specified key, or null if not found. 313 * @param key The key for the property of interest. 314 * @return The Property instance for the key, or null if not found. 315 */ 316 public Property findProperty(String key) { 317 for (Property property : this.getProperties().getProperty()) { 318 if ((property.getKey() != null) && (property.getKey().equals(key))) { 319 return property; 320 } 321 } 322 return null; 323 } 324 325 /** 326 * Adds a new property to this instance with the specified key and value. 327 * @param key The key for the new property. 328 * @param value The value for the new property. 329 */ 330 public void addProperty(String key, String value) { 331 if (this.getProperties() == null) { 332 this.setProperties(new Properties()); 333 } 334 Property property = new Property(); 335 property.setKey(key); 336 property.setValue(value); 337 this.getProperties().getProperty().add(property); 338 } 339 340 }