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.server.configuration;
021
022import com.thoughtworks.xstream.annotations.XStreamAlias;
023import org.apache.commons.lang.builder.ToStringBuilder;
024import org.sonar.api.database.configuration.Property;
025import org.sonar.api.measures.Metric;
026import org.sonar.api.profiles.RulesProfile;
027import org.sonar.api.rules.Rule;
028
029import java.util.Collection;
030import java.util.Date;
031
032@XStreamAlias("sonar-config")
033public class SonarConfig {
034
035  private Integer version;
036
037  private Date date;
038
039  private Collection<Metric> metrics;
040
041  private Collection<Property> properties;
042
043  private Collection<RulesProfile> profiles;
044
045  private Collection<Rule> rules;
046
047  public SonarConfig() {
048  }
049
050  public SonarConfig(Integer version, Date date) {
051    this.version = version;
052    this.date = date;
053  }
054
055  public Integer getVersion() {
056    return version;
057  }
058
059  public void setVersion(Integer version) {
060    this.version = version;
061  }
062
063  public Date getDate() {
064    return date;
065  }
066
067  public void setDate(Date date) {
068    this.date = date;
069  }
070
071  public Collection<Metric> getMetrics() {
072    return metrics;
073  }
074
075  public void setMetrics(Collection<Metric> metrics) {
076    this.metrics = metrics;
077  }
078
079  public Collection<Property> getProperties() {
080    return properties;
081  }
082
083  public void setProperties(Collection<Property> properties) {
084    this.properties = properties;
085  }
086
087  public Collection<RulesProfile> getProfiles() {
088    return profiles;
089  }
090
091  public void setProfiles(Collection<RulesProfile> profiles) {
092    this.profiles = profiles;
093  }
094
095  public Collection<Rule> getRules() {
096    return rules;
097  }
098
099  public void setRules(Collection<Rule> rules) {
100    this.rules = rules;
101  }
102
103  @Override
104  public String toString() {
105    return new ToStringBuilder(this)
106        .append("version", version)
107        .append("date", date)
108        .append("metrics", metrics)
109        .append("properties", properties)
110        .append("profiles", profiles)
111        .toString();
112  }
113
114}