Class IsNull
java.lang.Object
com.vaadin.featurepack.data.util.filter.IsNull
- All Implemented Interfaces:
Container.Filter,Serializable
Simple container filter checking whether an item property value is null.
This filter also directly supports in-memory filtering.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanappliesToProperty(Object propertyId) Check if a change in the value of a property can affect the filtering result.booleanReturns the property id of the property tested by the filter, not null for valid filters.inthashCode()booleanpassesFilter(Object itemId, Item item) Check if an item passes the filter (in-memory filtering).
-
Constructor Details
-
IsNull
Constructor for a filter that compares the value of an item property with null. For in-memory filtering, a simple == check is performed. For other containers, the comparison implementation is container dependent but should correspond to the in-memory null check.- Parameters:
propertyId- the identifier (not null) of the property whose value to check
-
-
Method Details
-
passesFilter
Description copied from interface:Container.FilterCheck if an item passes the filter (in-memory filtering).- Specified by:
passesFilterin interfaceContainer.Filter- Parameters:
itemId- identifier of the item being filtered; may be null when the item is being added to the containeritem- the item being filtered- Returns:
- true if the item is accepted by this filter
- Throws:
UnsupportedOperationException- if the filter cannot be used for in-memory filtering
-
appliesToProperty
Description copied from interface:Container.FilterCheck if a change in the value of a property can affect the filtering result. May always return true, at the cost of performance. If the filter cannot determine whether it may depend on the property or not, should return true.- Specified by:
appliesToPropertyin interfaceContainer.Filter- Parameters:
propertyId-- Returns:
- true if the filtering result may/does change based on changes to the property identified by propertyId
-
equals
-
hashCode
public int hashCode() -
getPropertyId
Returns the property id of the property tested by the filter, not null for valid filters.- Returns:
- property id (not null)
-