Package org.infinispan.objectfilter
Interface ObjectFilter
public interface ObjectFilter
A filter that tests if an object matches a pre-defined condition and returns either the original instance or the
projection, depending on how the filter was created. The projection is represented as an Object[]. If the given
instance does not match the filter will just return null.
- Since:
- 7.0
- Author:
- anistor@redhat.com
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
The output of thefilter(java.lang.Object)
method. -
Method Summary
Modifier and TypeMethodDescriptiondefault ObjectFilter.FilterResult
Tests if an object matches the filter.Tests if an object matches the filter.Comparator
<Comparable<?>[]> The comparator corresponding to the 'order by' clause, if any.The fully qualified entity type name accepted by this filter.Returns the filter parameter names or an emptySet
if there are no parameters.The parameter values.String[]
The array of '.' separated path names of the projected fields if any, ornull
otherwise.Class<?>[]
The types of the projects paths (seegetProjection()
ornull
if there are no projections.The array of sort specifications if defined, ornull
otherwise.withParameters
(Map<String, Object> namedParameters) Creates a new ObjectFilter instance based on the current one and the given parameter values.
-
Method Details
-
getEntityTypeName
String getEntityTypeName()The fully qualified entity type name accepted by this filter. -
getProjection
String[] getProjection()The array of '.' separated path names of the projected fields if any, ornull
otherwise. -
getProjectionTypes
Class<?>[] getProjectionTypes()The types of the projects paths (seegetProjection()
ornull
if there are no projections. -
getParameterNames
Returns the filter parameter names or an emptySet
if there are no parameters. -
getParameters
The parameter values. Please do not mutate this map. Obtain a new filter instance with new parameter values usingwithParameters(Map)
if you have to. -
withParameters
Creates a new ObjectFilter instance based on the current one and the given parameter values. -
getSortFields
SortField[] getSortFields()The array of sort specifications if defined, ornull
otherwise. -
getComparator
Comparator<Comparable<?>[]> getComparator()The comparator corresponding to the 'order by' clause, if any.- Returns:
- the Comparator or
null
if no 'order by' was specified (getSortFields()
also returnsnull
)
-
filter
Tests if an object matches the filter. A shorthand forfilter(null, value, null)
.- Parameters:
value
- the instance to test; this is nevernull
- Returns:
- a
ObjectFilter.FilterResult
if there is a match ornull
otherwise
-
filter
Tests if an object matches the filter. The given key is optional (can be null) and will be returned to the user in theObjectFilter.FilterResult
.- Parameters:
key
- the (optional) key; this can benull
if it is of no interestvalue
- the instance to test; this is nevernull
metadata
- the (optional) metadata; this can benull
if it is of no interest- Returns:
- a
ObjectFilter.FilterResult
if there is a match ornull
otherwise
-