|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.sonar.api.measures.Metric
public class Metric
Nested Class Summary | |
---|---|
static class |
Metric.Builder
|
static class |
Metric.Level
|
static class |
Metric.Origin
|
static class |
Metric.ValueType
|
Field Summary | |
---|---|
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 Summary | |
---|---|
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. |
Method Summary | |
---|---|
boolean |
equals(Object obj)
|
Double |
getBestValue()
|
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()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int DIRECTION_WORST
public static final int DIRECTION_BETTER
public static final int DIRECTION_NONE
Constructor Detail |
---|
@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, 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 formulaMethod Detail |
---|
public Integer getId()
public Metric setId(Integer id)
public Formula getFormula()
public Metric setFormula(Formula formula)
formula
- the formula
public Boolean getQualitative()
public Metric setQualitative(Boolean qualitative)
qualitative
- whether the metric is qualitative
public String getKey()
public Metric setKey(String key)
key
- the key
public Metric.ValueType getType()
public Metric setType(Metric.ValueType type)
type
- the type
public String getDescription()
public Metric setDescription(String description)
description
- the description
public Boolean getUserManaged()
public Metric setUserManaged(Boolean userManaged)
userManaged
- whether the metric is user managed
public Boolean getEnabled()
public Metric setEnabled(Boolean enabled)
enabled
- whether the metric is enabled
public Integer getDirection()
public Metric setDirection(Integer direction)
direction
- the directionpublic String getDomain()
public Metric setDomain(String domain)
domain
- the domain
public String getName()
public Metric setName(String name)
name
- the name
public Metric.Origin getOrigin()
public Metric setOrigin(Metric.Origin origin)
origin
- the origin
public 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 isHidden()
public Metric setHidden(Boolean hidden)
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public String toString()
toString
in class Object
public Metric merge(Metric with)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |