Package net.sf.basedb.core.query
Class ReturnClassFilter
java.lang.Object
net.sf.basedb.core.query.ReturnClassFilter
- All Implemented Interfaces:
Filter<EntityQuery>
public class ReturnClassFilter extends Object implements Filter<EntityQuery>
Filter implementation that checks if the items
returned by a
EntityQuery
are compatible
with the specified class. Intended to be used
with a conditiona restriction or expression as
created by Restrictions.conditionalRestriction(Filter, Restriction, Restriction, boolean)
and Expressions.conditionalExpression(Filter, Expression, Expression)
- Since:
- 3.7
- Author:
- nicklas
-
Field Summary
Fields Modifier and Type Field Description private Class<?>
returnClass
-
Constructor Summary
Constructors Constructor Description ReturnClassFilter(Class<?> returnClass)
Creates a filter that matches the specified item class. -
Method Summary
Modifier and Type Method Description boolean
evaluate(EntityQuery query)
Returns TRUE if theEntityQuery.getItemType()
returns an item type whoseItem.getItemClass()
is compatible with the specified class.
-
Field Details
-
returnClass
-
-
Constructor Details
-
ReturnClassFilter
Creates a filter that matches the specified item class.
-
-
Method Details
-
evaluate
Returns TRUE if theEntityQuery.getItemType()
returns an item type whoseItem.getItemClass()
is compatible with the specified class.- Specified by:
evaluate
in interfaceFilter<EntityQuery>
- Parameters:
query
- The object to evaluate- Returns:
- TRUE if the object passes the filter, FALSE otherwise
-