org.compass.core
Interface CompassQueryFilterBuilder

All Known Implementing Classes:
DefaultCompassQueryFilterBuilder

public interface CompassQueryFilterBuilder

The query builder is used to construct CompassQueryFilterBuilder.ToCompassQueryFilter programmatically. Simple queries, like le(String, Object), will generate a CompassQueryFilterBuilder.ToCompassQueryFilter. More complex ones, will return their repective builder to continue and bulid them (like bool()).

The generated filter can be set on the query itself using CompassQuery.setFilter(CompassQueryFilter).

Author:
kimchy

Nested Class Summary
static interface CompassQueryFilterBuilder.CompassBooleanQueryFilterBuilder
          A boolean query filter builder.
static interface CompassQueryFilterBuilder.ToCompassQueryFilter
          A general interface for internal builders that will create a CompassQueryFilter.
 
Method Summary
 CompassQueryFilter between(String name, Object low, Object high, boolean includeLow, boolean includeHigh)
          Creates a query filter where the resource proeprty is between the given values.
 CompassQueryFilterBuilder.CompassBooleanQueryFilterBuilder bool()
          Creates a boolean query filter builder.
 CompassQueryFilter ge(String name, Object value)
          Creates a query filter where the resource proeprty is greater or equal (>=) to the given value.
 CompassQueryFilter gt(String name, Object value)
          Creates a query filter where the resource proeprty is greater than (>) to the given value.
 CompassQueryFilter le(String name, Object value)
          Creates a query filter where the resource proeprty is less or equal (<=) to the given value.
 CompassQueryFilter lt(String name, Object value)
          Creates a query filter where the resource proeprty is less than (<) the given value.
 CompassQueryFilter query(CompassQuery query)
          Creates a query filter that is based on the given compass query.
 

Method Detail

between

CompassQueryFilter between(String name,
                           Object low,
                           Object high,
                           boolean includeLow,
                           boolean includeHigh)
Creates a query filter where the resource proeprty is between the given values.

The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)

Parameters:
name - The resource property name
low - The low value limit
high - The high value limit
includeLow - Include the lower value
includeHigh - Include the high value
Returns:
The query filter

lt

CompassQueryFilter lt(String name,
                      Object value)
Creates a query filter where the resource proeprty is less than (<) the given value.

The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)

Parameters:
name - The resource property name
value - The high limit value
Returns:
The generated query filter

le

CompassQueryFilter le(String name,
                      Object value)
Creates a query filter where the resource proeprty is less or equal (<=) to the given value.

The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)

Parameters:
name - The resource property name
value - The high limit value
Returns:
The generated query filter

gt

CompassQueryFilter gt(String name,
                      Object value)
Creates a query filter where the resource proeprty is greater than (>) to the given value.

The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)

Parameters:
name - The resource property name
value - The low limit value
Returns:
The generated query filter

ge

CompassQueryFilter ge(String name,
                      Object value)
Creates a query filter where the resource proeprty is greater or equal (>=) to the given value.

The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)

Parameters:
name - The resource property name
value - The low limit value
Returns:
The generated query filter

query

CompassQueryFilter query(CompassQuery query)
Creates a query filter that is based on the given compass query.

Parameters:
query - The query to filter by.
Returns:
The query filter.

bool

CompassQueryFilterBuilder.CompassBooleanQueryFilterBuilder bool()
Creates a boolean query filter builder.

Returns:
The boolean query filter builder


Copyright (c) 2004-2008 The Compass Project.