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     */
020    package org.sonar.core.template;
021    
022    public final class LoadedTemplateDto {
023    
024      public static final String DASHBOARD_TYPE = "DASHBOARD";
025    
026      private Long id;
027      private String key;
028      private String type;
029    
030      public LoadedTemplateDto() {
031      }
032    
033      public LoadedTemplateDto(String key, String type) {
034        this.key = key;
035        this.type = type;
036      }
037    
038      public Long getId() {
039        return id;
040      }
041    
042      public LoadedTemplateDto setId(Long l) {
043        this.id = l;
044        return this;
045      }
046    
047      public String getKey() {
048        return key;
049      }
050    
051      public LoadedTemplateDto setKey(String key) {
052        this.key = key;
053        return this;
054      }
055    
056      public String getType() {
057        return type;
058      }
059    
060      public LoadedTemplateDto setType(String type) {
061        this.type = type;
062        return this;
063      }
064    
065      @Override
066      public boolean equals(Object o) {
067        if (this == o) {
068          return true;
069        }
070        if (o == null || getClass() != o.getClass()) {
071          return false;
072        }
073        LoadedTemplateDto that = (LoadedTemplateDto) o;
074        if (id != null ? !id.equals(that.id) : that.id != null) {
075          return false;
076        }
077        return true;
078      }
079    
080      @Override
081      public int hashCode() {
082        return id != null ? id.hashCode() : 0;
083      }
084    }