[PORTAL-16 PORTAL-18] Widget ms; staging
[portal.git] / ecomp-portal-BE-common / src / main / java / org / openecomp / portalapp / portal / ecomp / model / AppContactUsItem.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.ecomp.model;
21
22 import javax.persistence.Entity;
23 import javax.persistence.Id;
24
25 import org.openecomp.portalsdk.core.domain.support.DomainVo;
26 import com.fasterxml.jackson.annotation.JsonInclude;
27
28 /**
29  * An easily serializable version of row information from the fn_app_contact_us
30  * table; specifically this has an app ID instead of an EPApp object.
31  */
32 @Entity
33 @JsonInclude(JsonInclude.Include.NON_NULL)
34 public class AppContactUsItem extends DomainVo {
35
36         private static final long serialVersionUID = 6964210807573346262L;
37
38         @Id
39         private Long appId;
40         private String appName;
41         private String description;
42         private String contactName;
43         private String contactEmail;
44         private String url;
45         private String activeYN;
46
47         public Long getAppId() {
48                 return appId;
49         }
50
51         public void setAppId(Long appId) {
52                 this.appId = appId;
53         }
54
55         public String getAppName() {
56                 return appName;
57         }
58
59         public void setAppName(String appName) {
60                 this.appName = appName;
61         }
62
63         public String getDescription() {
64                 return description;
65         }
66
67         public void setDescription(String description) {
68                 this.description = description;
69         }
70
71         public String getContactName() {
72                 return contactName;
73         }
74
75         public void setContactName(String contactName) {
76                 this.contactName = contactName;
77         }
78
79         public String getContactEmail() {
80                 return contactEmail;
81         }
82
83         public void setContactEmail(String contactEmail) {
84                 this.contactEmail = contactEmail;
85         }
86
87         public String getUrl() {
88                 return url;
89         }
90
91         public void setUrl(String url) {
92                 this.url = url;
93         }
94
95         public String getActiveYN() {
96                 return activeYN;
97         }
98
99         public void setActiveYN(String activeYN) {
100                 this.activeYN = activeYN;
101         }
102
103         @Override
104         public int hashCode() {
105                 final int prime = 31;
106                 int result = 1;
107                 result = prime * result + ((activeYN == null) ? 0 : activeYN.hashCode());
108                 result = prime * result + ((appId == null) ? 0 : appId.hashCode());
109                 result = prime * result + ((appName == null) ? 0 : appName.hashCode());
110                 result = prime * result + ((contactEmail == null) ? 0 : contactEmail.hashCode());
111                 result = prime * result + ((contactName == null) ? 0 : contactName.hashCode());
112                 result = prime * result + ((description == null) ? 0 : description.hashCode());
113                 result = prime * result + ((url == null) ? 0 : url.hashCode());
114                 return result;
115         }
116
117         @Override
118         public boolean equals(Object obj) {
119                 if (this == obj)
120                         return true;
121                 if (obj == null)
122                         return false;
123                 if (getClass() != obj.getClass())
124                         return false;
125                 AppContactUsItem other = (AppContactUsItem) obj;
126                 if (activeYN == null) {
127                         if (other.activeYN != null)
128                                 return false;
129                 } else if (!activeYN.equals(other.activeYN))
130                         return false;
131                 if (appId == null) {
132                         if (other.appId != null)
133                                 return false;
134                 } else if (!appId.equals(other.appId))
135                         return false;
136                 if (appName == null) {
137                         if (other.appName != null)
138                                 return false;
139                 } else if (!appName.equals(other.appName))
140                         return false;
141                 if (contactEmail == null) {
142                         if (other.contactEmail != null)
143                                 return false;
144                 } else if (!contactEmail.equals(other.contactEmail))
145                         return false;
146                 if (contactName == null) {
147                         if (other.contactName != null)
148                                 return false;
149                 } else if (!contactName.equals(other.contactName))
150                         return false;
151                 if (description == null) {
152                         if (other.description != null)
153                                 return false;
154                 } else if (!description.equals(other.description))
155                         return false;
156                 if (url == null) {
157                         if (other.url != null)
158                                 return false;
159                 } else if (!url.equals(other.url))
160                         return false;
161                 return true;
162         }
163
164         @Override
165         public String toString() {
166                 return "AppContactUsItem [appId=" + appId + ", appName=" + appName + ", description=" + description
167                                 + ", contactName=" + contactName + ", contactEmail=" + contactEmail + ", url=" + url + ", activeYN="
168                                 + activeYN + "]";
169         }
170
171 }