|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.sonar.api.database.BaseIdentifiable org.sonar.api.measures.Metric
public class Metric
Nested Class Summary | |
---|---|
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. |
|
Metric(java.lang.String key)
Creates a metric based on its key. |
|
Metric(java.lang.String key,
Metric.ValueType type)
Creates a metric based on a key and a type. |
|
Metric(java.lang.String key,
java.lang.String name,
Metric.ValueType type,
java.lang.Integer direction,
java.lang.Boolean qualitative,
java.lang.String domain,
Formula formula)
Creates a fully qualified metric. |
|
Metric(java.lang.String key,
java.lang.String name,
java.lang.String description,
Metric.ValueType type,
java.lang.Integer direction,
java.lang.Boolean qualitative,
java.lang.String domain)
|
|
Metric(java.lang.String key,
java.lang.String name,
java.lang.String description,
Metric.ValueType type,
java.lang.Integer direction,
java.lang.Boolean qualitative,
java.lang.String domain,
boolean userManaged)
Deprecated. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
|
java.lang.Double |
getBestValue()
|
java.lang.String |
getDescription()
|
java.lang.Integer |
getDirection()
|
java.lang.String |
getDomain()
|
java.lang.Boolean |
getEnabled()
|
Formula |
getFormula()
|
java.lang.String |
getKey()
|
java.lang.String |
getName()
|
Metric.Origin |
getOrigin()
|
java.lang.Boolean |
getQualitative()
|
Metric.ValueType |
getType()
|
java.lang.Boolean |
getUserManaged()
|
java.lang.Double |
getWorstValue()
|
int |
hashCode()
|
boolean |
isDataType()
|
java.lang.Boolean |
isHidden()
|
boolean |
isNumericType()
|
java.lang.Boolean |
isOptimizedBestValue()
|
boolean |
isPercentageType()
|
Metric |
merge(Metric with)
Merge with fields from other metric. |
Metric |
setBestValue(java.lang.Double bestValue)
|
Metric |
setDescription(java.lang.String description)
Sets the metric description |
Metric |
setDirection(java.lang.Integer direction)
Sets the metric direction. |
Metric |
setDomain(java.lang.String domain)
Sets the domain for the metric (General, Complexity...) |
Metric |
setEnabled(java.lang.Boolean enabled)
Sets whether the metric is enabled |
Metric |
setFormula(Formula formula)
Sets the metric formula |
Metric |
setHidden(java.lang.Boolean hidden)
|
Metric |
setKey(java.lang.String key)
Sets the metric key |
Metric |
setName(java.lang.String name)
Sets the metric name |
Metric |
setOptimizedBestValue(java.lang.Boolean b)
|
Metric |
setOrigin(Metric.Origin origin)
Set the origin of the metric - Internal use only |
Metric |
setQualitative(java.lang.Boolean qualitative)
Sets whether the metric is qualitative |
Metric |
setType(Metric.ValueType type)
Sets the metric type |
Metric |
setUserManaged(java.lang.Boolean userManaged)
Sets whether the metric is user managed |
Metric |
setWorstValue(java.lang.Double d)
|
java.lang.String |
toString()
|
Methods inherited from class org.sonar.api.database.BaseIdentifiable |
---|
getId, setId |
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()
public Metric(java.lang.String key)
key
- the metric keypublic Metric(java.lang.String key, Metric.ValueType type)
key
- the keytype
- the typepublic Metric(java.lang.String key, java.lang.String name, java.lang.String description, Metric.ValueType type, java.lang.Integer direction, java.lang.Boolean qualitative, java.lang.String domain)
@Deprecated public Metric(java.lang.String key, java.lang.String name, java.lang.String description, Metric.ValueType type, java.lang.Integer direction, java.lang.Boolean qualitative, java.lang.String domain, boolean userManaged)
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 managedpublic Metric(java.lang.String key, java.lang.String name, Metric.ValueType type, java.lang.Integer direction, java.lang.Boolean qualitative, java.lang.String domain, Formula formula)
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 Formula getFormula()
public Metric setFormula(Formula formula)
formula
- the formula
public java.lang.Boolean getQualitative()
public Metric setQualitative(java.lang.Boolean qualitative)
qualitative
- whether the metric is qualitative
public java.lang.String getKey()
public Metric setKey(java.lang.String key)
key
- the key
public Metric.ValueType getType()
public Metric setType(Metric.ValueType type)
type
- the type
public java.lang.String getDescription()
public Metric setDescription(java.lang.String description)
description
- the description
public java.lang.Boolean getUserManaged()
public Metric setUserManaged(java.lang.Boolean userManaged)
userManaged
- whether the metric is user managed
public java.lang.Boolean getEnabled()
public Metric setEnabled(java.lang.Boolean enabled)
enabled
- whether the metric is enabled
public java.lang.Integer getDirection()
public Metric setDirection(java.lang.Integer direction)
direction
- the directionpublic java.lang.String getDomain()
public Metric setDomain(java.lang.String domain)
domain
- the domain
public java.lang.String getName()
public Metric setName(java.lang.String name)
name
- the name
public Metric.Origin getOrigin()
public Metric setOrigin(Metric.Origin origin)
origin
- the origin
public java.lang.Double getWorstValue()
public java.lang.Double getBestValue()
public Metric setWorstValue(java.lang.Double d)
public Metric setBestValue(java.lang.Double bestValue)
bestValue
- the best value. It can be null.
public boolean isNumericType()
public boolean isDataType()
public boolean isPercentageType()
public Metric setOptimizedBestValue(java.lang.Boolean b)
public java.lang.Boolean isOptimizedBestValue()
public java.lang.Boolean isHidden()
public Metric setHidden(java.lang.Boolean hidden)
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public Metric merge(Metric with)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |