|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.sonar.api.database.model.MeasureModel
public class MeasureModel
This class is the Hibernate model to store a measure in the DB
Field Summary | |
---|---|
static int |
TEXT_VALUE_LENGTH
|
Constructor Summary | |
---|---|
MeasureModel()
Creates an empty measure |
|
MeasureModel(Metric metric,
Double val)
Creates a measure based on a metric and a double value |
|
MeasureModel(Metric metric,
Metric.Level level)
Creates a measure based on a metric and an alert level |
|
MeasureModel(Metric metric,
String val)
Creates a measure based on a metric and a string value |
Method Summary | |
---|---|
static MeasureModel |
build(Measure measure)
Builds a MeasureModel from a Measure |
static MeasureModel |
build(Measure measure,
MeasureModel merge)
Merges a Measure into a MeasureModel |
Object |
clone()
|
Metric.Level |
getAlertStatus()
|
String |
getAlertText()
|
Characteristic |
getCharacteristic()
|
String |
getData()
|
String |
getDescription()
|
Double |
getDiffValue1()
|
Double |
getDiffValue2()
|
Double |
getDiffValue3()
|
Long |
getId()
|
Metric.Level |
getLevelValue()
|
MeasureData |
getMeasureData()
Use getData() instead |
Date |
getMeasureDate()
|
Metric |
getMetric()
|
Integer |
getProjectId()
|
Rule |
getRule()
|
Integer |
getRuleId()
|
RulePriority |
getRulePriority()
|
Integer |
getRulesCategoryId()
|
Integer |
getSnapshotId()
|
Integer |
getTendency()
|
String |
getTextValue()
Use getData() instead |
String |
getUrl()
|
Double |
getValue()
|
boolean |
hasOptionalData()
True if other fields than 'value' are set. |
boolean |
isRuleMeasure()
|
MeasureModel |
save(DatabaseSession session)
Saves the current object to database |
MeasureModel |
setAlertStatus(Metric.Level level)
Sets the measure alert status |
void |
setAlertText(String alertText)
Sets the text for the alert |
MeasureModel |
setCharacteristic(Characteristic c)
|
void |
setData(String data)
Sets the measure data |
void |
setDescription(String description)
Sets the measure description |
void |
setDiffValue1(Double diffValue1)
Sets the diffValue1 |
void |
setDiffValue2(Double diffValue2)
Sets the diffValue2 |
void |
setDiffValue3(Double diffValue3)
Sets the diffValue3 |
void |
setId(Long id)
|
void |
setMeasureData(MeasureData data)
Use setData() instead |
MeasureModel |
setMeasureDate(Date measureDate)
Sets the date for the measure |
void |
setMetric(Metric metric)
Sets the measure metric |
void |
setProjectId(Integer projectId)
Sets the project id |
MeasureModel |
setRule(Rule rule)
Sets the rule for the measure |
void |
setRulePriority(RulePriority rulePriority)
Sets the rule priority |
MeasureModel |
setRulesCategoryId(Integer id)
Sets the rule category id |
MeasureModel |
setSnapshotId(Integer snapshotId)
Sets the snapshot id |
MeasureModel |
setTendency(Integer tendency)
Sets the measure tendency |
void |
setTextValue(String textValue)
Use setData() instead |
void |
setUrl(String url)
Sets the measure URL |
MeasureModel |
setValue(Double value)
Sets the measure value |
Measure |
toMeasure()
|
static List<Measure> |
toMeasures(List<MeasureModel> models)
Transforms a list of MeasureModel into a list of Measure |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int TEXT_VALUE_LENGTH
Constructor Detail |
---|
public MeasureModel(Metric metric, Double val)
public MeasureModel(Metric metric, Metric.Level level)
public MeasureModel(Metric metric, String val)
public MeasureModel()
Method Detail |
---|
public Long getId()
public void setId(Long id)
public Double getValue()
public String getDescription()
public void setDescription(String description)
public MeasureModel setValue(Double value) throws IllegalArgumentException
IllegalArgumentException
- in case value is not a valid doublepublic Metric.Level getLevelValue()
public String getTextValue()
public void setTextValue(String textValue)
public Integer getTendency()
public boolean isRuleMeasure()
public MeasureModel setTendency(Integer tendency)
public Metric getMetric()
public void setMetric(Metric metric)
public Integer getSnapshotId()
public MeasureModel setSnapshotId(Integer snapshotId)
public Rule getRule()
public MeasureModel setRule(Rule rule)
public Integer getRulesCategoryId()
public MeasureModel setRulesCategoryId(Integer id)
public RulePriority getRulePriority()
public void setRulePriority(RulePriority rulePriority)
public Integer getProjectId()
public void setProjectId(Integer projectId)
public Date getMeasureDate()
public MeasureModel setMeasureDate(Date measureDate)
public Metric.Level getAlertStatus()
public MeasureModel setAlertStatus(Metric.Level level)
public String getData()
public final void setData(String data)
public MeasureData getMeasureData()
public void setMeasureData(MeasureData data)
public String getAlertText()
public void setAlertText(String alertText)
public String getUrl()
public void setUrl(String url)
public String toString()
toString
in class Object
public Integer getRuleId()
public Double getDiffValue1()
public void setDiffValue1(Double diffValue1)
public Double getDiffValue2()
public void setDiffValue2(Double diffValue2)
public Double getDiffValue3()
public void setDiffValue3(Double diffValue3)
public MeasureModel save(DatabaseSession session)
public Characteristic getCharacteristic()
public MeasureModel setCharacteristic(Characteristic c)
public Object clone()
clone
in class Object
public boolean hasOptionalData()
public static MeasureModel build(Measure measure)
public static MeasureModel build(Measure measure, MeasureModel merge)
public Measure toMeasure()
public static List<Measure> toMeasures(List<MeasureModel> models)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |