com.antelmann.db
Class PropertyEntryFilter<T extends PropertyEntry>
java.lang.Object
com.antelmann.db.PropertyEntryFilter<T>
- All Implemented Interfaces:
- CascadingFilter<T>, Filter<T>, Serializable
public class PropertyEntryFilter<T extends PropertyEntry>
- extends Object
- implements Serializable, CascadingFilter<T>
filters on the properties of an entity based on simple equality of key/value pairs.
This filter supports Range objects as values for a restriction.
This filter also supports Object[] as values for a restriction, in which case
the key value is satisfied if it is equal to any of the values within the array.
- Author:
- Holger Antelmann
- See Also:
Range,
Serialized Form
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PropertyEntryFilter
public PropertyEntryFilter()
- a filter with an empty map of restrictions
PropertyEntryFilter
public PropertyEntryFilter(String key,
Object value)
PropertyEntryFilter
public PropertyEntryFilter(Map<String,Object> restrictions)
getFilterString
public String getFilterString()
setFilterString
public void setFilterString(String filterString)
getRestrictions
public Map<String,Object> getRestrictions()
- provides direct access to the embedded restrictions - DO NOT MODIFY WHILE USING THE FILTER
accept
public boolean accept(T entry)
throws ClassCastException
- returns true only if all keys in the given restrictions map to the
same property values in the given entry. IsNotNullCondition, NotNullCondition, Object[] and Range values
in the restriction map are handled separately.
- Specified by:
accept in interface Filter<T extends PropertyEntry>
- Throws:
ClassCastException - if the property value doesn't correspond to a Range's expected object- See Also:
NotCondition,
SQLConstraint.NOT_NULL,
SQLConstraint.IS_NULL,
Range
getInnerFilter
public Filter<? super T> getInnerFilter()
- Specified by:
getInnerFilter in interface CascadingFilter<T extends PropertyEntry>
setInnerFilter
public void setInnerFilter(Filter<? super T> filter)
- Specified by:
setInnerFilter in interface CascadingFilter<T extends PropertyEntry>
(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads