org.ow2.orchestra.facade.criteria
Class Criteria<T>
java.lang.Object
org.ow2.orchestra.facade.criteria.Criteria<T>
- All Implemented Interfaces:
- Serializable
public class Criteria<T>
- extends Object
- implements Serializable
Criteria class allows to restrict a monitoring request according to criteria.
Supported criteria are:
-
firstResult: the start index for this page. The default value is '0'.
-
maxResults: the maximum number of results to be returned by this page (the
actual number of results may be lesser or even could be 0). The default value
is '-1' and a negative value is treated as meaning no limit .
-
order: a sort order (ascending or descending) on a given field. The default
value is no order.
-
restrictions: a list filters associated by a logical
and
expression. The default value is no filters.
- Author:
- Loic Albertin
- See Also:
PagedResult
,
QueryRuntimeAPI
,
SortableField
,
FilterField
,
Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Criteria
public Criteria()
getMaxResults
public final int getMaxResults()
- Returns:
- the maxResults
setMaxResults
public final Criteria<T> setMaxResults(int maxResults)
- Parameters:
maxResults
- the maxResults to set, a negative value is treated as
meaning no limit (this is the default behavior)
- Returns:
- the updated criteria
getFirstResult
public final int getFirstResult()
- Returns:
- the firstResult
setFirstResult
public final Criteria<T> setFirstResult(int firstResult)
- Parameters:
firstResult
- the firstResult to set, 0 is the default value
- Returns:
- the updated criteria
getOrder
public final Order<T> getOrder()
- Returns:
- the order, returns null no order is set (default)
setOrder
public final Criteria<T> setOrder(Order<T> order)
- Parameters:
order
- the order to set
- Returns:
- the updated criteria
setAscendingOrder
public final Criteria<T> setAscendingOrder(SortableField<T> field)
- Parameters:
field
- a SortableField
on which a ascending sort should be used
- Returns:
- the updated criteria
setDescendingOrder
public final Criteria<T> setDescendingOrder(SortableField<T> field)
- Parameters:
field
- a SortableField
on which a ascending sort should be used
- Returns:
- the updated criteria
addRestriction
public final Criteria<T> addRestriction(Restriction<T> restriction)
- Adds a restriction to the criteria
- Parameters:
restriction
- The Restriction
to add
- Returns:
- the updated criteria
getRestrictions
public final List<Restriction<T>> getRestrictions()
- Returns:
- the List of restrictions, returns an empty list if no restrictions are set (default)
Copyright © 2011 OW2 Consortium. All Rights Reserved.