import org.sonar.api.rules.Rule;
import org.sonar.api.rules.RulePriority;
+import javax.annotation.CheckForNull;
import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;
*
* @since 2.5
*/
+ @CheckForNull
public String getParentName() {
return parentName;
}
*
* @return an active rule from a plugin key and a rule key if the rule is activated, null otherwise
*/
+ @CheckForNull
public ActiveRule getActiveRule(String repositoryKey, String ruleKey) {
for (ActiveRule activeRule : activeRules) {
if (StringUtils.equals(activeRule.getRepositoryKey(), repositoryKey) && StringUtils.equals(activeRule.getRuleKey(), ruleKey) && activeRule.isEnabled()) {
/**
* Note: disabled rules are excluded.
*/
+ @CheckForNull
public ActiveRule getActiveRuleByConfigKey(String repositoryKey, String configKey) {
for (ActiveRule activeRule : activeRules) {
if (StringUtils.equals(activeRule.getRepositoryKey(), repositoryKey) && StringUtils.equals(activeRule.getConfigKey(), configKey) && activeRule.isEnabled()) {
/**
* Note: disabled rules are excluded.
*/
-
+ @CheckForNull
public ActiveRule getActiveRule(Rule rule) {
return getActiveRule(rule.getRepositoryKey(), rule.getKey());
}