1 package de.fhdw.wtf.persistence.meta;
2
3 import java.util.HashSet;
4 import java.util.Set;
5
6 public class Mandant {
7
8 private final String id;
9 private final String rootPassword;
10 private final Set<User> users;
11
12 public Mandant(final String id, final String rootPassword) {
13 super();
14 this.id = id;
15 this.rootPassword = rootPassword;
16 this.users = new HashSet<>();
17 }
18
19 public String getId() {
20 return this.id;
21 }
22
23 public String getRootPassword() {
24 return this.rootPassword;
25 }
26
27 public Set<User> getUsers() {
28 return this.users;
29 }
30
31 public void addUser(final User user) {
32 this.users.add(user);
33 }
34
35 @Override
36 public boolean equals(final java.lang.Object obj) {
37 if (obj instanceof Mandant) {
38 final Mandant other = (Mandant) obj;
39 return other.getId().equals(this.getId());
40 }
41 return false;
42 }
43
44 @Override
45 public int hashCode() {
46 return this.id.hashCode();
47 }
48
49 }