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