You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ImportedRule.java 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*
  2. * SonarQube
  3. * Copyright (C) 2009-2019 SonarSource SA
  4. * mailto:info AT sonarsource DOT com
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 3 of the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public License
  17. * along with this program; if not, write to the Free Software Foundation,
  18. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  19. */
  20. package org.sonar.server.qualityprofile;
  21. import java.util.Map;
  22. import org.sonar.api.rule.RuleKey;
  23. class ImportedRule {
  24. private RuleKey ruleKey = null;
  25. private RuleKey templateKey = null;
  26. private String name = null;
  27. private String type = null;
  28. private String severity = null;
  29. private String description = null;
  30. private Map<String, String> parameters = null;
  31. public Map<String, String> getParameters() {
  32. return parameters;
  33. }
  34. public RuleKey getRuleKey() {
  35. return ruleKey;
  36. }
  37. public RuleKey getTemplateKey() {
  38. return templateKey;
  39. }
  40. public String getName() {
  41. return name;
  42. }
  43. public String getType() {
  44. return type;
  45. }
  46. public String getSeverity() {
  47. return severity;
  48. }
  49. public String getDescription() {
  50. return description;
  51. }
  52. ImportedRule setRuleKey(RuleKey ruleKey) {
  53. this.ruleKey = ruleKey;
  54. return this;
  55. }
  56. ImportedRule setTemplateKey(RuleKey templateKey) {
  57. this.templateKey = templateKey;
  58. return this;
  59. }
  60. ImportedRule setType(String type) {
  61. this.type = type;
  62. return this;
  63. }
  64. ImportedRule setSeverity(String severity) {
  65. this.severity = severity;
  66. return this;
  67. }
  68. ImportedRule setDescription(String description) {
  69. this.description = description;
  70. return this;
  71. }
  72. ImportedRule setParameters(Map<String, String> parameters) {
  73. this.parameters = parameters;
  74. return this;
  75. }
  76. ImportedRule setName(String name) {
  77. this.name = name;
  78. return this;
  79. }
  80. boolean isCustomRule() {
  81. return templateKey != null;
  82. }
  83. }