Package net.sf.basedb.core.query
Class ReturnClassFilter
java.lang.Object
net.sf.basedb.core.query.ReturnClassFilter
- All Implemented Interfaces:
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
-
Constructor Summary
ConstructorDescriptionReturnClassFilter
(Class<?> returnClass) Creates a filter that matches the specified item class. -
Method Summary
Modifier and TypeMethodDescriptionboolean
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
-