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.

RuleExtensionForIndexingDto.java 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*
  2. * SonarQube
  3. * Copyright (C) 2009-2020 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.db.rule;
  21. import com.google.common.base.Splitter;
  22. import com.google.common.collect.ImmutableSet;
  23. import java.util.Set;
  24. import org.sonar.api.rule.RuleKey;
  25. public class RuleExtensionForIndexingDto {
  26. private static final Splitter TAGS_SPLITTER = Splitter.on(',').trimResults().omitEmptyStrings();
  27. private String ruleUuid;
  28. private String pluginName;
  29. private String pluginRuleKey;
  30. private String organizationUuid;
  31. private String tags;
  32. public String getPluginName() {
  33. return pluginName;
  34. }
  35. public RuleExtensionForIndexingDto setPluginName(String pluginName) {
  36. this.pluginName = pluginName;
  37. return this;
  38. }
  39. public String getPluginRuleKey() {
  40. return pluginRuleKey;
  41. }
  42. public RuleExtensionForIndexingDto setPluginRuleKey(String pluginRuleKey) {
  43. this.pluginRuleKey = pluginRuleKey;
  44. return this;
  45. }
  46. public String getRuleUuid() {
  47. return ruleUuid;
  48. }
  49. public void setRuleUuid(String ruleUuid) {
  50. this.ruleUuid = ruleUuid;
  51. }
  52. public String getOrganizationUuid() {
  53. return organizationUuid;
  54. }
  55. public RuleExtensionForIndexingDto setOrganizationUuid(String organizationUuid) {
  56. this.organizationUuid = organizationUuid;
  57. return this;
  58. }
  59. public String getTags() {
  60. return tags;
  61. }
  62. public RuleExtensionForIndexingDto setTags(String tags) {
  63. this.tags = tags;
  64. return this;
  65. }
  66. public RuleKey getRuleKey() {
  67. return RuleKey.of(pluginName, pluginRuleKey);
  68. }
  69. public Set<String> getTagsAsSet() {
  70. return ImmutableSet.copyOf(TAGS_SPLITTER.split(tags == null ? "" : tags));
  71. }
  72. }