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 aEntityQuery
are compatible with the specified class. Intended to be used with a conditiona restriction or expression as created byRestrictions.conditionalRestriction(Filter, Restriction, Restriction, boolean)
andExpressions.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
All Methods Instance Methods Concrete Methods 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 Detail
-
returnClass
private final Class<?> returnClass
-
-
Constructor Detail
-
ReturnClassFilter
public ReturnClassFilter(Class<?> returnClass)
Creates a filter that matches the specified item class.
-
-
Method Detail
-
evaluate
public boolean evaluate(EntityQuery query)
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
-
-