sprint backlog adapted
[staff/due1/sed-hs15-srs-purple.git] / src / main / java / ch / bfh / ti / srs / dataschema / Resource.java
1 /*
2 * Copyright (c) 2015 Berner Fachhochschule, Switzerland.
3 *
4 * Project Smart Reservation System.
5 *
6 * Distributable under GPL license. See terms of license at gnu.org.
7 */
8 package ch.bfh.ti.srs.dataschema;
9
10 import java.util.UUID;
11
12 public class Resource implements Cloneable {
13
14 private UUID id;
15 private String name;
16 private String type;
17
18 /**
19 * Normal constructor for new resources created in the UserController
20 * @param name
21 * this is the name of the resource
22 * @param type
23 * this is the type for example school,meeting room...
24 * @throws Exception
25 * the name of the resource can't be null
26 */
27
28 public Resource(String name, String type) throws Exception {
29 if (name == null)
30 throw new IllegalArgumentException("Name must not be null");
31
32 this.name = name;
33 this.type = type;
34
35 this.id = UUID.randomUUID();
36 }
37
38 public UUID getId() {
39 return id;
40 }
41
42 public String getName() {
43 return name;
44 }
45
46 public String getType() {
47 return type;
48 }
49
50 public void setName(String name) {
51 this.name = name;
52 }
53
54 public void setType(String type) {
55 this.type = type;
56 }
57
58 @Override
59 public Resource clone() throws CloneNotSupportedException {
60 return (Resource) super.clone();
61 }
62 }