Package com.vaadin.hilla.crud.filter
Class PropertyStringFilter
java.lang.Object
com.vaadin.hilla.crud.filter.Filter
com.vaadin.hilla.crud.filter.PropertyStringFilter
A filter that matches a given property, or nested property path, against a
filter value using the specified matcher.
Custom filter implementations need to handle this filter by:
- Extracting the property value from the object being filtered using
getPropertyId(). - Convert the string representation of the filter value from
getFilterValue()into a type that can be used for implementing a comparison. - Do the actual comparison using the matcher / operator provided by
getMatcher()
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the filter value to compare against.The matcher, or operator, to use when comparing the property value to the filter value.Gets the property, or nested property path, to filter by.voidsetFilterValue(String filterValue) Sets the filter value to compare against.voidSets the matcher, or operator, to use when comparing the property value to the filter value.voidsetPropertyId(String propertyId) Sets the property, or nested property path, to filter by.toString()
-
Constructor Details
-
PropertyStringFilter
public PropertyStringFilter()
-
-
Method Details
-
getPropertyId
Gets the property, or nested property path, to filter by. For example"name"or"address.city".- Returns:
- the property name
-
setPropertyId
Sets the property, or nested property path, to filter by.- Parameters:
propertyId- the property name
-
getFilterValue
Gets the filter value to compare against. The filter value is always stored as a string, but can represent multiple types of values using specific formats. For example, when filtering a property of typeLocalDate, the filter value could be"2020-01-01". The actual filter implementation is responsible for parsing the filter value into the correct type to use for querying the underlying data layer.- Returns:
- the filter value
-
setFilterValue
Sets the filter value to compare against.- Parameters:
filterValue- the filter value
-
getMatcher
The matcher, or operator, to use when comparing the property value to the filter value.- Returns:
- the matcher
-
setMatcher
Sets the matcher, or operator, to use when comparing the property value to the filter value.- Parameters:
type- the matcher
-
toString
-