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

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

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

Rule.isTemplate介绍

暂无

代码示例

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

@Override
public String toString() {
 // Note that ReflectionToStringBuilder will not work here - see SONAR-3077
 return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
  .append("id", id)
  .append("name", name)
  .append("key", key)
  .append("configKey", configKey)
  .append("plugin", pluginName)
  .append("severity", priority)
  .append("isTemplate", isTemplate())
  .append("status", status)
  .append("language", language)
  .append("template", template)
  .toString();
}

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

private void verifyRule(Rule rule, RuleDefinitionDto ruleDefinition, RuleParamDto ruleParam) {
  assertThat(rule).isNotNull();

  assertThat(rule.getName()).isEqualTo(ruleDefinition.getName());
  assertThat(rule.getLanguage()).isEqualTo(ruleDefinition.getLanguage());
  assertThat(rule.getKey()).isEqualTo(ruleDefinition.getRuleKey());
  assertThat(rule.getConfigKey()).isEqualTo(ruleDefinition.getConfigKey());
  assertThat(rule.isTemplate()).isEqualTo(ruleDefinition.isTemplate());
  assertThat(rule.getCreatedAt().getTime()).isEqualTo(ruleDefinition.getCreatedAt());
  assertThat(rule.getUpdatedAt().getTime()).isEqualTo(ruleDefinition.getUpdatedAt());
  assertThat(rule.getRepositoryKey()).isEqualTo(ruleDefinition.getRepositoryKey());
  assertThat(rule.getSeverity().name()).isEqualTo(ruleDefinition.getSeverityString());
  assertThat(rule.getSystemTags()).isEqualTo(ruleDefinition.getSystemTags().stream().toArray(String[]::new));
  assertThat(rule.getTags()).isEmpty();
  assertThat(rule.getId()).isEqualTo(ruleDefinition.getId());
  assertThat(rule.getDescription()).isEqualTo(ruleDefinition.getDescription());

  assertThat(rule.getParams()).hasSize(1);
  org.sonar.api.rules.RuleParam param = rule.getParams().iterator().next();
  assertThat(param.getRule()).isSameAs(rule);
  assertThat(param.getKey()).isEqualTo(ruleParam.getName());
  assertThat(param.getDescription()).isEqualTo(ruleParam.getDescription());
  assertThat(param.getType()).isEqualTo(ruleParam.getType());
  assertThat(param.getDefaultValue()).isEqualTo(ruleParam.getDefaultValue());
 }
}

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

newRule.setHtmlDescription(ruleDescription(repository.getKey(), rule));
newRule.setInternalKey(rule.getConfigKey());
newRule.setTemplate(rule.isTemplate());
newRule.setSeverity(rule.getSeverity().toString());
newRule.setStatus(rule.getStatus() == null ? RuleStatus.defaultStatus() : RuleStatus.valueOf(rule.getStatus()));

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

@Override
public String toString() {
 // Note that ReflectionToStringBuilder will not work here - see SONAR-3077
 return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
  .append("id", id)
  .append("name", name)
  .append("key", key)
  .append("configKey", configKey)
  .append("plugin", pluginName)
  .append("severity", priority)
  .append("isTemplate", isTemplate())
  .append("status", status)
  .append("language", language)
  .append("template", template)
  .toString();
}

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

@Override
public String toString() {
 // Note that ReflectionToStringBuilder will not work here - see SONAR-3077
 return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
  .append("id", id)
  .append("name", name)
  .append("key", key)
  .append("configKey", configKey)
  .append("plugin", pluginName)
  .append("severity", priority)
  .append("isTemplate", isTemplate())
  .append("status", status)
  .append("language", language)
  .append("template", template)
  .toString();
}

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

newRule.setHtmlDescription(ruleDescription(repository.getKey(), rule));
newRule.setInternalKey(rule.getConfigKey());
newRule.setTemplate(rule.isTemplate());
newRule.setSeverity(rule.getSeverity().toString());
newRule.setStatus(rule.getStatus() == null ? RuleStatus.defaultStatus() : RuleStatus.valueOf(rule.getStatus()));

相关文章