|
||||||||||
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 static int |
MAX_TEXT_SIZE
|
protected Metric |
metric
|
protected String |
metricKey
|
protected PersistenceMode |
persistenceMode
|
protected Integer |
personId
|
protected Integer |
tendency
|
protected String |
url
|
protected Double |
value
|
protected Double |
variation1
|
protected Double |
variation2
|
protected Double |
variation3
|
protected Double |
variation4
|
protected Double |
variation5
|
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 |
|
Measure(String metricKey)
|
Method Summary | |
---|---|
boolean |
equals(Object o)
|
Metric.Level |
getAlertStatus()
|
String |
getAlertText()
|
Characteristic |
getCharacteristic()
|
String |
getData()
|
Metric.Level |
getDataAsLevel()
|
Date |
getDate()
|
String |
getDescription()
|
Long |
getId()
|
Integer |
getIntValue()
|
Metric |
getMetric()
|
String |
getMetricKey()
|
PersistenceMode |
getPersistenceMode()
Gets the persistence mode of the measure. |
Integer |
getPersonId()
|
Integer |
getTendency()
Gets the measure tendency |
String |
getUrl()
|
Double |
getValue()
|
Double |
getVariation(int index)
|
Double |
getVariation1()
|
Double |
getVariation2()
|
Double |
getVariation3()
|
Double |
getVariation4()
|
Double |
getVariation5()
|
boolean |
hasData()
|
int |
hashCode()
|
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 |
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 |
setPersonId(Integer i)
|
Measure |
setTendency(Integer tendency)
Sets the tendency for the measure - Internal use only |
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 |
Measure |
setVariation(int index,
Double d)
Internal use only |
Measure |
setVariation1(Double d)
Internal use only |
Measure |
setVariation2(Double d)
Internal use only |
Measure |
setVariation3(Double d)
Internal use only |
Measure |
setVariation4(Double d)
Internal use only |
Measure |
setVariation5(Double d)
Internal use only |
String |
toString()
|
Measure |
unsetData()
|
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 String metricKey
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 variation1
protected Double variation2
protected Double variation3
protected Double variation4
protected Double variation5
protected String url
protected Characteristic characteristic
protected Integer personId
protected PersistenceMode persistenceMode
Constructor Detail |
---|
public Measure(String metricKey)
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 String getMetricKey()
public Measure setMetric(Metric metric)
metric
- the metric
public Metric.Level getDataAsLevel()
public boolean hasData()
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 Measure unsetData()
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 getVariation1()
public Measure setVariation1(Double d)
public Double getVariation2()
public Measure setVariation2(Double d)
public Double getVariation3()
public Measure setVariation3(Double d)
public Double getVariation4()
public Measure setVariation4(Double d)
public Double getVariation5()
public Measure setVariation5(Double d)
public Double getVariation(int index)
public Measure setVariation(int index, Double d)
public String getUrl()
public Measure setUrl(String url)
url
- the url
public final Characteristic getCharacteristic()
public final Measure setCharacteristic(Characteristic characteristic)
@Beta public Integer getPersonId()
@Beta public Measure setPersonId(Integer i)
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |