001/*
002 * Sonar, open source software quality management tool.
003 * Copyright (C) 2008-2012 SonarSource
004 * mailto:contact AT sonarsource DOT com
005 *
006 * Sonar is free software; you can redistribute it and/or
007 * modify it under the terms of the GNU Lesser General Public
008 * License as published by the Free Software Foundation; either
009 * version 3 of the License, or (at your option) any later version.
010 *
011 * Sonar is distributed in the hope that it will be useful,
012 * but WITHOUT ANY WARRANTY; without even the implied warranty of
013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014 * Lesser General Public License for more details.
015 *
016 * You should have received a copy of the GNU Lesser General Public
017 * License along with Sonar; if not, write to the Free Software
018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
019 */
020package org.sonar.core.dashboard;
021
022import com.google.common.collect.Lists;
023
024import java.util.Collection;
025import java.util.Date;
026import java.util.List;
027
028public final class WidgetDto {
029  private Long id;
030  private Long dashboardId;
031  private String key;
032  private String name;
033  private String description;
034  private Integer columnIndex;
035  private Integer rowIndex;
036  private boolean configured;
037  private Date createdAt;
038  private Date updatedAt;
039  private Integer resourceId;
040  private List<WidgetPropertyDto> widgetPropertyDtos = Lists.newArrayList();
041
042  /**
043   * @return the id
044   */
045  public Long getId() {
046    return id;
047  }
048
049  /**
050   * @param id the id to set
051   */
052  public WidgetDto setId(Long id) {
053    this.id = id;
054    return this;
055  }
056
057  /**
058   * @return the dashboardId
059   */
060  public Long getDashboardId() {
061    return dashboardId;
062  }
063
064  /**
065   * @param dashboardId the dashboardId to set
066   */
067  public WidgetDto setDashboardId(Long dashboardId) {
068    this.dashboardId = dashboardId;
069    return this;
070  }
071
072  /**
073   * @return the key
074   */
075  public String getKey() {
076    return key;
077  }
078
079  /**
080   * @param key the key to set
081   */
082  public WidgetDto setKey(String key) {
083    this.key = key;
084    return this;
085  }
086
087  /**
088   * @return the name
089   */
090  public String getName() {
091    return name;
092  }
093
094  /**
095   * @param name the name to set
096   */
097  public WidgetDto setName(String name) {
098    this.name = name;
099    return this;
100  }
101
102  /**
103   * @return the description
104   */
105  public String getDescription() {
106    return description;
107  }
108
109  /**
110   * @param description the description to set
111   */
112  public WidgetDto setDescription(String description) {
113    this.description = description;
114    return this;
115  }
116
117  /**
118   * @return the columnIndex
119   */
120  public Integer getColumnIndex() {
121    return columnIndex;
122  }
123
124  /**
125   * @param columnIndex the columnIndex to set
126   */
127  public WidgetDto setColumnIndex(Integer columnIndex) {
128    this.columnIndex = columnIndex;
129    return this;
130  }
131
132  /**
133   * @return the rowIndex
134   */
135  public Integer getRowIndex() {
136    return rowIndex;
137  }
138
139  /**
140   * @param rowIndex the rowIndex to set
141   */
142  public WidgetDto setRowIndex(Integer rowIndex) {
143    this.rowIndex = rowIndex;
144    return this;
145  }
146
147  /**
148   * @return the configured
149   */
150  public boolean getConfigured() {
151    return configured;
152  }
153
154  /**
155   * @param configured the configured to set
156   */
157  public WidgetDto setConfigured(boolean configured) {
158    this.configured = configured;
159    return this;
160  }
161
162  /**
163   * @return the createdAt
164   */
165  public Date getCreatedAt() {
166    return createdAt;
167  }
168
169  /**
170   * @param createdAt the createdAt to set
171   */
172  public WidgetDto setCreatedAt(Date createdAt) {
173    this.createdAt = createdAt;
174    return this;
175  }
176
177  /**
178   * @return the updatedAt
179   */
180  public Date getUpdatedAt() {
181    return updatedAt;
182  }
183
184  /**
185   * @param updatedAt the updatedAt to set
186   */
187  public WidgetDto setUpdatedAt(Date updatedAt) {
188    this.updatedAt = updatedAt;
189    return this;
190  }
191
192  /**
193   * @return the widgetProperties
194   */
195  public Collection<WidgetPropertyDto> getWidgetProperties() {
196    return widgetPropertyDtos;
197  }
198
199  /**
200   * @param widgetPropertyDto the widgetProperty to set
201   */
202  public WidgetDto addWidgetProperty(WidgetPropertyDto widgetPropertyDto) {
203    widgetPropertyDtos.add(widgetPropertyDto);
204    return this;
205  }
206
207  /**
208   * @return the resourceId
209   * @since 3.1
210   */
211  public Integer getResourceId() {
212    return resourceId;
213  }
214
215  /**
216   * @param resourceId the resourceId to set
217   * @since 3.1
218   */
219  public WidgetDto setResourceId(Integer resourceId) {
220    this.resourceId = resourceId;
221    return this;
222  }
223}