2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2019 Nordix Foundation.
4 * ================================================================================
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 * SPDX-License-Identifier: Apache-2.0
18 * ============LICENSE_END=========================================================
20 package org.onap.aaisimulator.model;
22 import static org.springframework.util.ObjectUtils.nullSafeEquals;
25 * @author Waqas Ikram (waqas.ikram@est.tech)
29 private String username;
30 private String password;
34 * @return the username
36 public String getUsername() {
41 * @param username the username to set
43 public void setUsername(final String username) {
44 this.username = username;
48 * @return the password
50 public String getPassword() {
55 * @param password the password to set
57 public void setPassword(final String password) {
58 this.password = password;
64 public String getRole() {
69 * @param role the role to set
71 public void setRole(final String role) {
76 public int hashCode() {
79 result = prime * result + ((password == null) ? 0 : password.hashCode());
80 result = prime * result + ((role == null) ? 0 : role.hashCode());
81 result = prime * result + ((username == null) ? 0 : username.hashCode());
86 public boolean equals(final Object obj) {
87 if (obj instanceof User) {
88 final User other = (User) obj;
89 return nullSafeEquals(this.username, other.username) && nullSafeEquals(this.password, other.password)
90 && nullSafeEquals(this.role, other.role);
96 public String toString() {
97 return "UserCredential [username=" + username + ", password=" + password + ", role=" + role + "]";