Package org.infinispan.objectfilter
Interface FilterCallback
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A single-method callback that is specified when registering a filter with a Matcher. The
onFilterResult(java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object[], java.lang.Comparable[])
method is notified of all instances that were presented to Matcher.match(java.lang.Object, java.lang.Object, java.lang.Object)
and successfully matched the filter
associated with this callback. The callback will receive the instance being matched, the projected fields (optional,
if specified) and the 'order by' projections (optional, if specified). The 'order by' projection is an array of
Comparable
that can be compared using the Comparator
provided by FilterSubscription.getComparator()
.
Implementations of this interface are provided by the subscriber and must written is such a way that they can be
invoked from multiple threads simultaneously.- Since:
- 7.0
- Author:
- anistor@redhat.com
-
Method Summary
Modifier and TypeMethodDescriptionvoid
onFilterResult
(Object userContext, Object eventType, Object instance, Object[] projection, Comparable[] sortProjection) Receives notification that an instance matches the filter.
-
Method Details
-
onFilterResult
void onFilterResult(Object userContext, Object eventType, Object instance, Object[] projection, Comparable[] sortProjection) Receives notification that an instance matches the filter.- Parameters:
userContext
- the optional user context object passed toMatcher.match(java.lang.Object, java.lang.Object, java.lang.Object)
eventType
- the optional event type discriminator object passed toMatcher.match(java.lang.Object, java.lang.Object, java.lang.Object)
instance
- the object being matchedprojection
- the projection, if a projection was requested ornull
otherwisesortProjection
- the projection of fields used for sorting, if sorting was requested ornull
otherwise
-