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.base.Objects;
023
024public final class ActiveDashboardDto {
025  private Long id;
026  private Long dashboardId;
027  private Long userId;
028  private Integer orderIndex;
029
030  /**
031   * @return the id
032   */
033  public Long getId() {
034    return id;
035  }
036
037  /**
038   * @param id the id to set
039   */
040  public ActiveDashboardDto setId(Long id) {
041    this.id = id;
042    return this;
043  }
044
045  /**
046   * @return the dashboardId
047   */
048  public Long getDashboardId() {
049    return dashboardId;
050  }
051
052  /**
053   * @param dashboardId the dashboardId to set
054   */
055  public ActiveDashboardDto setDashboardId(Long dashboardId) {
056    this.dashboardId = dashboardId;
057    return this;
058  }
059
060  /**
061   * @return the userId
062   */
063  public Long getUserId() {
064    return userId;
065  }
066
067  /**
068   * @param userId the userId to set
069   */
070  public ActiveDashboardDto setUserId(Long userId) {
071    this.userId = userId;
072    return this;
073  }
074
075  /**
076   * @return the orderIndex
077   */
078  public Integer getOrderIndex() {
079    return orderIndex;
080  }
081
082  /**
083   * @param orderIndex the orderIndex to set
084   */
085  public ActiveDashboardDto setOrderIndex(Integer orderIndex) {
086    this.orderIndex = orderIndex;
087    return this;
088  }
089
090  @Override
091  public boolean equals(Object o) {
092    if (this == o) {
093      return true;
094    }
095    if (o == null || getClass() != o.getClass()) {
096      return false;
097    }
098    ActiveDashboardDto that = (ActiveDashboardDto) o;
099    return !(id != null ? !id.equals(that.id) : that.id != null);
100  }
101
102  @Override
103  public int hashCode() {
104    return Objects.hashCode(id);
105  }
106}