74adc8be74fed6d7696caae55bc8f8c84862bd65
[portal.git] / ecomp-portal-BE-common / src / main / java / org / openecomp / portalapp / portal / ecomp / model / AppContactUsItem.java
1 /*-
2  * ============LICENSE_START==========================================
3  * ONAP Portal
4  * ===================================================================
5  * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
6  * ===================================================================
7  *
8  * Unless otherwise specified, all software contained herein is licensed
9  * under the Apache License, Version 2.0 (the “License”);
10  * you may not use this software except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  *             http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  * Unless otherwise specified, all documentation contained herein is licensed
22  * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
23  * you may not use this documentation except in compliance with the License.
24  * You may obtain a copy of the License at
25  *
26  *             https://creativecommons.org/licenses/by/4.0/
27  *
28  * Unless required by applicable law or agreed to in writing, documentation
29  * distributed under the License is distributed on an "AS IS" BASIS,
30  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31  * See the License for the specific language governing permissions and
32  * limitations under the License.
33  *
34  * ============LICENSE_END============================================
35  *
36  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
37  */
38 package org.openecomp.portalapp.portal.ecomp.model;
39
40 import javax.persistence.Entity;
41 import javax.persistence.Id;
42
43 import org.openecomp.portalsdk.core.domain.support.DomainVo;
44 import com.fasterxml.jackson.annotation.JsonInclude;
45
46 /**
47  * An easily serializable version of row information from the fn_app_contact_us
48  * table; specifically this has an app ID instead of an EPApp object.
49  */
50 @Entity
51 @JsonInclude(JsonInclude.Include.NON_NULL)
52 public class AppContactUsItem extends DomainVo {
53
54         private static final long serialVersionUID = 6964210807573346262L;
55
56         @Id
57         private Long appId;
58         private String appName;
59         private String description;
60         private String contactName;
61         private String contactEmail;
62         private String url;
63         private String activeYN;
64
65         public Long getAppId() {
66                 return appId;
67         }
68
69         public void setAppId(Long appId) {
70                 this.appId = appId;
71         }
72
73         public String getAppName() {
74                 return appName;
75         }
76
77         public void setAppName(String appName) {
78                 this.appName = appName;
79         }
80
81         public String getDescription() {
82                 return description;
83         }
84
85         public void setDescription(String description) {
86                 this.description = description;
87         }
88
89         public String getContactName() {
90                 return contactName;
91         }
92
93         public void setContactName(String contactName) {
94                 this.contactName = contactName;
95         }
96
97         public String getContactEmail() {
98                 return contactEmail;
99         }
100
101         public void setContactEmail(String contactEmail) {
102                 this.contactEmail = contactEmail;
103         }
104
105         public String getUrl() {
106                 return url;
107         }
108
109         public void setUrl(String url) {
110                 this.url = url;
111         }
112
113         public String getActiveYN() {
114                 return activeYN;
115         }
116
117         public void setActiveYN(String activeYN) {
118                 this.activeYN = activeYN;
119         }
120
121         @Override
122         public int hashCode() {
123                 final int prime = 31;
124                 int result = 1;
125                 result = prime * result + ((activeYN == null) ? 0 : activeYN.hashCode());
126                 result = prime * result + ((appId == null) ? 0 : appId.hashCode());
127                 result = prime * result + ((appName == null) ? 0 : appName.hashCode());
128                 result = prime * result + ((contactEmail == null) ? 0 : contactEmail.hashCode());
129                 result = prime * result + ((contactName == null) ? 0 : contactName.hashCode());
130                 result = prime * result + ((description == null) ? 0 : description.hashCode());
131                 result = prime * result + ((url == null) ? 0 : url.hashCode());
132                 return result;
133         }
134
135         @Override
136         public boolean equals(Object obj) {
137                 if (this == obj)
138                         return true;
139                 if (obj == null)
140                         return false;
141                 if (getClass() != obj.getClass())
142                         return false;
143                 AppContactUsItem other = (AppContactUsItem) obj;
144                 if (activeYN == null) {
145                         if (other.activeYN != null)
146                                 return false;
147                 } else if (!activeYN.equals(other.activeYN))
148                         return false;
149                 if (appId == null) {
150                         if (other.appId != null)
151                                 return false;
152                 } else if (!appId.equals(other.appId))
153                         return false;
154                 if (appName == null) {
155                         if (other.appName != null)
156                                 return false;
157                 } else if (!appName.equals(other.appName))
158                         return false;
159                 if (contactEmail == null) {
160                         if (other.contactEmail != null)
161                                 return false;
162                 } else if (!contactEmail.equals(other.contactEmail))
163                         return false;
164                 if (contactName == null) {
165                         if (other.contactName != null)
166                                 return false;
167                 } else if (!contactName.equals(other.contactName))
168                         return false;
169                 if (description == null) {
170                         if (other.description != null)
171                                 return false;
172                 } else if (!description.equals(other.description))
173                         return false;
174                 if (url == null) {
175                         if (other.url != null)
176                                 return false;
177                 } else if (!url.equals(other.url))
178                         return false;
179                 return true;
180         }
181
182         @Override
183         public String toString() {
184                 return "AppContactUsItem [appId=" + appId + ", appName=" + appName + ", description=" + description
185                                 + ", contactName=" + contactName + ", contactEmail=" + contactEmail + ", url=" + url + ", activeYN="
186                                 + activeYN + "]";
187         }
188
189 }