SensorContext.newMeasure()@Deprecated public class Measure<G extends Serializable> extends Object implements Serializable
| Modifier and Type | Field and Description | 
|---|---|
| protected Metric.Level | alertStatusDeprecated.  | 
| protected String | alertTextDeprecated.  | 
| protected String | dataDeprecated.  | 
| protected Date | dateDeprecated.  | 
| static int | DEFAULT_PRECISIONDeprecated. 
 in 5.3. Decimal scale is provided by metric, not by measure. | 
| protected String | descriptionDeprecated.  | 
| protected static int | MAX_TEXT_SIZEDeprecated.  | 
| protected Metric<G> | metricDeprecated.  | 
| protected String | metricKeyDeprecated.  | 
| protected PersistenceMode | persistenceModeDeprecated.  | 
| protected Integer | personIdDeprecated.  | 
| protected String | urlDeprecated.  | 
| protected Double | valueDeprecated.  | 
| protected Double | variation1Deprecated.  | 
| protected Double | variation2Deprecated.  | 
| protected Double | variation3Deprecated.  | 
| protected Double | variation4Deprecated.  | 
| protected Double | variation5Deprecated.  | 
| Constructor and Description | 
|---|
| Measure()Deprecated.  Creates an empty measure | 
| Measure(Metric metric)Deprecated.  Creates a measure with a metric | 
| Measure(Metric metric,
       Double value)Deprecated.  Creates a measure with a metric and a value | 
| Measure(Metric metric,
       Double value,
       int precision)Deprecated.  Creates a measure with a metric, a value and a precision for the value | 
| Measure(Metric metric,
       Double value,
       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,
       String data)Deprecated.  * Creates a measure with a metric and a data field | 
| Measure(String metricKey)Deprecated.  | 
| Modifier and Type | Method and Description | 
|---|---|
| boolean | equals(Object o)Deprecated.  | 
| Metric.Level | getAlertStatus()Deprecated.  | 
| String | getAlertText()Deprecated.  | 
| String | getData()Deprecated.  | 
| Metric.Level | getDataAsLevel()Deprecated.  | 
| Date | getDate()Deprecated.  | 
| String | getDescription()Deprecated.  | 
| Integer | getIntValue()Deprecated.  | 
| Metric<G> | getMetric()Deprecated.  | 
| String | getMetricKey()Deprecated.  | 
| PersistenceMode | getPersistenceMode()Deprecated.  Gets the persistence mode of the measure. | 
| Integer | getPersonId()Deprecated.  | 
| Integer | getTendency()Deprecated. 
 since 5.2. See https://jira.sonarsource.com/browse/SONAR-6392 | 
| String | getUrl()Deprecated.  | 
| Double | getValue()Deprecated.  | 
| Double | getVariation(int index)Deprecated.  | 
| Double | getVariation1()Deprecated.  | 
| Double | getVariation2()Deprecated.  | 
| Double | getVariation3()Deprecated.  | 
| Double | getVariation4()Deprecated.  | 
| Double | getVariation5()Deprecated.  | 
| boolean | hasData()Deprecated.  | 
| int | hashCode()Deprecated.  | 
| boolean | isBestValue()Deprecated.  | 
| boolean | isFromCore()Deprecated.  For internal use | 
| Measure<G> | setAlertStatus(Metric.Level status)Deprecated.  Set the alert status of the measure | 
| Measure<G> | setAlertText(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(String s)Deprecated.  Sets the data field of the measure. | 
| Measure<G> | setDate(Date date)Deprecated.  Sets the date of the measure - Used only in TimeMachine queries | 
| Measure<G> | setDescription(String description)Deprecated.  Sets the measure description | 
| void | setFromCore(boolean fromCore)Deprecated.  For internal use | 
| Measure<G> | setIntValue(Integer i)Deprecated.  Sets the measure value as an int | 
| Measure<G> | setMetric(Metric<G> metric)Deprecated.  Set the underlying metric | 
| Measure<G> | setPersistenceMode(PersistenceMode mode)Deprecated.  
 Sets the persistence mode of a measure. | 
| Measure<G> | setPersonId(Integer i)Deprecated.  | 
| Measure<G> | setRawValue(Double v)Deprecated.  For internal use | 
| Measure<G> | setTendency(Integer tendency)Deprecated. 
 since 5.2. See https://jira.sonarsource.com/browse/SONAR-6392 | 
| Measure<G> | setUrl(String url)Deprecated.  Sets the URL of the measure | 
| Measure<G> | setValue(Double v)Deprecated.  Sets the measure value with the default precision of 1 | 
| Measure<G> | setValue(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,
            Double d)Deprecated.  Internal use only | 
| Measure<G> | setVariation1(Double d)Deprecated.  Internal use only | 
| Measure<G> | setVariation2(Double d)Deprecated.  Internal use only | 
| Measure<G> | setVariation3(Double d)Deprecated.  Internal use only | 
| Measure<G> | setVariation4(Double d)Deprecated.  Internal use only | 
| Measure<G> | setVariation5(Double d)Deprecated.  Internal use only | 
| 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 Metric<G extends Serializable> metric
protected String description
protected Metric.Level alertStatus
protected Double variation1
protected Double variation2
protected Double variation3
protected Double variation4
protected Double variation5
protected PersistenceMode persistenceMode
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()
public PersistenceMode getPersistenceMode()
public Measure<G> setPersistenceMode(@Nullable 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 modepublic String getMetricKey()
public Measure<G> setMetric(Metric<G> metric)
metric - the metricpublic Metric.Level getDataAsLevel()
public boolean hasData()
public Date getDate()
public Measure<G> setDate(Date date)
date - the date@CheckForNull public Double getValue()
public Integer getIntValue()
public Measure<G> setValue(@Nullable Double v)
v - the measure valuepublic Measure<G> setRawValue(@Nullable Double v)
public Measure<G> setIntValue(Integer i)
i - the value@Deprecated public Measure<G> setValue(@Nullable Double v, int decimalScale)
this@CheckForNull public String getData()
public Measure<G> setData(String s)
s - the datapublic Measure<G> setData(Metric.Level level)
level - the alert levelpublic String getDescription()
public Measure<G> setDescription(String description)
description - the descriptionpublic Metric.Level getAlertStatus()
public Measure<G> setAlertStatus(@Nullable Metric.Level status)
status - the statuspublic String getAlertText()
public Measure<G> setAlertText(@Nullable String alertText)
alertText - the text@Deprecated @CheckForNull public Integer getTendency()
null since version 5.2@Deprecated public Measure<G> setTendency(@Nullable Integer tendency)
public Double getVariation1()
public Measure<G> setVariation1(@Nullable Double d)
public Double getVariation2()
public Measure<G> setVariation2(@Nullable Double d)
public Double getVariation3()
public Measure<G> setVariation3(@Nullable Double d)
public Double getVariation4()
public Measure<G> setVariation4(@Nullable Double d)
public Double getVariation5()
public Measure<G> setVariation5(@Nullable Double d)
public Double getVariation(int index)
public Measure<G> setVariation(int index, Double d)
public Measure<G> setUrl(String url)
url - the url@CheckForNull @Beta public Integer getPersonId()
@Beta public Measure<G> setPersonId(@Nullable Integer i)
public boolean isBestValue()
public boolean isFromCore()
public void setFromCore(boolean fromCore)
Copyright © 2009–2016 SonarSource. All rights reserved.