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