diff options
author | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2015-06-24 16:26:13 +0200 |
---|---|---|
committer | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2015-06-24 16:27:38 +0200 |
commit | 387b9e20799b9890b9b04636440be718f0cd38f6 (patch) | |
tree | 4dee1725e4d2dc3a3f7ff23ae8a646ccf04a3d0f /sonar-plugin-api | |
parent | 86bec73a9c8db5c695042b83d54b06fe2ce9de6d (diff) | |
download | sonarqube-387b9e20799b9890b9b04636440be718f0cd38f6.tar.gz sonarqube-387b9e20799b9890b9b04636440be718f0cd38f6.zip |
Update metric type JSON format SONAR-6570 SONAR-6578 SONAR-6610 SONAR-6611
WS updated:
- metrics/search
- metrics/types
- custom_measures/create
- custom_measures/update
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/measures/Metric.java | 40 |
1 files changed, 12 insertions, 28 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/measures/Metric.java b/sonar-plugin-api/src/main/java/org/sonar/api/measures/Metric.java index 5ca083bb929..b0c51aa20c7 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/measures/Metric.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/measures/Metric.java @@ -68,34 +68,28 @@ public class Metric<G extends Serializable> implements Serializable, org.sonar.a public static final int DIRECTION_NONE = 0; public enum ValueType { - INT(Integer.class, "Integer"), - FLOAT(Double.class, "Float"), - PERCENT(Double.class, "Percent"), - BOOL(Boolean.class, "Yes/No"), - STRING(String.class, "String"), - MILLISEC(Integer.class, "Milliseconds"), - DATA(String.class, "Data"), - LEVEL(Metric.Level.class, "Level"), - DISTRIB(String.class, "Distribution"), - RATING(Integer.class, "Rating"), - WORK_DUR(Long.class, "Work Duration"); + INT(Integer.class), + FLOAT(Double.class), + PERCENT(Double.class), + BOOL(Boolean.class), + STRING(String.class), + MILLISEC(Integer.class), + DATA(String.class), + LEVEL(Metric.Level.class), + DISTRIB(String.class), + RATING(Integer.class), + WORK_DUR(Long.class); private final Class valueClass; - private final String description; - ValueType(Class valueClass, String description) { + ValueType(Class valueClass) { this.valueClass = valueClass; - this.description = description; } private Class valueType() { return valueClass; } - public String description() { - return description; - } - public static String[] names() { ValueType[] values = values(); String[] names = new String[values.length]; @@ -105,16 +99,6 @@ public class Metric<G extends Serializable> implements Serializable, org.sonar.a return names; } - - public static String descriptionOf(String key) { - for (ValueType valueType : values()) { - if (valueType.name().equals(key)) { - return valueType.description; - } - } - - throw new IllegalArgumentException(String.format("Unknown ValueType key '%s'", key)); - } } public enum Level { |