added id, groupid
[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 {
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 *
21 * @param name
22 * @param type
23 * @throws Exception
24 */
25
26 public Resource(String name, String type) throws Exception {
27 if (name == null)
28 throw new IllegalArgumentException("Name must not be null");
29
30 this.name = name;
31 this.type = type;
32
33 this.id = UUID.randomUUID();
34 }
35
36 public UUID getId() {
37 return id;
38 }
39
40 public String getName() {
41 return name;
42 }
43
44 public String getType() {
45 return type;
46 }
47
48 public void setName(String name) {
49 this.name = name;
50 }
51
52 public void setType(String type) {
53 this.type = type;
54 }
55 }