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:11 AM GMT-10:00 006 // 007 008 009 package org.hackystat.sensorbase.resource.projects.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 * <p>Java class for anonymous complex type. 023 * 024 * <p>The following schema fragment specifies the expected content contained within this class. 025 * 026 * <pre> 027 * <complexType> 028 * <complexContent> 029 * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> 030 * <sequence> 031 * <element ref="{}Description"/> 032 * <element ref="{}StartTime" minOccurs="0"/> 033 * <element ref="{}EndTime" minOccurs="0"/> 034 * <element ref="{}Owner" minOccurs="0"/> 035 * <element ref="{}Members"/> 036 * <element ref="{}Invitations" minOccurs="0"/> 037 * <element ref="{}Spectators" minOccurs="0"/> 038 * <element ref="{}UriPatterns"/> 039 * <element ref="{}Properties"/> 040 * </sequence> 041 * <attribute ref="{}Name"/> 042 * <attribute ref="{}LastMod"/> 043 * </restriction> 044 * </complexContent> 045 * </complexType> 046 * </pre> 047 * 048 * 049 */ 050 @XmlAccessorType(XmlAccessType.FIELD) 051 @XmlType(name = "", propOrder = { 052 "description", 053 "startTime", 054 "endTime", 055 "owner", 056 "members", 057 "invitations", 058 "spectators", 059 "uriPatterns", 060 "properties" 061 }) 062 @XmlRootElement(name = "Project") 063 public class Project 064 implements Serializable 065 { 066 067 private final static long serialVersionUID = 12343L; 068 @XmlElement(name = "Description", required = true) 069 protected String description; 070 @XmlElement(name = "StartTime") 071 @XmlSchemaType(name = "dateTime") 072 protected XMLGregorianCalendar startTime; 073 @XmlElement(name = "EndTime") 074 @XmlSchemaType(name = "dateTime") 075 protected XMLGregorianCalendar endTime; 076 @XmlElement(name = "Owner") 077 protected String owner; 078 @XmlElement(name = "Members", required = true) 079 protected Members members; 080 @XmlElement(name = "Invitations") 081 protected Invitations invitations; 082 @XmlElement(name = "Spectators") 083 protected Spectators spectators; 084 @XmlElement(name = "UriPatterns", required = true) 085 protected UriPatterns uriPatterns; 086 @XmlElement(name = "Properties", required = true) 087 protected Properties properties; 088 @XmlAttribute(name = "Name") 089 protected String name; 090 @XmlAttribute(name = "LastMod") 091 @XmlSchemaType(name = "dateTime") 092 protected XMLGregorianCalendar lastMod; 093 094 /** 095 * Gets the value of the description property. 096 * 097 * @return 098 * possible object is 099 * {@link String } 100 * 101 */ 102 public String getDescription() { 103 return description; 104 } 105 106 /** 107 * Sets the value of the description property. 108 * 109 * @param value 110 * allowed object is 111 * {@link String } 112 * 113 */ 114 public void setDescription(String value) { 115 this.description = value; 116 } 117 118 public boolean isSetDescription() { 119 return (this.description!= null); 120 } 121 122 /** 123 * Gets the value of the startTime property. 124 * 125 * @return 126 * possible object is 127 * {@link XMLGregorianCalendar } 128 * 129 */ 130 public XMLGregorianCalendar getStartTime() { 131 return startTime; 132 } 133 134 /** 135 * Sets the value of the startTime property. 136 * 137 * @param value 138 * allowed object is 139 * {@link XMLGregorianCalendar } 140 * 141 */ 142 public void setStartTime(XMLGregorianCalendar value) { 143 this.startTime = value; 144 } 145 146 public boolean isSetStartTime() { 147 return (this.startTime!= null); 148 } 149 150 /** 151 * Gets the value of the endTime property. 152 * 153 * @return 154 * possible object is 155 * {@link XMLGregorianCalendar } 156 * 157 */ 158 public XMLGregorianCalendar getEndTime() { 159 return endTime; 160 } 161 162 /** 163 * Sets the value of the endTime property. 164 * 165 * @param value 166 * allowed object is 167 * {@link XMLGregorianCalendar } 168 * 169 */ 170 public void setEndTime(XMLGregorianCalendar value) { 171 this.endTime = value; 172 } 173 174 public boolean isSetEndTime() { 175 return (this.endTime!= null); 176 } 177 178 /** 179 * Gets the value of the owner property. 180 * 181 * @return 182 * possible object is 183 * {@link String } 184 * 185 */ 186 public String getOwner() { 187 return owner; 188 } 189 190 /** 191 * Sets the value of the owner property. 192 * 193 * @param value 194 * allowed object is 195 * {@link String } 196 * 197 */ 198 public void setOwner(String value) { 199 this.owner = value; 200 } 201 202 public boolean isSetOwner() { 203 return (this.owner!= null); 204 } 205 206 /** 207 * Gets the value of the members property. 208 * 209 * @return 210 * possible object is 211 * {@link Members } 212 * 213 */ 214 public Members getMembers() { 215 return members; 216 } 217 218 /** 219 * Sets the value of the members property. 220 * 221 * @param value 222 * allowed object is 223 * {@link Members } 224 * 225 */ 226 public void setMembers(Members value) { 227 this.members = value; 228 } 229 230 public boolean isSetMembers() { 231 return (this.members!= null); 232 } 233 234 /** 235 * Gets the value of the invitations property. 236 * 237 * @return 238 * possible object is 239 * {@link Invitations } 240 * 241 */ 242 public Invitations getInvitations() { 243 return invitations; 244 } 245 246 /** 247 * Sets the value of the invitations property. 248 * 249 * @param value 250 * allowed object is 251 * {@link Invitations } 252 * 253 */ 254 public void setInvitations(Invitations value) { 255 this.invitations = value; 256 } 257 258 public boolean isSetInvitations() { 259 return (this.invitations!= null); 260 } 261 262 /** 263 * Gets the value of the spectators property. 264 * 265 * @return 266 * possible object is 267 * {@link Spectators } 268 * 269 */ 270 public Spectators getSpectators() { 271 return spectators; 272 } 273 274 /** 275 * Sets the value of the spectators property. 276 * 277 * @param value 278 * allowed object is 279 * {@link Spectators } 280 * 281 */ 282 public void setSpectators(Spectators value) { 283 this.spectators = value; 284 } 285 286 public boolean isSetSpectators() { 287 return (this.spectators!= null); 288 } 289 290 /** 291 * Gets the value of the uriPatterns property. 292 * 293 * @return 294 * possible object is 295 * {@link UriPatterns } 296 * 297 */ 298 public UriPatterns getUriPatterns() { 299 return uriPatterns; 300 } 301 302 /** 303 * Sets the value of the uriPatterns property. 304 * 305 * @param value 306 * allowed object is 307 * {@link UriPatterns } 308 * 309 */ 310 public void setUriPatterns(UriPatterns value) { 311 this.uriPatterns = value; 312 } 313 314 public boolean isSetUriPatterns() { 315 return (this.uriPatterns!= null); 316 } 317 318 /** 319 * Gets the value of the properties property. 320 * 321 * @return 322 * possible object is 323 * {@link Properties } 324 * 325 */ 326 public Properties getProperties() { 327 return properties; 328 } 329 330 /** 331 * Sets the value of the properties property. 332 * 333 * @param value 334 * allowed object is 335 * {@link Properties } 336 * 337 */ 338 public void setProperties(Properties value) { 339 this.properties = value; 340 } 341 342 public boolean isSetProperties() { 343 return (this.properties!= null); 344 } 345 346 /** 347 * Gets the value of the name property. 348 * 349 * @return 350 * possible object is 351 * {@link String } 352 * 353 */ 354 public String getName() { 355 return name; 356 } 357 358 /** 359 * Sets the value of the name property. 360 * 361 * @param value 362 * allowed object is 363 * {@link String } 364 * 365 */ 366 public void setName(String value) { 367 this.name = value; 368 } 369 370 public boolean isSetName() { 371 return (this.name!= null); 372 } 373 374 /** 375 * Gets the value of the lastMod property. 376 * 377 * @return 378 * possible object is 379 * {@link XMLGregorianCalendar } 380 * 381 */ 382 public XMLGregorianCalendar getLastMod() { 383 return lastMod; 384 } 385 386 /** 387 * Sets the value of the lastMod property. 388 * 389 * @param value 390 * allowed object is 391 * {@link XMLGregorianCalendar } 392 * 393 */ 394 public void setLastMod(XMLGregorianCalendar value) { 395 this.lastMod = value; 396 } 397 398 public boolean isSetLastMod() { 399 return (this.lastMod!= null); 400 } 401 402 // Custom methods here. Must be manually maintained. 403 404 /** 405 * Returns the first Property instance with the specified key, or null if not found. 406 * @param key The key for the property of interest. 407 * @return The Property instance for the key, or null if not found. 408 */ 409 public Property findProperty(String key) { 410 for (Property property : this.getProperties().getProperty()) { 411 if ((property.getKey() != null) && (property.getKey().equals(key))) { 412 return property; 413 } 414 } 415 return null; 416 } 417 418 /** 419 * Adds a new property to this instance with the specified key and value. 420 * @param key The key for the new property. 421 * @param value The value for the new property. 422 */ 423 public void addProperty(String key, String value) { 424 if (this.getProperties() == null) { 425 this.setProperties(new Properties()); 426 } 427 Property property = new Property(); 428 property.setKey(key); 429 property.setValue(value); 430 this.getProperties().getProperty().add(property); 431 } 432 433 /** 434 * Returns true if the passed email is the owner or one of the members of this project. 435 * @param email The email of interest. 436 * @return True if the email matches the owner or a member of this project. 437 */ 438 public boolean isMemberOrOwner(String email) { 439 if (email == null) { 440 return false; 441 } 442 if (email.equals(this.owner)) { 443 return true; 444 } 445 if (this.getMembers() != null) { 446 for (String member : this.getMembers().getMember()) { 447 if (email.equals(member)) { 448 return true; 449 } 450 } 451 } 452 return false; 453 } 454 455 /** 456 * Adds the specified UriPattern to the UriPatterns instance, creating it if necesssary. 457 * @param pattern The pattern to be added. 458 */ 459 public void addUriPattern(String pattern) { 460 if (this.getUriPatterns() == null) { 461 this.setUriPatterns(new UriPatterns()); 462 } 463 this.getUriPatterns().getUriPattern().add(pattern); 464 } 465 466 /** 467 * Adds the specified email to this list of invited users to this project. 468 * @param email The email to be added to the list of invited users. 469 */ 470 public void addInvitation(String email) { 471 if (this.getInvitations() == null) { 472 this.setInvitations(new Invitations()); 473 } 474 this.getInvitations().getInvitation().add(email); 475 } 476 477 }