*
* MyMeasureComputer underTest = new MyMeasureComputer();
*
- * @Test
+ * {@literal @}Test
* public void test_definition() {
* TestMeasureComputerDefinitionContext defContext = new TestMeasureComputerDefinitionContext();
* MeasureComputerDefinition def = underTest.define(defContext);
* assertThat(def.getOutputMetrics()).containsOnly("my_new_metric");
* }
*
- * @Test
+ * {@literal @}Test
* public void sum_ncloc_and_issues() {
* TestMeasureComputerContext context = new TestMeasureComputerContext(underTest);
* context.addMeasure("ncloc", 2);
Set<String> getOutputMetrics();
interface Builder {
+
/**
- * Input metrics can be empty (for instance when only issues are needed)
+ * List of metric keys of the measures that will be loaded by this computer. It can be empty (for instance when only issues are needed).
+ * A metric must be either a {@link org.sonar.api.measures.CoreMetrics} or a metric provided by {@link org.sonar.api.measures.Metrics}
+ *
* @throws NullPointerException if inputMetrics is null
* @throws NullPointerException if the metrics contains a {@code null}
* */
Builder setInputMetrics(String... inputMetrics);
/**
+ * List of metric keys of the measures that can be added by this computer. At least one metric key must be defined.
+ *
+ * At runtime, the following conditions will be validated :
+ * <ul>
+ * <li>A metric must be defined by {@link org.sonar.api.measures.Metrics}</li>
+ * <li>A metric cannot be a {@link org.sonar.api.measures.CoreMetrics}</li>
+ * <li>A metric must be generated by only one {@link MeasureComputer}</li>
+ * </ul>
+ *
* @throws NullPointerException if outputMetrics is null
* @throws IllegalArgumentException if there's not at least one output metrics
* @throws NullPointerException if the metrics contains a {@code null}