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

java.lang.Object
  extended by 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:

Author:
Loic Albertin
See Also:
PagedResult, QueryRuntimeAPI, SortableField, FilterField, Serialized Form

Constructor Summary
Criteria()
           
 
Method Summary
 Criteria<T> addRestriction(Restriction<T> restriction)
          Adds a restriction to the criteria
 int getFirstResult()
           
 int getMaxResults()
           
 Order<T> getOrder()
           
 List<Restriction<T>> getRestrictions()
           
 Criteria<T> setAscendingOrder(SortableField<T> field)
           
 Criteria<T> setDescendingOrder(SortableField<T> field)
           
 Criteria<T> setFirstResult(int firstResult)
           
 Criteria<T> setMaxResults(int maxResults)
           
 Criteria<T> setOrder(Order<T> order)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Criteria

public Criteria()
Method Detail

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.