3 * * ============LICENSE_START=======================================================
5 * * ================================================================================
6 * * Copyright (c) 2020 AT&T Intellectual Property. All rights reserved.
7 * * ================================================================================
8 * * Licensed under the Apache License, Version 2.0 (the "License");
9 * * you may not use this file except in compliance with the License.
10 * * You may obtain a copy of the License at
12 * * http://www.apache.org/licenses/LICENSE-2.0
14 * * Unless required by applicable law or agreed to in writing, software
15 * * distributed under the License is distributed on an "AS IS" BASIS,
16 * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * * See the License for the specific language governing permissions and
18 * * limitations under the License.
19 * * ============LICENSE_END=========================================================
23 package org.onap.dcaegen2.platform.mod.models;
26 import lombok.AllArgsConstructor;
27 import lombok.NoArgsConstructor;
30 import org.springframework.data.annotation.Id;
31 import org.springframework.data.mongodb.core.mapping.DBRef;
32 import org.springframework.data.mongodb.core.mapping.Document;
34 import javax.validation.constraints.NotBlank;
35 import javax.validation.constraints.Size;
36 import java.io.Serializable;
37 import java.util.ArrayList;
38 import java.util.HashSet;
44 * Assigning Roles to User
51 @Document(collection = "users")
52 public class ModUser implements Serializable {
59 private String username;
62 private String password;
65 private String fullName;
68 private Set<Role> roles = new HashSet<>();
70 public ModUser(@NotBlank @Size(max = 10) String username, @NotBlank String password, @NotBlank String fullName) {
71 this.username = username;
72 this.password = password;
73 this.fullName=fullName;