Package com.ocs.dynamo.filter
Class AbstractFilter
- java.lang.Object
-
- com.ocs.dynamo.filter.AbstractFilter
-
-
Constructor Summary
Constructors Constructor Description AbstractFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Andand()Wraps the filter in an And filter (if not already present)Andand(Filter... filters)Constructs a filter that is a conjunction of the provided filtersAndand(Collection<Filter> filters)Constructs a filter that is a conjunction of the provided filters<T> List<T>applyFilter(Collection<T> collection)Applies the filter to a collection of objects and returns those that match the filterAbstractJunctionFilterbetween(String propertyId, Comparable<?> startValue, Comparable<?> endValue)Constructs a "between" for the provided propertyprotected ObjectgetProperty(Object bean, String propertyName)Get the value of a property of the given bean by use of optimized reflection by Spring.AbstractJunctionFiltergreater(String propertyId, Object value)Constructs an "greater than" filter for a propertyAbstractJunctionFiltergreaterOrEqual(String propertyId, Object value)Constructs an "greater or equals" filter for a propertyAbstractJunctionFilterisEqual(String propertyId, Object value)Constructs an "equals" filterAbstractJunctionFilterisNull(String propertyId)Constructs a "isNull" filter for a propertyAbstractJunctionFilterless(String propertyId, Object value)Constructs an "less than" filterAbstractJunctionFilterlessOrEqual(String propertyId, Object value)Constructs a "less or equal" filterAbstractJunctionFilterlike(String propertyId, String value)Constructs a case-sensitive "like" filterAbstractJunctionFilterlike(String propertyId, String value, boolean caseSensitive)Constructs a "like" filter for string comparisonAbstractJunctionFilterlikeIgnoreCase(String propertyId, String value)AbstractJunctionFilternot(Filter filter)Constructs a negation filterOror()Wraps the filter in an Or filter (if not already present)Oror(Filter... filters)Constructs a filter that is a disjunction of the provided filtersOror(Collection<Filter> filters)Constructs a filter that is a disjunction of the provided filtersStringtoString()
-
-
-
Method Detail
-
and
public And and()
Wraps the filter in an And filter (if not already present)- Returns:
-
and
public And and(Collection<Filter> filters)
Constructs a filter that is a conjunction of the provided filters- Parameters:
filters-- Returns:
-
and
public And and(Filter... filters)
Constructs a filter that is a conjunction of the provided filters- Parameters:
filters-- Returns:
-
applyFilter
public <T> List<T> applyFilter(Collection<T> collection)
Applies the filter to a collection of objects and returns those that match the filter- Specified by:
applyFilterin interfaceFilter- Parameters:
collection- the collection to apply the filter to
-
between
public AbstractJunctionFilter between(String propertyId, Comparable<?> startValue, Comparable<?> endValue)
Constructs a "between" for the provided property- Parameters:
propertyId- the propertystartValue- the start value (inclusive)endValue- the end value (inclusive)- Returns:
-
getProperty
protected Object getProperty(Object bean, String propertyName)
Get the value of a property of the given bean by use of optimized reflection by Spring.- Parameters:
bean- The beanpropertyName- The name of the property to get- Returns:
- The property value
-
greater
public AbstractJunctionFilter greater(String propertyId, Object value)
Constructs an "greater than" filter for a property- Parameters:
propertyId- the propertyvalue- the value to compare to- Returns:
-
greaterOrEqual
public AbstractJunctionFilter greaterOrEqual(String propertyId, Object value)
Constructs an "greater or equals" filter for a property- Parameters:
propertyId- the propertyvalue- the value to compare to- Returns:
-
isEqual
public AbstractJunctionFilter isEqual(String propertyId, Object value)
Constructs an "equals" filter- Parameters:
propertyId- the propertyvalue- the value to compare to- Returns:
-
isNull
public AbstractJunctionFilter isNull(String propertyId)
Constructs a "isNull" filter for a property- Parameters:
propertyId- the property- Returns:
-
less
public AbstractJunctionFilter less(String propertyId, Object value)
Constructs an "less than" filter- Parameters:
propertyId-value-- Returns:
-
lessOrEqual
public AbstractJunctionFilter lessOrEqual(String propertyId, Object value)
Constructs a "less or equal" filter- Parameters:
propertyId-value-- Returns:
-
like
public AbstractJunctionFilter like(String propertyId, String value)
Constructs a case-sensitive "like" filter- Parameters:
propertyId-value-- Returns:
-
like
public AbstractJunctionFilter like(String propertyId, String value, boolean caseSensitive)
Constructs a "like" filter for string comparison- Parameters:
propertyId-value-caseSensitive-- Returns:
-
likeIgnoreCase
public AbstractJunctionFilter likeIgnoreCase(String propertyId, String value)
-
not
public AbstractJunctionFilter not(Filter filter)
Constructs a negation filter- Parameters:
filter-- Returns:
-
or
public Or or()
Wraps the filter in an Or filter (if not already present)- Returns:
-
or
public Or or(Collection<Filter> filters)
Constructs a filter that is a disjunction of the provided filters- Parameters:
filters-- Returns:
-
or
public Or or(Filter... filters)
Constructs a filter that is a disjunction of the provided filters- Parameters:
filters-- Returns:
-
-