001 /*
002 * SonarQube, open source software quality management tool.
003 * Copyright (C) 2008-2014 SonarSource
004 * mailto:contact AT sonarsource DOT com
005 *
006 * SonarQube 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 * SonarQube 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 License
017 * along with this program; if not, write to the Free Software Foundation,
018 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
019 */
020 package org.sonar.batch.rule;
021
022 import com.google.common.base.Objects;
023
024 import java.util.Date;
025
026 public class QProfile {
027
028 private String key, name, language;
029 private Date rulesUpdatedAt;
030
031 public String getKey() {
032 return key;
033 }
034
035 public QProfile setKey(String key) {
036 this.key = key;
037 return this;
038 }
039
040 public String getName() {
041 return name;
042 }
043
044 public QProfile setName(String name) {
045 this.name = name;
046 return this;
047 }
048
049 public String getLanguage() {
050 return language;
051 }
052
053 public QProfile setLanguage(String language) {
054 this.language = language;
055 return this;
056 }
057
058 public Date getRulesUpdatedAt() {
059 return rulesUpdatedAt;
060 }
061
062 public QProfile setRulesUpdatedAt(Date d) {
063 this.rulesUpdatedAt = d;
064 return this;
065 }
066
067 @Override
068 public boolean equals(Object o) {
069 if (this == o) {
070 return true;
071 }
072 if (o == null || getClass() != o.getClass()) {
073 return false;
074 }
075
076 QProfile qProfile = (QProfile) o;
077 return key.equals(qProfile.key);
078 }
079
080 @Override
081 public int hashCode() {
082 return key.hashCode();
083 }
084
085 @Override
086 public String toString() {
087 return Objects.toStringHelper(this)
088 .add("key", key)
089 .add("name", name)
090 .add("language", language)
091 .add("rulesUpdatedAt", rulesUpdatedAt)
092 .toString();
093 }
094 }