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
Nested Classes Modifier and Type Interface Description static interface
ObjectFilter.FilterResult
The output of thefilter(java.lang.Object)
method.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ObjectFilter.FilterResult
filter(Object instance)
Tests if an object instance matches the filter.Comparator<Comparable[]>
getComparator()
The comparator corresponding to the 'order by' clause, if any.String
getEntityTypeName()
The fully qualified entity type name accepted by this filter.Set<String>
getParameterNames()
Returns the parameter names or an empty Set if there are no parameters.Map<String,Object>
getParameters()
String[]
getProjection()
The array of '.' separated path names of the projected fields if any, ornull
otherwise.Class<?>[]
getProjectionTypes()
SortField[]
getSortFields()
The array of sort specifications if defined, ornull
otherwise.ObjectFilter
withParameters(Map<String,Object> namedParameters)
Creates a new ObjectFilter based on current one and the given parameters.
-
-
-
Method Detail
-
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()
-
getParameterNames
Set<String> getParameterNames()
Returns the parameter names or an empty Set if there are no parameters.
-
withParameters
ObjectFilter withParameters(Map<String,Object> namedParameters)
Creates a new ObjectFilter based on current one and the given parameters.
-
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
ObjectFilter.FilterResult filter(Object instance)
Tests if an object instance matches the filter.- Parameters:
instance
- the instance to test; this is nevernull
- Returns:
- a
FilterResult
if there is a match ornull
otherwise
-
-