2 * ================================================================================
\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
11 * http://www.apache.org/licenses/LICENSE-2.0
\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
20 package org.openecomp.portalapp.portal.domain;
\r
22 import org.apache.commons.lang.StringUtils;
\r
24 import org.openecomp.portalsdk.core.domain.support.DomainVo;
\r
26 public class Widget extends DomainVo {
\r
28 private static final long serialVersionUID = 1L;
\r
30 private String name;
\r
32 private Integer width;
\r
34 private Integer height;
\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
48 this.width = new Integer(0);
\r
49 this.height = new Integer(0);
\r
53 public String getName() {
\r
57 public void setName(String name) {
\r
58 if (StringUtils.isEmpty(name)) {
\r
64 public Integer getWidth() {
\r
68 public void setWidth(Integer width) {
\r
69 if (width == null) {
\r
70 width = new Integer(0);
\r
75 public Integer getHeight() {
\r
79 public void setHeight(Integer height) {
\r
80 if (height == null) {
\r
81 height = new Integer(0);
\r
83 this.height = height;
\r
86 public String getUrl() {
\r
90 public void setUrl(String url) {
\r
91 if (StringUtils.isEmpty(url)) {
\r
97 public Long getAppId() {
\r
101 public void setAppId(Long appId) {
\r
102 this.appId = appId;
\r