org.ow2.orchestra.facade.criteria
Class Restriction<T>

java.lang.Object
  extended by org.ow2.orchestra.facade.criteria.Restriction<T>
All Implemented Interfaces:
Serializable

public class Restriction<T>
extends Object
implements Serializable

A Restriction represents a constraint that must be observed to match a Criteria.
A Restriction is composed by;

Currently supported operations are:

Author:
Loic Albertin
See Also:
Serialized Form

Field Summary
static String BETWEEN
          Represents an "between" constraint
static String EQUALS
          Represents an "equality" constraint
static String GREATER_THAN
          Represents an "greater than" constraint
static String GREATER_THAN_EQUALS
          Represents an "greater than or equals" constraint
static String LESS_THAN
          Represents an "less than" constraint
static String LESS_THAN_EQUALS
          Represents an "less than or equals" constraint
static long serialVersionUID
           
 
Method Summary
static
<C> Restriction<C>
between(FilterField<C> field, Serializable lower, Serializable upper)
          Static method used to construct an "between" restriction on a given field and lower/upper values
static
<C> Restriction<C>
eq(FilterField<C> field, Serializable value)
          Static method used to construct an "equality" restriction on a given field and value
static
<C> Restriction<C>
ge(FilterField<C> field, Serializable value)
          Static method used to construct an "greater than or equals" restriction on a given field and value
 FilterField<T> getField()
           
 String getOperation()
           
 List getValues()
           
static
<C> Restriction<C>
gt(FilterField<C> field, Serializable value)
          Static method used to construct an "greater than" restriction on a given field and value
static
<C> Restriction<C>
le(FilterField<C> field, Serializable value)
          Static method used to construct an "less than or equals" restriction on a given field and value
static
<C> Restriction<C>
lt(FilterField<C> field, Serializable value)
          Static method used to construct an "less than" restriction on a given field and value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values

EQUALS

public static final String EQUALS
Represents an "equality" constraint

See Also:
Constant Field Values

BETWEEN

public static final String BETWEEN
Represents an "between" constraint

See Also:
Constant Field Values

LESS_THAN

public static final String LESS_THAN
Represents an "less than" constraint

See Also:
Constant Field Values

LESS_THAN_EQUALS

public static final String LESS_THAN_EQUALS
Represents an "less than or equals" constraint

See Also:
Constant Field Values

GREATER_THAN

public static final String GREATER_THAN
Represents an "greater than" constraint

See Also:
Constant Field Values

GREATER_THAN_EQUALS

public static final String GREATER_THAN_EQUALS
Represents an "greater than or equals" constraint

See Also:
Constant Field Values
Method Detail

getField

public final FilterField<T> getField()
Returns:
The field on which the restriction applies

getValues

public final List getValues()
Returns:
The value on which the Restriction applies

getOperation

public final String getOperation()
Returns:
The operation that links the field and the value

eq

public static <C> Restriction<C> eq(FilterField<C> field,
                                    Serializable value)
Static method used to construct an "equality" restriction on a given field and value

Parameters:
field - The field on which the restriction applies
value - The value on which the Restriction applies
Returns:
The corresponding Restriction

between

public static <C> Restriction<C> between(FilterField<C> field,
                                         Serializable lower,
                                         Serializable upper)
Static method used to construct an "between" restriction on a given field and lower/upper values

Parameters:
field - The field on which the restriction applies
lower - The lower value on which the Restriction applies
upper - The upper value on which the Restriction applies
Returns:
The corresponding Restriction

lt

public static <C> Restriction<C> lt(FilterField<C> field,
                                    Serializable value)
Static method used to construct an "less than" restriction on a given field and value

Parameters:
field - The field on which the restriction applies
value - The value on which the Restriction applies
Returns:
The corresponding Restriction

le

public static <C> Restriction<C> le(FilterField<C> field,
                                    Serializable value)
Static method used to construct an "less than or equals" restriction on a given field and value

Parameters:
field - The field on which the restriction applies
value - The value on which the Restriction applies
Returns:
The corresponding Restriction

gt

public static <C> Restriction<C> gt(FilterField<C> field,
                                    Serializable value)
Static method used to construct an "greater than" restriction on a given field and value

Parameters:
field - The field on which the restriction applies
value - The value on which the Restriction applies
Returns:
The corresponding Restriction

ge

public static <C> Restriction<C> ge(FilterField<C> field,
                                    Serializable value)
Static method used to construct an "greater than or equals" restriction on a given field and value

Parameters:
field - The field on which the restriction applies
value - The value on which the Restriction applies
Returns:
The corresponding Restriction


Copyright © 2011 OW2 Consortium. All Rights Reserved.