org.sonar.api.rules.Rule.equals()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(120)

本文整理了Java中org.sonar.api.rules.Rule.equals方法的一些代码示例,展示了Rule.equals的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Rule.equals方法的具体详情如下:
包路径:org.sonar.api.rules.Rule
类名称:Rule
方法名:equals

Rule.equals介绍

暂无

代码示例

代码示例来源:origin: SonarSource/sonarqube

@Override
public boolean equals(Object o) {
 if (this == o) {
  return true;
 }
 if (o == null || getClass() != o.getClass()) {
  return false;
 }
 ActiveRule that = (ActiveRule) o;
 if (!rule.equals(that.rule)) {
  return false;
 }
 return !((rulesProfile != null) ? !rulesProfile.equals(that.rulesProfile) : (that.rulesProfile != null));
}

代码示例来源:origin: SonarSource/sonarqube

/**
 * @param optionalSeverity if null, then the default rule severity is used
 */
public ActiveRule activateRule(final Rule rule, @Nullable RulePriority optionalSeverity) {
 if (activeRules.stream().anyMatch(ar -> ar.getRule().equals(rule))) {
  throw MessageException.of(String.format(
   "The definition of the profile '%s' (language '%s') contains multiple occurrences of the '%s:%s' rule. The plugin which declares this profile should fix this.",
   getName(), getLanguage(), rule.getRepositoryKey(), rule.getKey()));
 }
 ActiveRule activeRule = new ActiveRule(this, rule, optionalSeverity);
 activeRules.add(activeRule);
 return activeRule;
}

代码示例来源:origin: org.codehaus.sonar/sonar-plugin-api

@Override
 public boolean apply(ActiveRule input) {
  return input.getRule().equals(rule);
 }
})) {

代码示例来源:origin: org.sonarsource.sonarqube/sonar-plugin-api

@Override
public boolean equals(Object o) {
 if (this == o) {
  return true;
 }
 if (o == null || getClass() != o.getClass()) {
  return false;
 }
 ActiveRule that = (ActiveRule) o;
 if (!rule.equals(that.rule)) {
  return false;
 }
 return !((rulesProfile != null) ? !rulesProfile.equals(that.rulesProfile) : (that.rulesProfile != null));
}

代码示例来源:origin: org.codehaus.sonar/sonar-plugin-api

@Override
public boolean equals(Object o) {
 if (this == o) {
  return true;
 }
 if (o == null || getClass() != o.getClass()) {
  return false;
 }
 ActiveRule that = (ActiveRule) o;
 if (!rule.equals(that.rule)) {
  return false;
 }
 if (rulesProfile != null ? !rulesProfile.equals(that.rulesProfile) : that.rulesProfile != null) {
  return false;
 }
 return true;
}

代码示例来源:origin: org.sonarsource.sonarqube/sonar-plugin-api

/**
 * @param optionalSeverity if null, then the default rule severity is used
 */
public ActiveRule activateRule(final Rule rule, @Nullable RulePriority optionalSeverity) {
 if (activeRules.stream().anyMatch(ar -> ar.getRule().equals(rule))) {
  throw MessageException.of(String.format(
   "The definition of the profile '%s' (language '%s') contains multiple occurrences of the '%s:%s' rule. The plugin which declares this profile should fix this.",
   getName(), getLanguage(), rule.getRepositoryKey(), rule.getKey()));
 }
 ActiveRule activeRule = new ActiveRule(this, rule, optionalSeverity);
 activeRules.add(activeRule);
 return activeRule;
}

相关文章