Package org.infinispan.objectfilter
Interface ObjectFilter
-
public interface ObjectFilterA 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 interfaceObjectFilter.FilterResultThe output of thefilter(java.lang.Object)method.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ObjectFilter.FilterResultfilter(java.lang.Object instance)Tests if an object instance matches the filter.java.util.Comparator<java.lang.Comparable[]>getComparator()The comparator corresponding to the 'order by' clause, if any.java.lang.StringgetEntityTypeName()The fully qualified entity type name accepted by this filter.java.util.Set<java.lang.String>getParameterNames()Returns the parameter names or an empty Set if there are no parameters.java.util.Map<java.lang.String,java.lang.Object>getParameters()The parameter values.java.lang.String[]getProjection()The array of '.' separated path names of the projected fields if any, ornullotherwise.java.lang.Class<?>[]getProjectionTypes()The types of the projects paths (seegetProjection()ornullif there are not projections.SortField[]getSortFields()The array of sort specifications if defined, ornullotherwise.ObjectFilterwithParameters(java.util.Map<java.lang.String,java.lang.Object> namedParameters)Creates a new ObjectFilter instance based on the current one and the given parameter values.
-
-
-
Method Detail
-
getEntityTypeName
java.lang.String getEntityTypeName()
The fully qualified entity type name accepted by this filter.
-
getProjection
java.lang.String[] getProjection()
The array of '.' separated path names of the projected fields if any, ornullotherwise.
-
getProjectionTypes
java.lang.Class<?>[] getProjectionTypes()
The types of the projects paths (seegetProjection()ornullif there are not projections.
-
getParameterNames
java.util.Set<java.lang.String> getParameterNames()
Returns the parameter names or an empty Set if there are no parameters.
-
getParameters
java.util.Map<java.lang.String,java.lang.Object> getParameters()
The parameter values. Please do not mutate this map. Obtain a new filter instance with new parameter values usingwithParameters(Map).
-
withParameters
ObjectFilter withParameters(java.util.Map<java.lang.String,java.lang.Object> namedParameters)
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, ornullotherwise.
-
getComparator
java.util.Comparator<java.lang.Comparable[]> getComparator()
The comparator corresponding to the 'order by' clause, if any.- Returns:
- the Comparator or
nullif no 'order by' was specified (getSortFields()also returnsnull)
-
filter
ObjectFilter.FilterResult filter(java.lang.Object instance)
Tests if an object instance matches the filter.- Parameters:
instance- the instance to test; this is nevernull- Returns:
- a
FilterResultif there is a match ornullotherwise
-
-