bcd6595cf33ee51452ecf246c2a298e60a3453bf
[portal.git] / ecomp-portal-BE-common / src / main / java / org / openecomp / portalapp / portal / transport / UserWithNameSurnameTitle.java
1 /*-
2  * ================================================================================
3  * ECOMP Portal
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ================================================================================
19  */
20 package org.openecomp.portalapp.portal.transport;
21
22 public class UserWithNameSurnameTitle {
23         
24         public String orgUserId;
25
26         public String firstName;
27
28         public String lastName;
29
30         public String jobTitle;
31         
32         public UserWithNameSurnameTitle(String orgUserId, String firstName, String lastName, String jobTitle) {
33                 this.orgUserId = orgUserId;
34                 this.firstName = firstName;
35                 this.lastName = lastName;
36                 this.jobTitle = jobTitle;
37         }
38
39         @Override
40         public int hashCode() {
41                 final int prime = 31;
42                 int result = 1;
43                 result = prime * result + ((firstName == null) ? 0 : firstName.hashCode());
44                 result = prime * result + ((jobTitle == null) ? 0 : jobTitle.hashCode());
45                 result = prime * result + ((lastName == null) ? 0 : lastName.hashCode());
46                 result = prime * result + ((orgUserId == null) ? 0 : orgUserId.hashCode());
47                 return result;
48         }
49
50         @Override
51         public boolean equals(Object obj) {
52                 if (this == obj)
53                         return true;
54                 if (obj == null)
55                         return false;
56                 if (getClass() != obj.getClass())
57                         return false;
58                 UserWithNameSurnameTitle other = (UserWithNameSurnameTitle) obj;
59                 if (firstName == null) {
60                         if (other.firstName != null)
61                                 return false;
62                 } else if (!firstName.equals(other.firstName))
63                         return false;
64                 if (jobTitle == null) {
65                         if (other.jobTitle != null)
66                                 return false;
67                 } else if (!jobTitle.equals(other.jobTitle))
68                         return false;
69                 if (lastName == null) {
70                         if (other.lastName != null)
71                                 return false;
72                 } else if (!lastName.equals(other.lastName))
73                         return false;
74                 if (orgUserId == null) {
75                         if (other.orgUserId != null)
76                                 return false;
77                 } else if (!orgUserId.equals(other.orgUserId))
78                         return false;
79                 return true;
80         }
81
82 }