org.sonar.api.profiles
Class Alert

java.lang.Object
  extended by org.sonar.api.database.BaseIdentifiable
      extended by org.sonar.api.profiles.Alert
All Implemented Interfaces:
java.lang.Cloneable

public class Alert
extends BaseIdentifiable
implements java.lang.Cloneable

Class to map alerts with hibernate model


Field Summary
static java.lang.String OPERATOR_EQUALS
          Operator equals
static java.lang.String OPERATOR_GREATER
          Operator strictly greater than
static java.lang.String OPERATOR_NOT_EQUALS
          Operator not equals
static java.lang.String OPERATOR_SMALLER
          Operator strictly lesser than
 
Constructor Summary
Alert()
          Default constructor
Alert(RulesProfile rulesProfile, Metric metric, java.lang.String operator, java.lang.String valueError, java.lang.String valueWarning)
          Creates an alert
 
Method Summary
 java.lang.Object clone()
           
 java.lang.String getAlertLabel(Metric.Level level)
           
 Metric getMetric()
           
 java.lang.String getOperator()
           
 RulesProfile getRulesProfile()
           
 java.lang.String getValueError()
           
 java.lang.String getValueWarning()
           
 boolean isEqualsOperator()
           
 boolean isGreaterOperator()
           
 boolean isNotEqualsOperator()
           
 boolean isSmallerOperator()
           
 void setMetric(Metric metric)
          Sets the alert metric
 void setOperator(java.lang.String operator)
          Sets the alert operator
 void setRulesProfile(RulesProfile rulesProfile)
          Sets the alert profile
 void setValueError(java.lang.String valueError)
          Sets the error value if any
 void setValueWarning(java.lang.String valueWarning)
          Sets the warning value if any
 
Methods inherited from class org.sonar.api.database.BaseIdentifiable
getId, setId
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OPERATOR_GREATER

public static final java.lang.String OPERATOR_GREATER
Operator strictly greater than

See Also:
Constant Field Values

OPERATOR_SMALLER

public static final java.lang.String OPERATOR_SMALLER
Operator strictly lesser than

See Also:
Constant Field Values

OPERATOR_EQUALS

public static final java.lang.String OPERATOR_EQUALS
Operator equals

See Also:
Constant Field Values

OPERATOR_NOT_EQUALS

public static final java.lang.String OPERATOR_NOT_EQUALS
Operator not equals

See Also:
Constant Field Values
Constructor Detail

Alert

public Alert()
Default constructor


Alert

public Alert(RulesProfile rulesProfile,
             Metric metric,
             java.lang.String operator,
             java.lang.String valueError,
             java.lang.String valueWarning)
Creates an alert

Parameters:
rulesProfile - the profile used to trigger the alert
metric - the metric tested for the alert
operator - the operator defined
valueError - the error value
valueWarning - the warning value
Method Detail

getRulesProfile

public RulesProfile getRulesProfile()
Returns:
the alert profile

setRulesProfile

public void setRulesProfile(RulesProfile rulesProfile)
Sets the alert profile


getMetric

public Metric getMetric()
Returns:
the alert metric

setMetric

public void setMetric(Metric metric)
Sets the alert metric


getOperator

public java.lang.String getOperator()
Returns:
the alert operator

setOperator

public void setOperator(java.lang.String operator)
Sets the alert operator


getValueError

public java.lang.String getValueError()
Returns:
the error value

setValueError

public void setValueError(java.lang.String valueError)
Sets the error value if any


getValueWarning

public java.lang.String getValueWarning()
Returns:
the warning value

setValueWarning

public void setValueWarning(java.lang.String valueWarning)
Sets the warning value if any


isGreaterOperator

public boolean isGreaterOperator()
Returns:
whether the operator is greater than

isSmallerOperator

public boolean isSmallerOperator()
Returns:
whether the operator is lesser than

isEqualsOperator

public boolean isEqualsOperator()
Returns:
whether the operator is equals

isNotEqualsOperator

public boolean isNotEqualsOperator()
Returns:
whether the operator is not equals

getAlertLabel

public java.lang.String getAlertLabel(Metric.Level level)

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object


Copyright © 2009-2010 SonarSource. All Rights Reserved.