org.sonar.api.web
Class Criterion

java.lang.Object
  extended by org.sonar.api.web.Criterion

public final class Criterion
extends Object

Definition of a criterion to be used to narrow down a Filter.

Since:
3.1

Field Summary
static String EQ
           
static String GT
           
static String GTE
           
static String LT
           
static String LTE
           
static Set<String> OPERATORS
           
 
Method Summary
static Criterion create(String family, String key, String operator, Float value, boolean variation)
          Creates a new Criterion with a numerical value.
static Criterion create(String family, String key, String operator, String textValue, boolean variation)
          Creates a new Criterion with a text value.
static Criterion createForMetric(String key, String operator, Float value, boolean variation)
          Creates a new Criterion on a metric, with a numerical value.
static Criterion createForMetric(String key, String operator, String textValue, boolean variation)
          Creates a new Criterion on a metric, with a text value.
static Criterion createForQualifier(Object... values)
          Creates a new Criterion on a qualifier.
 String getFamily()
          Get the the criterion's family.
 String getKey()
          Get the the criterion's key.
 String getOperator()
          Get the the criterion's operator.
 String getTextValue()
          Get the the criterion's value as text.
 Float getValue()
          Get the the criterion's value.
 boolean isVariation()
          A criterion can be based on the varation of a value rather than on the value itself.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EQ

public static final String EQ
See Also:
Constant Field Values

GT

public static final String GT
See Also:
Constant Field Values

GTE

public static final String GTE
See Also:
Constant Field Values

LT

public static final String LT
See Also:
Constant Field Values

LTE

public static final String LTE
See Also:
Constant Field Values

OPERATORS

public static final Set<String> OPERATORS
Method Detail

create

public static Criterion create(String family,
                               String key,
                               String operator,
                               Float value,
                               boolean variation)
Creates a new Criterion with a numerical value.

Valid values for the operator are #EQ, #GT, #GTE, #LT and #LTE

Throws:
IllegalArgumentException - if operator is not valid

create

public static Criterion create(String family,
                               String key,
                               String operator,
                               String textValue,
                               boolean variation)
Creates a new Criterion with a text value.

Valid values for the operator are #EQ, #GT, #GTE, #LT and #LTE

Throws:
IllegalArgumentException - if operator is not valid

createForMetric

public static Criterion createForMetric(String key,
                                        String operator,
                                        Float value,
                                        boolean variation)
Creates a new Criterion on a metric, with a numerical value.

Valid values for the operator are #EQ, #GT, #GTE, #LT and #LTE

Throws:
IllegalArgumentException - if operator is not valid

createForMetric

public static Criterion createForMetric(String key,
                                        String operator,
                                        String textValue,
                                        boolean variation)
Creates a new Criterion on a metric, with a text value.

Valid values for the operator are #EQ, #GT, #GTE, #LT and #LTE

Throws:
IllegalArgumentException - if operator is not valid

createForQualifier

public static Criterion createForQualifier(Object... values)
Creates a new Criterion on a qualifier.


getFamily

public String getFamily()
Get the the criterion's family.

Returns:
the family

getKey

public String getKey()
Get the the criterion's key.

Returns:
the key

getOperator

public String getOperator()
Get the the criterion's operator.

Valid values for the operator are #EQ, #GT, #GTE, #LT and #LTE

Returns:
the operator

getValue

public Float getValue()
Get the the criterion's value.

Returns:
the value

getTextValue

public String getTextValue()
Get the the criterion's value as text.

Returns:
the value as text

isVariation

public boolean isVariation()
A criterion can be based on the varation of a value rather than on the value itself.

Returns:
true when the variation is used rather than the value


Copyright © 2009–2014 SonarSource. All rights reserved.