本文整理了Java中org.sonar.api.measures.Metric.getEnabled()
方法的一些代码示例,展示了Metric.getEnabled()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Metric.getEnabled()
方法的具体详情如下:
包路径:org.sonar.api.measures.Metric
类名称:Metric
方法名:getEnabled
暂无
代码示例来源:origin: SonarSource/sonarqube
@Test
public void shouldCreateMetricWithDefaultValues() {
Metric metric = new Metric.Builder("foo", "Foo", Metric.ValueType.INT)
.create();
assertThat(metric.getBestValue()).isNull();
assertThat(metric.getDescription()).isNull();
assertThat(metric.getWorstValue()).isNull();
assertThat(metric.getDirection()).isEqualTo(Metric.DIRECTION_NONE);
assertThat(metric.getEnabled()).isTrue();
assertThat(metric.getId()).isNull();
assertThat(metric.getUserManaged()).isFalse();
assertThat(metric.isHidden()).isFalse();
assertThat(metric.isOptimizedBestValue()).isFalse();
}
代码示例来源: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;
}
}
内容来源于网络,如有侵权,请联系作者删除!