|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.sonar.api.measures.Metric<G>
public class Metric<G extends Serializable>
This class represents the definition of a metric in Sonar.
Nested Class Summary | |
---|---|
static class |
Metric.Builder
Metric.Builder is used to create metric definitions. |
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,
String description,
Metric.ValueType type,
Integer direction,
Boolean qualitative,
String domain)
Deprecated. since 2.7 use the Metric.Builder factory. |
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.
Method Detail |
---|
public Integer getId()
public Metric setId(@Nullable 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
@CheckForNull public String getDescription()
public Metric setDescription(@Nullable 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()
@CheckForNull public Double getBestValue()
public Metric setWorstValue(@Nullable Double d)
public Metric setBestValue(@Nullable Double bestValue)
bestValue
- the best value. It can be null.
public boolean isNumericType()
public boolean isDataType()
public boolean isPercentageType()
public Metric setOptimizedBestValue(@Nullable Boolean b)
@CheckForNull public Boolean isOptimizedBestValue()
public Boolean isHidden()
public Metric setHidden(Boolean hidden)
public Boolean getDeleteHistoricalData()
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)
public String key()
key
in interface Metric<G extends Serializable>
public Class<G> valueType()
valueType
in interface Metric<G extends Serializable>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |