import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.FetchType;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.ManyToOne;
-import javax.persistence.OneToMany;
-import javax.persistence.Table;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
-
+import javax.persistence.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* For internal use only.
+ *
* @since 3.6
*/
public static final String STATUS_REMOVED = "REMOVED";
/**
* List of available status
+ *
* @since 3.6
*/
private static final Set<String> STATUS_LIST = ImmutableSet.of(STATUS_READY, STATUS_BETA, STATUS_DEPRECATED, STATUS_REMOVED);
this.configKey = key;
}
- /**
- * Creates a fully qualified rule
- *
- * @param pluginKey the plugin the rule belongs to
- * @param key the key should be unique within a plugin, but it is even more careful for the time being that it is unique across the
- * application
- * @param name the name displayed in the UI
- * @param rulesCategory the ISO category the rule belongs to
- * @param severity this is the severity associated to the rule
- * @deprecated since 2.3. Use the factory method {@link #create()}
- */
- @Deprecated
- public Rule(String pluginKey, String key, String name, RulesCategory rulesCategory, RulePriority severity) {
- setName(name);
- this.key = key;
- this.configKey = key;
- this.priority = severity;
- this.pluginName = pluginKey;
- }
-
- /**
- * @deprecated since 2.3. Use the factory method {@link #create()}
- */
- @Deprecated
- public Rule(String name, String key, RulesCategory rulesCategory, String pluginName, String description) {
- this();
- setName(name);
- this.key = key;
- this.configKey = key;
- this.pluginName = pluginName;
- this.description = description;
- }
-
- /**
- * @deprecated since 2.3. Use the factory method {@link #create()}
- */
- @Deprecated
- public Rule(String name, String key, String configKey, RulesCategory rulesCategory, String pluginName, String description) {
- this();
- setName(name);
- this.key = key;
- this.configKey = configKey;
- this.pluginName = pluginName;
- this.description = description;
- }
-
public Integer getId() {
return id;
}
/**
* For internal use only.
+ *
* @since 3.6
*/
public Rule setLanguage(String language) {
+++ /dev/null
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2013 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.sonar.api.rules;
-
-import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.commons.lang.builder.HashCodeBuilder;
-import org.apache.commons.lang.builder.ToStringBuilder;
-import org.sonar.api.database.BaseIdentifiable;
-
-/**
- * @deprecated since 2.5 See http://jira.codehaus.org/browse/SONAR-2007
- */
-@Deprecated
-public class RulesCategory extends BaseIdentifiable {
-
- private String name;
- private String description;
-
- /**
- * Creates a RuleCategory based on the category name
- *
- * @param name the category name
- */
- public RulesCategory(String name) {
- this.name = name;
- }
-
- /**
- * Creates a category based on the category name and description
- *
- * @param name the category name
- * @param description the category description
- */
- public RulesCategory(String name, String description) {
- this.name = name;
- this.description = description;
- }
-
- /**
- * Creates an empty category
- */
- public RulesCategory() {
- }
-
- /**
- * @return the category name
- */
- public String getName() {
- return name;
- }
-
- /**
- * Sets the category name
- *
- * @param name the name
- */
- public void setName(String name) {
- this.name = name;
- }
-
- /**
- * @return the category description
- */
- public String getDescription() {
- return description;
- }
-
- /**
- * Sets the cay description
- *
- * @param description the description
- */
- public void setDescription(String description) {
- this.description = description;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (!(obj instanceof RulesCategory)) {
- return false;
- }
- if (this == obj) {
- return true;
- }
- RulesCategory other = (RulesCategory) obj;
- return new EqualsBuilder()
- .append(name, other.getName()).isEquals();
- }
-
- @Override
- public int hashCode() {
- return new HashCodeBuilder(17, 37)
- .append(name)
- .toHashCode();
- }
-
- @Override
- public String toString() {
- return new ToStringBuilder(this)
- .append("id", getId())
- .append("name", name)
- .append("desc", description)
- .toString();
- }
-}