[PORTAL-7] Rebase
[portal.git] / ecomp-portal-BE-common / src / main / java / org / openecomp / portalapp / portal / domain / Widget.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.domain;\r
21 \r
22 import org.apache.commons.lang.StringUtils;\r
23 \r
24 import org.openecomp.portalsdk.core.domain.support.DomainVo;\r
25 \r
26 public class Widget extends DomainVo {\r
27 \r
28         private static final long serialVersionUID = 1L;\r
29 \r
30         private String name;\r
31 \r
32         private Integer width;\r
33 \r
34         private Integer height;\r
35 \r
36         private String url;\r
37 \r
38         private Long appId;\r
39 \r
40         public Widget() {\r
41                 // Attention!!!\r
42                 // We set here all default values. We also place protection\r
43                 // into setters for fields with default values.\r
44                 // If we don't use such protection we are able to place null\r
45                 // to these fields and save such fields into DB even if DB has\r
46                 // default values for these fields.\r
47                 this.name = "";\r
48                 this.width = new Integer(0);\r
49                 this.height = new Integer(0);\r
50                 this.url = "";\r
51         }\r
52 \r
53         public String getName() {\r
54                 return name;\r
55         }\r
56 \r
57         public void setName(String name) {\r
58                 if (StringUtils.isEmpty(name)) {\r
59                         name = "";\r
60                 }\r
61                 this.name = name;\r
62         }\r
63 \r
64         public Integer getWidth() {\r
65                 return width;\r
66         }\r
67 \r
68         public void setWidth(Integer width) {\r
69                 if (width == null) {\r
70                         width = new Integer(0);\r
71                 }\r
72                 this.width = width;\r
73         }\r
74 \r
75         public Integer getHeight() {\r
76                 return height;\r
77         }\r
78 \r
79         public void setHeight(Integer height) {\r
80                 if (height == null) {\r
81                         height = new Integer(0);\r
82                 }\r
83                 this.height = height;\r
84         }\r
85 \r
86         public String getUrl() {\r
87                 return url;\r
88         }\r
89 \r
90         public void setUrl(String url) {\r
91                 if (StringUtils.isEmpty(url)) {\r
92                         url = "";\r
93                 }\r
94                 this.url = url;\r
95         }\r
96 \r
97         public Long getAppId() {\r
98                 return appId;\r
99         }\r
100 \r
101         public void setAppId(Long appId) {\r
102                 this.appId = appId;\r
103         }\r
104 \r
105 }\r