public class Metric extends Object implements ServerExtension, BatchExtension
Modifier and Type | Class and Description |
---|---|
static class |
Metric.Builder
Metric.Builder is used to create metric definitions.
|
static class |
Metric.Level |
static class |
Metric.Origin |
static class |
Metric.ValueType |
Modifier and Type | Field and Description |
---|---|
static int |
DIRECTION_BETTER
A metric bigger value means an improvement
|
static int |
DIRECTION_NONE
The metric direction has no meaning
|
static int |
DIRECTION_WORST
A metric bigger value means a degradation
|
Constructor and Description |
---|
Metric()
Deprecated.
in 1.12. Use the
Metric.Builder factory. |
Metric(String key)
Deprecated.
since 2.7 use the
Metric.Builder factory. |
Metric(String key,
Metric.ValueType type)
Deprecated.
since 2.7 use the
Metric.Builder factory. |
Metric(String key,
String name,
Metric.ValueType type,
Integer direction,
Boolean qualitative,
String domain,
Formula formula)
Deprecated.
since 2.7 use the
Metric.Builder factory. |
Metric(String key,
String name,
String description,
Metric.ValueType type,
Integer direction,
Boolean qualitative,
String domain)
Deprecated.
since 2.7 use the
Metric.Builder factory. |
Metric(String key,
String name,
String description,
Metric.ValueType type,
Integer direction,
Boolean qualitative,
String domain,
boolean userManaged)
Deprecated.
since 2.7 use the
Metric.Builder factory. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
Double |
getBestValue() |
Boolean |
getDeleteHistoricalData() |
String |
getDescription() |
Integer |
getDirection() |
String |
getDomain() |
Boolean |
getEnabled() |
Formula |
getFormula() |
Integer |
getId()
For internal use only
|
String |
getKey() |
String |
getName() |
Metric.Origin |
getOrigin() |
Boolean |
getQualitative() |
Metric.ValueType |
getType() |
Boolean |
getUserManaged() |
Double |
getWorstValue() |
int |
hashCode() |
boolean |
isDataType() |
Boolean |
isHidden() |
boolean |
isNumericType() |
Boolean |
isOptimizedBestValue() |
boolean |
isPercentageType() |
Metric |
merge(Metric with)
Merge with fields from other metric.
|
Metric |
setBestValue(Double bestValue) |
Metric |
setDescription(String description)
Sets the metric description
|
Metric |
setDirection(Integer direction)
Sets the metric direction.
|
Metric |
setDomain(String domain)
Sets the domain for the metric (General, Complexity...)
|
Metric |
setEnabled(Boolean enabled)
Sets whether the metric is enabled
|
Metric |
setFormula(Formula formula)
Sets the metric formula
|
Metric |
setHidden(Boolean hidden) |
Metric |
setId(Integer id)
For internal use only
|
Metric |
setKey(String key)
Sets the metric key
|
Metric |
setName(String name)
Sets the metric name
|
Metric |
setOptimizedBestValue(Boolean b) |
Metric |
setOrigin(Metric.Origin origin)
Set the origin of the metric - Internal use only
|
Metric |
setQualitative(Boolean qualitative)
Sets whether the metric is qualitative
|
Metric |
setType(Metric.ValueType type)
Sets the metric type
|
Metric |
setUserManaged(Boolean userManaged)
Sets whether the metric is managed by users ("manual metric")
|
Metric |
setWorstValue(Double d) |
String |
toString() |
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 Metric(String key, String name, String description, Metric.ValueType type, Integer direction, Boolean qualitative, @Nullable String domain, boolean userManaged)
Metric.Builder
factory.key
- the metric keyname
- the metric namedescription
- the metric descriptiontype
- the metric typedirection
- the metric directionqualitative
- whether the metric is qualitativedomain
- the metric domainuserManaged
- whether the metric is user managed@Deprecated public Metric(String key, String name, Metric.ValueType type, Integer direction, Boolean qualitative, String domain, Formula formula)
Metric.Builder
factory.key
- the metric keyname
- the metric nametype
- the metric typedirection
- the metric directionqualitative
- whether the metric is qualitativedomain
- the metric domainformula
- the metric formulapublic Formula getFormula()
public Metric setFormula(Formula formula)
formula
- the formulapublic Boolean getQualitative()
public Metric setQualitative(Boolean qualitative)
qualitative
- whether the metric is qualitativepublic Metric.ValueType getType()
public Metric setType(Metric.ValueType type)
type
- the typepublic String getDescription()
public Metric setDescription(String description)
description
- the descriptionpublic Boolean getUserManaged()
public Metric setUserManaged(Boolean userManaged)
userManaged
- whether the metric is user managedpublic Boolean getEnabled()
public Metric setEnabled(Boolean enabled)
enabled
- whether the metric is enabledpublic Integer getDirection()
public Metric setDirection(Integer direction)
direction
- the directionpublic Metric setDomain(String domain)
domain
- the domainpublic Metric setName(String name)
name
- the namepublic Metric.Origin getOrigin()
public Metric setOrigin(Metric.Origin origin)
origin
- the originpublic Double getWorstValue()
public Double getBestValue()
public Metric setWorstValue(Double d)
public Metric setBestValue(Double bestValue)
bestValue
- the best value. It can be null.public boolean isNumericType()
public boolean isDataType()
public boolean isPercentageType()
public Metric setOptimizedBestValue(Boolean b)
public Boolean isOptimizedBestValue()
public Boolean getDeleteHistoricalData()
Copyright © 2009-2014 SonarSource. All Rights Reserved.