|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.sonar.api.measures.Measure
public class Measure
A class to handle measures.
Field Summary | |
---|---|
protected Metric.Level |
alertStatus
|
protected String |
alertText
|
protected Characteristic |
characteristic
|
protected String |
data
|
protected Date |
date
|
static int |
DEFAULT_PRECISION
Default precision when saving a float type metric |
protected String |
description
|
protected Double |
diff1
|
protected Double |
diff2
|
protected Double |
diff3
|
protected static int |
MAX_TEXT_SIZE
|
protected Metric |
metric
|
protected PersistenceMode |
persistenceMode
|
protected Integer |
tendency
|
protected String |
url
|
protected Double |
value
|
Constructor Summary | |
---|---|
Measure()
Creates an empty measure |
|
Measure(Metric metric)
Creates a measure with a metric |
|
Measure(Metric metric,
Double value)
Creates a measure with a metric and a value |
|
Measure(Metric metric,
Double value,
int precision)
Creates a measure with a metric, a value and a precision for the value |
|
Measure(Metric metric,
Double value,
String data)
Creates a measure with a metric, a value and a data field |
|
Measure(Metric metric,
Metric.Level level)
Creates a measure with a metric and an alert level |
|
Measure(Metric metric,
String data)
* Creates a measure with a metric and a data field |
Method Summary | |
---|---|
boolean |
equals(Object o)
|
Metric.Level |
getAlertStatus()
|
String |
getAlertText()
|
Characteristic |
getCharacteristic()
|
String |
getData()
|
Metric.Level |
getDataAsLevel()
|
Date |
getDate()
|
String |
getDescription()
|
Double |
getDiffValue1()
|
Double |
getDiffValue2()
|
Double |
getDiffValue3()
|
Long |
getId()
|
Integer |
getIntValue()
|
Metric |
getMetric()
|
PersistenceMode |
getPersistenceMode()
Gets the persistence mode of the measure. |
Integer |
getTendency()
Gets the measure tendency |
String |
getUrl()
|
Double |
getValue()
|
int |
hashCode()
|
boolean |
hasOptionalData()
|
Measure |
setAlertStatus(Metric.Level status)
Set the alert status of the measure |
Measure |
setAlertText(String alertText)
Sets the text associated to the alert on the measure |
Measure |
setCharacteristic(Characteristic characteristic)
|
Measure |
setData(Metric.Level level)
Sets an alert level as the data field |
Measure |
setData(String s)
Sets the data field of the measure. |
Measure |
setDate(Date date)
Sets the date of the measure - Used only in TimeMachine queries |
Measure |
setDescription(String description)
Sets the measure description |
Measure |
setDiffValue1(Double diff1)
Sets the first differential value of the measure |
Measure |
setDiffValue2(Double diff2)
Sets the second differential value of the measure |
Measure |
setDiffValue3(Double diff3)
Sets the third differential value of the measure |
Measure |
setId(Long id)
Sets the measure id - Internal use only |
Measure |
setIntValue(Integer i)
Sets the measure value as an int |
Measure |
setMetric(Metric metric)
Set the underlying metric |
Measure |
setPersistenceMode(PersistenceMode mode)
Sets the persistence mode of a measure. |
Measure |
setTendency(Integer tendency)
Sets the tendency for the measure |
Measure |
setUrl(String url)
Sets the URL of the measure |
Measure |
setValue(Double v)
Sets the measure value with the default precision of 1 |
Measure |
setValue(Double v,
int precision)
Sets the measure value with a given precision |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final int MAX_TEXT_SIZE
public static final int DEFAULT_PRECISION
protected Metric metric
protected Double value
protected String data
protected String description
protected Metric.Level alertStatus
protected String alertText
protected Integer tendency
protected Date date
protected Double diff1
protected Double diff2
protected Double diff3
protected String url
protected Characteristic characteristic
protected PersistenceMode persistenceMode
Constructor Detail |
---|
public Measure(Metric metric)
metric
- the metricpublic Measure(Metric metric, Double value)
metric
- the metricvalue
- its valuepublic Measure(Metric metric, Double value, int precision)
metric
- the metricvalue
- its valueprecision
- the value precisionpublic Measure(Metric metric, Double value, String data)
metric
- the metricvalue
- the valuedata
- the data fieldpublic Measure(Metric metric, String data)
metric
- the metricdata
- the data fieldpublic Measure(Metric metric, Metric.Level level)
metric
- the metriclevel
- the alert levelpublic Measure()
Method Detail |
---|
public PersistenceMode getPersistenceMode()
public Measure setPersistenceMode(PersistenceMode mode)
Sets the persistence mode of a measure.
WARNING : Being able to reuse measures saved in memory is only possible within the same tree. In a multi-module project for example, a measure save in memory at the module level will not be accessible by the root project. In that case, database should be used.
mode
- the mode
public Metric getMetric()
public Measure setMetric(Metric metric)
metric
- the metric
public Metric.Level getDataAsLevel()
public Date getDate()
public Measure setDate(Date date)
date
- the date
public Double getValue()
public Integer getIntValue()
public Measure setValue(Double v)
v
- the measure value
public Measure setIntValue(Integer i)
i
- the value
public Measure setValue(Double v, int precision)
v
- the measure valueprecision
- the measure value precision
public String getData()
public Measure setData(String s)
s
- the data
public Measure setData(Metric.Level level)
level
- the alert level
public String getDescription()
public Measure setDescription(String description)
description
- the description
public Metric.Level getAlertStatus()
public Measure setAlertStatus(Metric.Level status)
status
- the status
public String getAlertText()
public Measure setAlertText(String alertText)
alertText
- the text
public Integer getTendency()
public Measure setTendency(Integer tendency)
tendency
- the tendency
public Long getId()
public Measure setId(Long id)
id
- the id
public Double getDiffValue1()
public Measure setDiffValue1(Double diff1)
diff1
- the diff
public Double getDiffValue2()
public Measure setDiffValue2(Double diff2)
diff2
- the diff
public Double getDiffValue3()
public Measure setDiffValue3(Double diff3)
diff3
- the diff
public String getUrl()
public Measure setUrl(String url)
url
- the url
public final Characteristic getCharacteristic()
public final Measure setCharacteristic(Characteristic characteristic)
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
public boolean hasOptionalData()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |