|
||||||||||
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 java.lang.String |
alertText
|
protected java.lang.String |
data
|
protected java.util.Date |
date
|
static int |
DEFAULT_PRECISION
Default precision when saving a float type metric |
protected java.lang.String |
description
|
protected java.lang.Double |
diff1
|
protected java.lang.Double |
diff2
|
protected java.lang.Double |
diff3
|
protected static int |
MAX_TEXT_SIZE
|
protected Metric |
metric
|
protected PersistenceMode |
persistenceMode
|
protected java.lang.Integer |
tendency
|
protected java.lang.String |
url
|
protected java.lang.Double |
value
|
Constructor Summary | |
---|---|
Measure()
Creates an empty measure |
|
Measure(Metric metric)
Creates a measure with a metric |
|
Measure(Metric metric,
java.lang.Double value)
Creates a measure with a metric and a value |
|
Measure(Metric metric,
java.lang.Double value,
int precision)
Creates a measure with a metric, a value and a precision for the value |
|
Measure(Metric metric,
java.lang.Double value,
java.lang.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,
java.lang.String data)
* Creates a measure with a metric and a data field |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
|
Metric.Level |
getAlertStatus()
|
java.lang.String |
getAlertText()
|
java.lang.String |
getData()
|
Metric.Level |
getDataAsLevel()
|
java.util.Date |
getDate()
|
java.lang.String |
getDescription()
|
java.lang.Double |
getDiffValue1()
|
java.lang.Double |
getDiffValue2()
|
java.lang.Double |
getDiffValue3()
|
java.lang.Long |
getId()
|
java.lang.Integer |
getIntValue()
|
Metric |
getMetric()
|
PersistenceMode |
getPersistenceMode()
Gets the persistence mode of the measure. |
java.lang.Integer |
getTendency()
Gets the measure tendency |
java.lang.String |
getUrl()
|
java.lang.Double |
getValue()
|
int |
hashCode()
|
boolean |
hasOptionalData()
|
Measure |
setAlertStatus(Metric.Level status)
Set the alert status of the measure |
Measure |
setAlertText(java.lang.String alertText)
Sets the text associated to the alert on the measure |
Measure |
setData(Metric.Level level)
Sets an alert level as the data field |
Measure |
setData(java.lang.String s)
Sets the data field of the measure. |
Measure |
setDate(java.util.Date date)
Sets the date of the measure - Used only in TimeMachine queries |
Measure |
setDescription(java.lang.String description)
Sets the measure description |
Measure |
setDiffValue1(java.lang.Double diff1)
Sets the first differential value of the measure |
Measure |
setDiffValue2(java.lang.Double diff2)
Sets the second differential value of the measure |
Measure |
setDiffValue3(java.lang.Double diff3)
Sets the third differential value of the measure |
Measure |
setId(java.lang.Long id)
Sets the measure id - Internal use only |
Measure |
setIntValue(java.lang.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(java.lang.Integer tendency)
Sets the tendency for the measure |
Measure |
setUrl(java.lang.String url)
Sets the URL of the measure |
Measure |
setValue(java.lang.Double v)
Sets the measure value with the default precision of 1 |
Measure |
setValue(java.lang.Double v,
int precision)
Sets the measure value with a given precision |
java.lang.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 java.lang.Double value
protected java.lang.String data
protected java.lang.String description
protected Metric.Level alertStatus
protected java.lang.String alertText
protected java.lang.Integer tendency
protected java.util.Date date
protected java.lang.Double diff1
protected java.lang.Double diff2
protected java.lang.Double diff3
protected java.lang.String url
protected PersistenceMode persistenceMode
Constructor Detail |
---|
public Measure(Metric metric)
metric
- the metricpublic Measure(Metric metric, java.lang.Double value)
metric
- the metricvalue
- its valuepublic Measure(Metric metric, java.lang.Double value, int precision)
metric
- the metricvalue
- its valueprecision
- the value precisionpublic Measure(Metric metric, java.lang.Double value, java.lang.String data)
metric
- the metricvalue
- the valuedata
- the data fieldpublic Measure(Metric metric, java.lang.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 java.util.Date getDate()
public Measure setDate(java.util.Date date)
date
- the date
public java.lang.Double getValue()
public java.lang.Integer getIntValue()
public Measure setValue(java.lang.Double v)
v
- the measure value
public Measure setIntValue(java.lang.Integer i)
i
- the value
public Measure setValue(java.lang.Double v, int precision)
v
- the measure valueprecision
- the measure value precision
public java.lang.String getData()
public Measure setData(java.lang.String s)
s
- the data
public Measure setData(Metric.Level level)
level
- the alert level
public java.lang.String getDescription()
public Measure setDescription(java.lang.String description)
description
- the description
public Metric.Level getAlertStatus()
public Measure setAlertStatus(Metric.Level status)
status
- the status
public java.lang.String getAlertText()
public Measure setAlertText(java.lang.String alertText)
alertText
- the text
public java.lang.Integer getTendency()
public Measure setTendency(java.lang.Integer tendency)
tendency
- the tendency
public java.lang.Long getId()
public Measure setId(java.lang.Long id)
id
- the id
public java.lang.Double getDiffValue1()
public Measure setDiffValue1(java.lang.Double diff1)
diff1
- the diff
public java.lang.Double getDiffValue2()
public Measure setDiffValue2(java.lang.Double diff2)
diff2
- the diff
public java.lang.Double getDiffValue3()
public Measure setDiffValue3(java.lang.Double diff3)
diff3
- the diff
public java.lang.String getUrl()
public Measure setUrl(java.lang.String url)
url
- the url
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public boolean hasOptionalData()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |