@ScannerSide @ServerSide @ComputeEngineSide public class Metric<G extends Serializable> extends Object implements Serializable, Metric<G>
Metrics extension point.
 Should no more be used on scanner side. Use Metric instead.| Modifier and Type | Class and Description | 
|---|---|
| static class  | Metric.BuilderMetric.Builder is used to create metric definitions. | 
| static class  | Metric.Level | 
| static class  | Metric.ValueType | 
| Modifier and Type | Field and Description | 
|---|---|
| static int | DEFAULT_DECIMAL_SCALE | 
| static int | DIRECTION_BETTERA metric bigger value means an improvement | 
| static int | DIRECTION_NONEThe metric direction has no meaning | 
| static int | DIRECTION_WORSTA metric bigger value means a degradation | 
| static int | MAX_DECIMAL_SCALEThe maximum supported value of scale for decimal metrics | 
| Constructor and Description | 
|---|
| Metric()Deprecated. 
 in 1.12. Use the  Metric.Builderfactory. | 
| Metric(String key)Deprecated. 
 since 2.7 use the  Metric.Builderfactory. | 
| Metric(String key,
      Metric.ValueType type)Deprecated. 
 since 2.7 use the  Metric.Builderfactory. | 
| Metric(String key,
      String name,
      String description,
      Metric.ValueType type,
      Integer direction,
      Boolean qualitative,
      String domain)Deprecated. 
 since 2.7 use the  Metric.Builderfactory. | 
| Modifier and Type | Method and Description | 
|---|---|
| boolean | equals(Object obj) | 
| Double | getBestValue() | 
| Integer | getDecimalScale()Return the number scale if metric type is  Metric.ValueType.FLOAT, elsenull | 
| Boolean | getDeleteHistoricalData() | 
| String | getDescription() | 
| Integer | getDirection() | 
| String | getDomain() | 
| Boolean | getEnabled() | 
| Formula | getFormula()Deprecated. 
 since 5.2 there's no more decorator on batch side, please use  MeasureComputerinstead | 
| Integer | getId()For internal use only | 
| String | getKey() | 
| String | getName() | 
| Boolean | getQualitative() | 
| Metric.ValueType | getType() | 
| Boolean | getUserManaged() | 
| Double | getWorstValue() | 
| int | hashCode() | 
| boolean | isDataType() | 
| Boolean | isHidden() | 
| boolean | isNumericType() | 
| Boolean | isOptimizedBestValue() | 
| boolean | isPercentageType() | 
| String | key() | 
| Metric<G> | merge(Metric with)Merge with fields from other metric. | 
| Metric<G> | setBestValue(Double bestValue) | 
| Metric<G> | setDescription(String description)Sets the metric description | 
| Metric<G> | setDirection(Integer direction)Sets the metric direction. | 
| Metric<G> | setDomain(String domain)Sets the domain for the metric (General, Complexity...) | 
| Metric<G> | setEnabled(Boolean enabled)Sets whether the metric is enabled | 
| Metric<G> | setFormula(Formula formula)Deprecated. 
 since 5.2 there's no more decorator on batch side, please use  MeasureComputerinstead | 
| Metric<G> | setHidden(Boolean hidden) | 
| Metric<G> | setId(Integer id)For internal use only | 
| Metric<G> | setKey(String key)Sets the metric key | 
| Metric<G> | setName(String name)Sets the metric name | 
| Metric<G> | setOptimizedBestValue(Boolean b) | 
| Metric<G> | setQualitative(Boolean qualitative)Sets whether the metric is qualitative | 
| Metric<G> | setType(Metric.ValueType type)Sets the metric type | 
| Metric<G> | setUserManaged(Boolean userManaged)Sets whether the metric is managed by users ("manual metric") | 
| Metric<G> | setWorstValue(Double d) | 
| String | toString() | 
| Class<G> | valueType() | 
public static final int DEFAULT_DECIMAL_SCALE
public static final int MAX_DECIMAL_SCALE
public static final int DIRECTION_WORST
public static final int DIRECTION_BETTER
public static final int DIRECTION_NONE
@Deprecated public Metric()
Metric.Builder factory.@Deprecated public Metric(String key)
Metric.Builder factory.key - the metric key@Deprecated public Metric(String key, Metric.ValueType type)
Metric.Builder factory.key - the keytype - the type@Deprecated public Metric(String key, String name, String description, Metric.ValueType type, Integer direction, Boolean qualitative, String domain)
Metric.Builder factory.@Deprecated public Formula getFormula()
MeasureComputer instead@Deprecated public Metric<G> setFormula(Formula formula)
MeasureComputer insteadformula - the formulapublic Boolean getQualitative()
public Metric<G> setQualitative(Boolean qualitative)
qualitative - whether the metric is qualitativepublic Metric<G> setKey(String key)
key - the keypublic Metric.ValueType getType()
public Metric<G> setType(Metric.ValueType type)
type - the type@CheckForNull public String getDescription()
public Metric<G> setDescription(@Nullable String description)
description - the descriptionpublic Boolean getUserManaged()
public Metric<G> setUserManaged(Boolean userManaged)
userManaged - whether the metric is user managedpublic Boolean getEnabled()
public Metric<G> setEnabled(Boolean enabled)
enabled - whether the metric is enabledpublic Integer getDirection()
public Metric<G> setDirection(Integer direction)
direction - the directionpublic Metric<G> setDomain(String domain)
domain - the domainpublic Metric<G> setName(String name)
name - the namepublic Double getWorstValue()
@CheckForNull public Double getBestValue()
public Metric<G> setWorstValue(@Nullable Double d)
public Metric<G> setBestValue(@Nullable Double bestValue)
bestValue - the best value. It can be null.public boolean isNumericType()
public boolean isDataType()
public boolean isPercentageType()
public Metric<G> setOptimizedBestValue(@Nullable Boolean b)
@CheckForNull public Boolean isOptimizedBestValue()
public Boolean getDeleteHistoricalData()
@CheckForNull public Integer getDecimalScale()
Metric.ValueType.FLOAT, else nullpublic Metric<G> merge(Metric with)
Copyright © 2009–2016 SonarSource. All rights reserved.