public class Alert extends BaseIdentifiable implements Cloneable
Modifier and Type | Field and Description |
---|---|
static String |
OPERATOR_EQUALS
Operator equals
|
static String |
OPERATOR_GREATER
Operator strictly greater than
|
static String |
OPERATOR_NOT_EQUALS
Operator not equals
|
static String |
OPERATOR_SMALLER
Operator strictly lesser than
|
Constructor and Description |
---|
Alert()
Default constructor
|
Alert(RulesProfile rulesProfile,
Metric metric,
String operator,
String valueError,
String valueWarning)
Creates an alert
|
Modifier and Type | Method and Description |
---|---|
Object |
clone() |
String |
getAlertLabel(Metric.Level level) |
Metric |
getMetric() |
String |
getOperator() |
RulesProfile |
getRulesProfile() |
String |
getValueError() |
String |
getValueWarning() |
boolean |
isEqualsOperator() |
boolean |
isGreaterOperator() |
boolean |
isNotEqualsOperator() |
boolean |
isSmallerOperator() |
void |
setMetric(Metric metric)
Sets the alert metric
|
void |
setOperator(String operator)
Sets the alert operator
|
void |
setRulesProfile(RulesProfile rulesProfile)
Sets the alert profile
|
void |
setValueError(String valueError)
Sets the error value if any
|
void |
setValueWarning(String valueWarning)
Sets the warning value if any
|
getId, setId
public static final String OPERATOR_GREATER
public static final String OPERATOR_SMALLER
public static final String OPERATOR_EQUALS
public static final String OPERATOR_NOT_EQUALS
public Alert()
public Alert(RulesProfile rulesProfile, Metric metric, String operator, String valueError, String valueWarning)
rulesProfile
- the profile used to trigger the alertmetric
- the metric tested for the alertoperator
- the operator definedvalueError
- the error valuevalueWarning
- the warning valuepublic RulesProfile getRulesProfile()
public void setRulesProfile(RulesProfile rulesProfile)
public String getOperator()
public void setOperator(String operator)
public String getValueError()
public void setValueError(String valueError)
public String getValueWarning()
public void setValueWarning(String valueWarning)
public boolean isGreaterOperator()
public boolean isSmallerOperator()
public boolean isEqualsOperator()
public boolean isNotEqualsOperator()
public String getAlertLabel(Metric.Level level)
Copyright © 2009-2012 SonarSource. All Rights Reserved.