SensorContext.newMeasure()
@Deprecated
public class Measure<G extends java.io.Serializable>
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
protected Metric.Level |
alertStatus
Deprecated.
|
protected java.lang.String |
alertText
Deprecated.
|
protected java.lang.String |
data
Deprecated.
|
protected java.util.Date |
date
Deprecated.
|
static int |
DEFAULT_PRECISION
Deprecated.
in 5.3. Decimal scale is provided by metric, not by measure.
|
protected java.lang.String |
description
Deprecated.
|
protected static int |
MAX_TEXT_SIZE
Deprecated.
|
protected Metric<G> |
metric
Deprecated.
|
protected java.lang.String |
metricKey
Deprecated.
|
protected java.lang.String |
url
Deprecated.
|
protected java.lang.Double |
value
Deprecated.
|
protected java.lang.Double |
variation1
Deprecated.
|
protected java.lang.Double |
variation2
Deprecated.
|
protected java.lang.Double |
variation3
Deprecated.
|
protected java.lang.Double |
variation4
Deprecated.
|
protected java.lang.Double |
variation5
Deprecated.
|
Constructor and Description |
---|
Measure()
Deprecated.
Creates an empty measure
|
Measure(Metric metric)
Deprecated.
Creates a measure with a metric
|
Measure(Metric metric,
java.lang.Double value)
Deprecated.
Creates a measure with a metric and a value
|
Measure(Metric metric,
java.lang.Double value,
int precision)
Deprecated.
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)
Deprecated.
Creates a measure with a metric, a value and a data field
|
Measure(Metric metric,
Metric.Level level)
Deprecated.
Creates a measure with a metric and an alert level
|
Measure(Metric metric,
java.lang.String data)
Deprecated.
* Creates a measure with a metric and a data field
|
Measure(java.lang.String metricKey)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o)
Deprecated.
|
Metric.Level |
getAlertStatus()
Deprecated.
|
java.lang.String |
getAlertText()
Deprecated.
|
java.lang.String |
getData()
Deprecated.
|
Metric.Level |
getDataAsLevel()
Deprecated.
|
java.util.Date |
getDate()
Deprecated.
|
java.lang.String |
getDescription()
Deprecated.
|
java.lang.Integer |
getIntValue()
Deprecated.
|
Metric<G> |
getMetric()
Deprecated.
|
java.lang.String |
getMetricKey()
Deprecated.
|
java.lang.Integer |
getPersonId()
Deprecated.
in 6.5 with end of support of Developer cockpit plugin. Always return
null . |
java.lang.Integer |
getTendency()
Deprecated.
since 5.2. See https://jira.sonarsource.com/browse/SONAR-6392
|
java.lang.String |
getUrl()
Deprecated.
|
java.lang.Double |
getValue()
Deprecated.
|
java.lang.Double |
getVariation(int index)
Deprecated.
|
java.lang.Double |
getVariation1()
Deprecated.
|
java.lang.Double |
getVariation2()
Deprecated.
|
java.lang.Double |
getVariation3()
Deprecated.
|
java.lang.Double |
getVariation4()
Deprecated.
|
java.lang.Double |
getVariation5()
Deprecated.
|
boolean |
hasData()
Deprecated.
|
int |
hashCode()
Deprecated.
|
boolean |
isBestValue()
Deprecated.
|
Measure<G> |
setAlertStatus(Metric.Level status)
Deprecated.
Set the alert status of the measure
|
Measure<G> |
setAlertText(java.lang.String alertText)
Deprecated.
Sets the text associated to the alert on the measure
|
Measure<G> |
setData(Metric.Level level)
Deprecated.
Sets an alert level as the data field
|
Measure<G> |
setData(java.lang.String s)
Deprecated.
Sets the data field of the measure.
|
Measure<G> |
setDate(java.util.Date date)
Deprecated.
Sets the date of the measure - Used only in TimeMachine queries
|
Measure<G> |
setDescription(java.lang.String description)
Deprecated.
Sets the measure description
|
Measure<G> |
setIntValue(java.lang.Integer i)
Deprecated.
Sets the measure value as an int
|
Measure<G> |
setMetric(Metric<G> metric)
Deprecated.
Set the underlying metric
|
Measure<G> |
setPersonId(java.lang.Integer i)
Deprecated.
in 6.5 with end of support of Developer cockpit plugin.
|
Measure<G> |
setRawValue(java.lang.Double v)
Deprecated.
For internal use
|
Measure<G> |
setTendency(java.lang.Integer tendency)
Deprecated.
since 5.2. See https://jira.sonarsource.com/browse/SONAR-6392
|
Measure<G> |
setUrl(java.lang.String url)
Deprecated.
Sets the URL of the measure
|
Measure<G> |
setValue(java.lang.Double v)
Deprecated.
Sets the measure value with the default precision of 1
|
Measure<G> |
setValue(java.lang.Double v,
int decimalScale)
Deprecated.
in 5.3. The decimal scale is given by the metric, not by the measure. Anyway this parameter was enforced to 1 before version 5.3.
|
Measure<G> |
setVariation(int index,
java.lang.Double d)
Deprecated.
Internal use only
|
Measure<G> |
setVariation1(java.lang.Double d)
Deprecated.
Internal use only
|
Measure<G> |
setVariation2(java.lang.Double d)
Deprecated.
Internal use only
|
Measure<G> |
setVariation3(java.lang.Double d)
Deprecated.
Internal use only
|
Measure<G> |
setVariation4(java.lang.Double d)
Deprecated.
Internal use only
|
Measure<G> |
setVariation5(java.lang.Double d)
Deprecated.
Internal use only
|
java.lang.String |
toString()
Deprecated.
|
Measure<G> |
unsetData()
Deprecated.
|
G |
value()
Deprecated.
For internal use.
|
protected static final int MAX_TEXT_SIZE
@Deprecated public static final int DEFAULT_PRECISION
protected java.lang.String metricKey
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.util.Date date
protected java.lang.Double variation1
protected java.lang.Double variation2
protected java.lang.Double variation3
protected java.lang.Double variation4
protected java.lang.Double variation5
protected java.lang.String url
public Measure(java.lang.String metricKey)
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, @Nullable Metric.Level level)
metric
- the metriclevel
- the alert levelpublic Measure()
public java.lang.String getMetricKey()
public Measure<G> setMetric(Metric<G> metric)
metric
- the metricpublic Metric.Level getDataAsLevel()
public boolean hasData()
public java.util.Date getDate()
public Measure<G> setDate(java.util.Date date)
date
- the date@CheckForNull public java.lang.Double getValue()
public G value()
public java.lang.Integer getIntValue()
public Measure<G> setValue(@Nullable java.lang.Double v)
v
- the measure valuepublic Measure<G> setRawValue(@Nullable java.lang.Double v)
public Measure<G> setIntValue(@Nullable java.lang.Integer i)
i
- the value@Deprecated public Measure<G> setValue(@Nullable java.lang.Double v, int decimalScale)
this
@CheckForNull public java.lang.String getData()
public Measure<G> setData(java.lang.String s)
s
- the datapublic Measure<G> setData(@Nullable Metric.Level level)
level
- the alert levelpublic java.lang.String getDescription()
public Measure<G> setDescription(java.lang.String description)
description
- the descriptionpublic Metric.Level getAlertStatus()
public Measure<G> setAlertStatus(@Nullable Metric.Level status)
status
- the statuspublic java.lang.String getAlertText()
public Measure<G> setAlertText(@Nullable java.lang.String alertText)
alertText
- the text@Deprecated @CheckForNull public java.lang.Integer getTendency()
null
since version 5.2@Deprecated public Measure<G> setTendency(@Nullable java.lang.Integer tendency)
public java.lang.Double getVariation1()
public Measure<G> setVariation1(@Nullable java.lang.Double d)
public java.lang.Double getVariation2()
public Measure<G> setVariation2(@Nullable java.lang.Double d)
public java.lang.Double getVariation3()
public Measure<G> setVariation3(@Nullable java.lang.Double d)
public java.lang.Double getVariation4()
public Measure<G> setVariation4(@Nullable java.lang.Double d)
public java.lang.Double getVariation5()
public Measure<G> setVariation5(@Nullable java.lang.Double d)
public java.lang.Double getVariation(int index)
public Measure<G> setVariation(int index, java.lang.Double d)
public java.lang.String getUrl()
public Measure<G> setUrl(java.lang.String url)
url
- the url@CheckForNull @Deprecated public java.lang.Integer getPersonId()
null
.@Deprecated public Measure<G> setPersonId(@Nullable java.lang.Integer i)
public boolean isBestValue()
public boolean equals(java.lang.Object o)
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