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