1 /* Copyright (c) 2019 AT&T Intellectual Property. #
\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
7 # http://www.apache.org/licenses/LICENSE-2.0 #
\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
17 package org.oran.otf.common.model;
\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
27 @Document(collection = "users")
\r
28 public class User implements Serializable {
\r
30 private static final long serialVersionUID = 1L;
\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
44 List<String> permissions,
\r
49 List<UserGroup> groups,
\r
53 this.permissions = permissions;
\r
54 this.firstName = firstName;
\r
55 this.lastName = lastName;
\r
57 this.password = password;
\r
58 this.groups = groups;
\r
59 this.createdAt = createdAt;
\r
60 this.updatedAt = updatedAt;
\r
63 public ObjectId get_id() {
\r
67 public void set_id(ObjectId _id) {
\r
71 public List<String> getPermissions() {
\r
75 public void setPermissions(List<String> permissions) {
\r
76 this.permissions = permissions;
\r
79 public String getFirstName() {
\r
83 public void setFirstName(String firstName) {
\r
84 this.firstName = firstName;
\r
87 public String getLastName() {
\r
91 public void setLastName(String lastName) {
\r
92 this.lastName = lastName;
\r
95 public String getEmail() {
\r
99 public void setEmail(String email) {
\r
100 this.email = email;
\r
103 public String getPassword() {
\r
107 public void setPassword(String password) {
\r
108 this.password = password;
\r
111 public List<UserGroup> getGroups() {
\r
115 public void setGroups(List<UserGroup> groups) {
\r
116 this.groups = groups;
\r
119 public Date getCreatedAt() {
\r
123 public void setCreatedAt(Date createdAt) {
\r
124 this.createdAt = createdAt;
\r
127 public Date getUpdatedAt() {
\r
131 public void setUpdatedAt(Date updatedAt) {
\r
132 this.updatedAt = updatedAt;
\r
136 public String toString() {
\r
137 return Convert.objectToJson(this);
\r