added svcapi ui and camunda code
[it/otf.git] / otf-camunda / src / main / java / org / oran / otf / common / model / User.java
1 /*  Copyright (c) 2019 AT&T Intellectual Property.                             #\r
2 #                                                                              #\r
3 #   Licensed under the Apache License, Version 2.0 (the "License");            #\r
4 #   you may not use this file except in compliance with the License.           #\r
5 #   You may obtain a copy of the License at                                    #\r
6 #                                                                              #\r
7 #       http://www.apache.org/licenses/LICENSE-2.0                             #\r
8 #                                                                              #\r
9 #   Unless required by applicable law or agreed to in writing, software        #\r
10 #   distributed under the License is distributed on an "AS IS" BASIS,          #\r
11 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #\r
12 #   See the License for the specific language governing permissions and        #\r
13 #   limitations under the License.                                             #\r
14 ##############################################################################*/\r
15 \r
16 \r
17 package org.oran.otf.common.model;\r
18 \r
19 import org.oran.otf.common.model.local.UserGroup;\r
20 import org.oran.otf.common.utility.gson.Convert;\r
21 import java.io.Serializable;\r
22 import java.util.Date;\r
23 import java.util.List;\r
24 import org.bson.types.ObjectId;\r
25 import org.springframework.data.mongodb.core.mapping.Document;\r
26 \r
27 @Document(collection = "users")\r
28 public class User implements Serializable {\r
29 \r
30   private static final long serialVersionUID = 1L;\r
31 \r
32   private ObjectId _id;\r
33   private List<String> permissions;\r
34   private String firstName;\r
35   private String lastName;\r
36   private String email;\r
37   private String password;\r
38   private List<UserGroup> groups;\r
39   private Date createdAt;\r
40   private Date updatedAt;\r
41 \r
42   public User(\r
43       ObjectId _id,\r
44       List<String> permissions,\r
45       String firstName,\r
46       String lastName,\r
47       String email,\r
48       String password,\r
49       List<UserGroup> groups,\r
50       Date createdAt,\r
51       Date updatedAt) {\r
52     this._id = _id;\r
53     this.permissions = permissions;\r
54     this.firstName = firstName;\r
55     this.lastName = lastName;\r
56     this.email = email;\r
57     this.password = password;\r
58     this.groups = groups;\r
59     this.createdAt = createdAt;\r
60     this.updatedAt = updatedAt;\r
61   }\r
62 \r
63   public ObjectId get_id() {\r
64     return _id;\r
65   }\r
66 \r
67   public void set_id(ObjectId _id) {\r
68     this._id = _id;\r
69   }\r
70 \r
71   public List<String> getPermissions() {\r
72     return permissions;\r
73   }\r
74 \r
75   public void setPermissions(List<String> permissions) {\r
76     this.permissions = permissions;\r
77   }\r
78 \r
79   public String getFirstName() {\r
80     return firstName;\r
81   }\r
82 \r
83   public void setFirstName(String firstName) {\r
84     this.firstName = firstName;\r
85   }\r
86 \r
87   public String getLastName() {\r
88     return lastName;\r
89   }\r
90 \r
91   public void setLastName(String lastName) {\r
92     this.lastName = lastName;\r
93   }\r
94 \r
95   public String getEmail() {\r
96     return email;\r
97   }\r
98 \r
99   public void setEmail(String email) {\r
100     this.email = email;\r
101   }\r
102 \r
103   public String getPassword() {\r
104     return password;\r
105   }\r
106 \r
107   public void setPassword(String password) {\r
108     this.password = password;\r
109   }\r
110 \r
111   public List<UserGroup> getGroups() {\r
112     return groups;\r
113   }\r
114 \r
115   public void setGroups(List<UserGroup> groups) {\r
116     this.groups = groups;\r
117   }\r
118 \r
119   public Date getCreatedAt() {\r
120     return createdAt;\r
121   }\r
122 \r
123   public void setCreatedAt(Date createdAt) {\r
124     this.createdAt = createdAt;\r
125   }\r
126 \r
127   public Date getUpdatedAt() {\r
128     return updatedAt;\r
129   }\r
130 \r
131   public void setUpdatedAt(Date updatedAt) {\r
132     this.updatedAt = updatedAt;\r
133   }\r
134 \r
135   @Override\r
136   public String toString() {\r
137     return Convert.objectToJson(this);\r
138   }\r
139 }\r