org.sonar.api.measures.Metric.getDomain()方法的使用及代码示例

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

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

Metric.getDomain介绍

暂无

代码示例

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

@Test
 public void checkDefinitions() {
  CoreCustomMetrics coreCustomMetrics = new CoreCustomMetrics();
  List<Metric> metrics = coreCustomMetrics.getMetrics();
  assertThat(metrics.size()).isGreaterThan(2);
  for (Metric metric : metrics) {
   assertThat(metric.getUserManaged()).isTrue();
   assertThat(metric.getDomain()).isEqualTo("Management");
  }
 }
}

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

@Test
public void shouldCreateMetric() {
 Metric metric = new Metric.Builder("foo", "Foo", Metric.ValueType.INT)
  .setDomain("my domain")
  .create();
 assertThat(metric.getKey()).isEqualTo("foo");
 assertThat(metric.getName()).isEqualTo("Foo");
 assertThat(metric.getDomain()).isEqualTo("my domain");
}

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

@Override
 @Nonnull
 public MetricDto apply(@Nonnull Metric metric) {
  MetricDto dto = new MetricDto();
  dto.setId(metric.getId());
  dto.setKey(metric.getKey());
  dto.setDescription(metric.getDescription());
  dto.setShortName(metric.getName());
  dto.setBestValue(metric.getBestValue());
  dto.setDomain(metric.getDomain());
  dto.setEnabled(metric.getEnabled());
  dto.setDirection(metric.getDirection());
  dto.setHidden(metric.isHidden());
  dto.setQualitative(metric.getQualitative());
  dto.setValueType(metric.getType().name());
  dto.setOptimizedBestValue(metric.isOptimizedBestValue());
  dto.setUserManaged(metric.getUserManaged());
  dto.setWorstValue(metric.getWorstValue());
  dto.setDeleteHistoricalData(metric.getDeleteHistoricalData());
  dto.setDecimalScale(metric.getDecimalScale());
  return dto;
 }
}

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

@Override
 @Nonnull
 public MetricDto apply(@Nonnull Metric metric) {
  MetricDto dto = new MetricDto();
  dto.setId(metric.getId());
  dto.setKey(metric.getKey());
  dto.setDescription(metric.getDescription());
  dto.setShortName(metric.getName());
  dto.setBestValue(metric.getBestValue());
  dto.setDomain(metric.getDomain());
  dto.setEnabled(metric.getEnabled());
  dto.setDirection(metric.getDirection());
  dto.setHidden(metric.isHidden());
  dto.setQualitative(metric.getQualitative());
  dto.setValueType(metric.getType().name());
  dto.setOptimizedBestValue(metric.isOptimizedBestValue());
  dto.setUserManaged(metric.getUserManaged());
  dto.setWorstValue(metric.getWorstValue());
  dto.setDeleteHistoricalData(metric.getDeleteHistoricalData());
  dto.setDecimalScale(metric.getDecimalScale());
  return dto;
 }
}

相关文章